Trax for UberEmulator! :D

Status
Not open for further replies.
🚫
Exiled
Joined
Jan 9, 2010
Messages
1,850
Reaction score
503
Since most of you newbs ( Jontycat, others ) think i can't code, here's some damn proof that i CAN code.
Yeah, sorry for my bad english i'm dutch bla bla..

I was gonna use this for my own hotel, but then i thought, Why not release it? :P

Printscreen:


Open HabboHotel > Items > FurniInteractor.cs
Search for:

PHP:
class InteractorLoveShuffler : FurniInteractor

And put under that class this new class:

PHP:
    class InteractorSoundMachine : FurniInteractor
    {
        public override void OnPlace(GameClient Session, RoomItem Item)
        {
            Item.ExtraData = "0";
        }

        public override void OnRemove(GameClient Session, RoomItem Item)
        {
            Item.ExtraData = "0";
        }

        public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomUser User = Item.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            if (!UserHasRights)
            {
                return;
            }

            if (Item.ExtraData != "1")
            {
                uint TraxRoomId = Item.RoomId;
                string TraxOwner = Item.GetRoom().Owner;
                string TraxMusicName = "Music Mix";
                
                SoundMachine SoundMachine = new SoundMachine(TraxRoomId, TraxOwner, 1, 21, TraxMusicName);
                Item.GetRoom().SendMessage(SoundMachine.PrepareSong());
                Item.GetRoom().SendMessage(SoundMachine.Play());

                Item.ExtraData = "1";
                Item.UpdateState(false, true);
            }
            else
            {
                Item.ExtraData = "0";
                Item.UpdateState(false, true);
            }
        }
    }

Open HabboHotel > Items > RoomItem.cs
Search for:
PHP:
                    case "loveshuffler":

                        return new InteractorLoveShuffler();

Put this under it:
PHP:
                    case "soundmachine":

                        return new InteractorSoundMachine();

Make a new class called "SoundMachine.cs" inside HabboHotel > Items
And put this inside it:

PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using Uber.Storage;
using Uber.Util;
using Uber.Messages;

namespace Uber.HabboHotel.Items
{
    class SoundMachine
    {
        public string TraxSong;
        public string TraxMusicName;
        public string TraxOwner;

        public uint TraxRoomId;
        public uint TraxSongId;
        public uint TraxSongLength;

        public int TraxPart_1 = UberEnvironment.GetRandomNumber(100, 300);
        public int TraxPart_2 = UberEnvironment.GetRandomNumber(100, 300);
        public int TraxPart_3 = UberEnvironment.GetRandomNumber(100, 250);
        public int TraxPart_4 = UberEnvironment.GetRandomNumber(100, 150);
        public int TraxPart_5 = UberEnvironment.GetRandomNumber(50, 60);
        public int TraxPart_6 = UberEnvironment.GetRandomNumber(80, 100);

        public SoundMachine(uint mTraxRoomId, string mTraxOwner, uint mTraxSongId, uint mTraxSongLength, string mTraxMusicName)
        {
            this.TraxRoomId = mTraxRoomId;
            this.TraxOwner = mTraxOwner;
            this.TraxSong = "1:" + TraxPart_1 + ",3;" + TraxPart_2 + ",3;" + TraxPart_3 + ",4;" + TraxPart_4 + ",4;" + TraxPart_5 + ",3;" + TraxPart_6 + ",4:2:0,21:3:0,21:4:0,21:";
            this.TraxSongId = mTraxSongId;
            this.TraxSongLength = mTraxSongLength;
            this.TraxMusicName = mTraxMusicName;
        }

        public ServerMessage PrepareSong()
        {
            // DlaWudmooie muziek{2}1:277,3;278,3;275,4;276,4;279,3;274,4:2:0,21:3:0,21:4:0,21:{2}{1}

            ServerMessage PrepareTraxSong = new ServerMessage(300);
            PrepareTraxSong.AppendUInt(TraxSongId);
            PrepareTraxSong.AppendStringWithBreak(TraxMusicName);
            PrepareTraxSong.AppendStringWithBreak(TraxSong);
            PrepareTraxSong.AppendInt32(1);

            return PrepareTraxSong;
        }

        public ServerMessage Play()
        {
            // ECrm_}ZEIaWudQEmooie muziek{2}vogel-twanio{2}{1}

            ServerMessage PlayTrax = new ServerMessage(323);
            PlayTrax.AppendUInt(TraxRoomId);
            PlayTrax.AppendInt32(1);
            PlayTrax.AppendUInt(TraxSongId);
            PlayTrax.AppendUInt(TraxSongLength);
            PlayTrax.AppendStringWithBreak(TraxMusicName);
            PlayTrax.AppendStringWithBreak(TraxOwner);
            PlayTrax.AppendInt32(1);

            return PlayTrax;
        }
    }
}

And as last, add a new interaction called "soundmachine" in the column interaction_type inside
your furniture table and give the Trax Machines that interaction.

Have fun! :D
 
Last edited:
I like the release.@Landana some emus alredy have music.Some ppl just dont have trax working.Some cant be bother to code it.But its a good release
 
Need to create a interaction?
/facepalm
Yeah, what else!? o_O

---------- Post added at 05:07 PM ---------- Previous post was at 05:05 PM ----------

I like the release.@Landana some emus alredy have music.Some ppl just dont have trax working.Some cant be bother to code it.But its a good release
I lol'd at that post, there's never been a uber-edit with Trax coded & It needs to be coded, its not client-side idiot, that's why i released this..
 
It doesnt works by me :(

---------- Post added at 05:22 PM ---------- Previous post was at 05:17 PM ----------

Could someone post his Emulator? Maybe with many other feautures? Would be nice.

Thanks.
 
Type or Namespace name SoundMachine could not be found.

I entered it all correctly.
Does it work with all emulators?
If not. Which one should I use?
 
Type or Namespace name SoundMachine could not be found.

I entered it all correctly.
Does it work with all emulators?
If not. Which one should I use?
You most likely didn't make a new class called SoundMachine.cs inside the Items folder..
 
Do i rly need to create a tutorial how to setup? O_O

---------- Post added at 05:56 PM ---------- Previous post was at 05:55 PM ----------

It works, thank you :D
Your welcome.

--- EDIT ---

Added printscreen:
 
Last edited:
I had so:

In Uber.Messages.GameClientMessageHandler
In public void RegisterRooms() add
Code:
RequestHandlers[245] = new RequestHandler(TraxPlayer);
RequestHandlers[221] = new RequestHandler(TraxDownload);

And after
Code:
private void TraxPlayer()
        {
                Response.Init(323); // EC
                Response.AppendInt32(1);
                Response.AppendInt32(1);
                Response.AppendInt32(1); // ID
                Response.AppendInt32(340); // Time
                Response.AppendStringWithBreak("The Catalyst"); // Name
                Response.AppendStringWithBreak("Linkin Park"); // Author
                SendResponse();
        }

        private void TraxDownload()
        {
            int SongID = Request.PopWiredInt32();

            Response.Init(300); // Dl
            Response.AppendInt32(1); // ID
            Response.AppendStringWithBreak("Linkin Park"); // Name
            Response.AppendStringWithBreak("1:1,340:");
            SendResponse();
        }

PS. It's not done. Just temp code.

@PEjump2 Great work
 
@PEJump, don't be too rude, your reputation goes down.
@Landana, you fail. If you follow the steps, it'll work.

Good release, PEjump2 :)
My Reputation goes down?
Never expected a Meth0d-wanna-be to say that to me..

Anyways, for all you damn newbs here that can't add a simple interaction to the database, run this sql:

Code:
ALTER TABLE `furniture` CHANGE `interaction_type` `interaction_type` ENUM('default',  'gate',  'postit',  'roomeffect',  'dimmer',  'trophy', 'bed',  'scoreboard',  'vendingmachine',  'alert',  'onewaygate',  'loveshuffler',  'habbowheel',  'dice',  'bottle',  'teleport',  'rentals',  'pet', 'water1',  'water2',  'shower',  'roller',  'ball',  'bb_blue_gate',  'bb_red_gate',  'bb_yellow_gate',  'bb_green_gate',  'bb_plate',  'firework', 'soundmachine') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT  'default';

UPDATE `furniture` SET  `interaction_type` =  'soundmachine' WHERE `item_name` LIKE  '%sound_machine%';
UPDATE `furniture` SET  `interaction_type` =  'soundmachine' WHERE `item_name` LIKE  'traxsilver';
UPDATE `furniture` SET  `interaction_type` =  'soundmachine' WHERE `item_name` LIKE  'traxgold';
UPDATE `furniture` SET  `interaction_type` =  'soundmachine' WHERE `item_name` LIKE  'traxbronze';
UPDATE `furniture` SET  `interaction_type` =  'soundmachine' WHERE `item_name` LIKE  'nouvelle_trax';
UPDATE `furniture` SET  `interaction_type` =  'soundmachine' WHERE `item_name` LIKE  'ads_idol_trax';
 
This is just the "Play" trax sounds,
Like habbo has but this one plays another song everytime :P
 
Interesting. But as I recall the sound editing isn't coded on Habbo yet? such as you can't create trax just play old ones from the shockwave client ? What does yours do? Broadcast the message that a 'song' is playing ? Can you explain to me a bit more. Thanks..

I think copy the Old Code into the SoundMashine.cs and it plays. It plays yet a gay short song xD So it works.. But sometimes it turns off idk why.. But it works!

-Slaxxer
 
I don't understand how to made a Song :/ Should I find the packets of the Song or what? PEjump explain it here, or on MSN when you unblock me xDDDD

-Slaxxer

The trax song creator isn't coded yet. You can only use pre-existing made trax from the shockwave client.
 
Uhm Matthew.. Here is a Song:

Code:
1:240,12:2:236,10;538,2:3:241,2;242,4;239,2;533,2;0,2:4:0,2;240,2;539,2;238,2;539,2;0,2:

But what is with the variables, "TraxPart_1" or "TraxPart_2"?

Code:
"1:" + TraxPart_1 + ",3;" + TraxPart_2 + ",3;" + TraxPart_3 + ",4;" + TraxPart_4 + ",4;" + TraxPart_5 + ",3;" + TraxPart_6 + ",4:2:0,21:3:0,21:4:0,21:";

-Slaxxer
 
IT WORKS YAY :D This song is a MUCH cooler xD

Code:
this.TraxSong = "1:82,1;83,2;84,1;85,1;86,1;87,4;88,1;89,2;90,2;89,2;82,1;84,1;86,1;88,1;85,1;84,1;85,1;86,1;89,4;90,1:2:505,4;506,4;507,2;508,4;509,2;510,2;511,2;512,2;513,1;511,2;513,1;510,2;512,2:3:514,4;515,4;516,4;517,2;518,1;519,2;520,4;521,2;522,4;521,2;0,1:4:526,2;524,2;523,2;528,2;529,1;530,4;531,2;527,2;529,3;526,2;524,2;525,2;526,2;523,2:";

Credits to Oni for his Database where this Code was in :D

-Slaxxer


EDIT: OMG FAAAAAAAILED NORMAL USER CAN TURN ON AND OFF THE TRAX??? WTHF????? Fix it Thanks!
 
Last edited:
Status
Not open for further replies.
Back