Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Trax for UberEmulator! :D

Status
Not open for further replies.
Banned
Banned
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:
Skilled Illusionist
Joined
Oct 22, 2010
Messages
361
Reaction score
34
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
 
Banned
Banned
Joined
Jan 9, 2010
Messages
1,850
Reaction score
503
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..
 
Newbie Spellweaver
Joined
Jul 7, 2009
Messages
96
Reaction score
45
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.
 
Custom Title Activated
Loyal Member
Joined
Oct 21, 2007
Messages
2,098
Reaction score
464
calm down and ricky keep the witch slap down ^^

it was a simple question like
what features does the trax have
is it 100%

im sure he can read
thats all he said PEjump
 
Experienced Elementalist
Joined
Jun 11, 2010
Messages
229
Reaction score
23
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?
 
Banned
Banned
Joined
Jan 9, 2010
Messages
1,850
Reaction score
503
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..
 
Banned
Banned
Joined
Jan 9, 2010
Messages
1,850
Reaction score
503
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:
Joined
Apr 27, 2008
Messages
446
Reaction score
168
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
 
Banned
Banned
Joined
Jan 9, 2010
Messages
1,850
Reaction score
503
@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';
 
Banned
Banned
Joined
Jan 9, 2010
Messages
1,850
Reaction score
503
This is just the "Play" trax sounds,
Like habbo has but this one plays another song everytime :p
 
Experienced Elementalist
Joined
Apr 6, 2009
Messages
296
Reaction score
64
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
 
Experienced Elementalist
Joined
Apr 6, 2009
Messages
296
Reaction score
64
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
 
Experienced Elementalist
Joined
Apr 6, 2009
Messages
296
Reaction score
64
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:
Junior Spellweaver
Joined
Jan 9, 2011
Messages
136
Reaction score
17
How can I add my own music? ;o besides ones made by sulake.
 
Status
Not open for further replies.
Back
Top