-
Trax for UberEmulator! :D
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:
http://iaza.com/work/110201C/iaza14554981768600.png
Open HabboHotel > Items > FurniInteractor.cs
Search for:
PHP Code:
class InteractorLoveShuffler : FurniInteractor
And put under that class this new class:
PHP Code:
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 Code:
case "loveshuffler":
return new InteractorLoveShuffler();
Put this under it:
PHP Code:
case "soundmachine":
return new InteractorSoundMachine();
Make a new class called "SoundMachine.cs" inside HabboHotel > Items
And put this inside it:
PHP Code:
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
-
Re: Trax for UberEmulator! :D
I put this in, how can I make now music?
-
Re: Trax for UberEmulator! :D
Need to create a interaction?
-
Re: Trax for UberEmulator! :D
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
-
Re: Trax for UberEmulator! :D
Quote:
Originally Posted by
GuikBretas
Need to create a interaction?
/facepalm
Yeah, what else!? o_O
---------- Post added at 05:07 PM ---------- Previous post was at 05:05 PM ----------
Quote:
Originally Posted by
Miggs
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..
-
Re: Trax for UberEmulator! :D
Maybe tell more.
What does it do?
-
Re: Trax for UberEmulator! :D
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.
-
Re: Trax for UberEmulator! :D
calm down and ricky keep the bitch 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
-
Re: Trax for UberEmulator! :D
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?
-
Re: Trax for UberEmulator! :D
Quote:
Originally Posted by
Mikehunt
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..
-
Re: Trax for UberEmulator! :D
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 ----------
Quote:
Originally Posted by
MikeDavies
It works, thank you :D
Your welcome.
--- EDIT ---
Added printscreen:
http://iaza.com/work/110201C/iaza14554981768600.png
-
Re: Trax for UberEmulator! :D
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
-
Re: Trax for UberEmulator! :D
Quote:
Originally Posted by
GuikBretas
i make the steps all right, its debbuging, but the trax only turn on :X
/facepalm
Did you add the "soundmachine" interaction to the Trax furniture? -.-
-
Re: Trax for UberEmulator! :D
Quote:
Originally Posted by
DjInTrouble
@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';
-
Re: Trax for UberEmulator! :D
This is just the "Play" trax sounds,
Like habbo has but this one plays another song everytime :P
-
Re: Trax for UberEmulator! :D
Quote:
Originally Posted by
Matthew
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
-
Re: Trax for UberEmulator! :D
Quote:
Originally Posted by
DarkBreakX
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.
-
Re: Trax for UberEmulator! :D
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
-
Re: Trax for UberEmulator! :D
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!
-
Re: Trax for UberEmulator! :D
How can I add my own music? ;o besides ones made by sulake.
-
Re: Trax for UberEmulator! :D
you can also take songs from
habbo.com/trax/song/song id
But you will have to change structure
-
Re: Trax for UberEmulator! :D
infraction spree!!! quit posting abusive messages or I'll be showing you the "you dont have permission" screen.
-
Re: Trax for UberEmulator! :D
I hate to break your cock girlfriend but this code is not really anything new, we all know trax works, in fact it's been coded numerous times. ;P In any regard good to see someone contributing regardless of how minor the contribution.
-
Re: Trax for UberEmulator! :D
Anybody can do a Rock Music? :D
-
Re: Trax for UberEmulator! :D
Quote:
Originally Posted by
Nills
Sexy Supers'X
But eh, PEJump, dude leave this shit.
Wannabe - Nillus? yes i'm a wannabe Nillus and now?
And eh you can't code nub, omfg. Stop thinking you can code, don't being noob spamming bastard >_<
I can code, i'm not a noob & I'm not leaving.
You NEVER released anything and you'r asking FAIL-Java-wanna-be-coder-SpazzEmu if his server is stable in the Uberedit release thread?
And you don't call that noob? Seriously dude..
---------- Post added at 09:17 PM ---------- Previous post was at 09:16 PM ----------
Quote:
Originally Posted by
DarkBreakX
Please don't spam wth? Go on Topic -.-' PEjump Update the Code.. Turn on/off bug.. If you don't have it than okey.. Anyone else should be able to fix it.. It is easy I think.. But if someone have it RELEASE IT!!
-Slaxxer
Updated the code, happy now?