HelpNeed Help with coding a RealmRelay Script!

Posts 1–7 of 7 · Page 1 of 1
Need Help with coding a RealmRelay Script!
Hello there!

I'd like to know how to make this function works :
Code:
function sound(soundeffect) {
	var notificationPacket = $.createPacket(ID_PLAYSOUND);
	notificationPacket.ownerId = playerObjectId;
	notificationPacket.soundId = 19 //This is where I need help!
	$.sendToClient(notificationPacket);
}
I need help with the "soundId" thing.
Is there any list out here with the sound names and their IDs?

THANKS A LOT! <3


Also ; what is the lock-a-player function? I counldnt find it.. :/ Are they client sided stored?
Locking players can't be client sided. But now that you mention it, I'm interested to see how they work as well... Something I'll look into if RR is updated. As for sound id's, I would recommend running around realms and printing out the contents of sound packets to see what soundIds you get. I don't imagine they are very complicated. Probably just 0 through N.
Quote Originally Posted by Nisuxen View Post
Something I'll look into if RR is updated.
The RR 17.3+ thread was closed for being outdated once again, but it still works with 18.0.
Quote Originally Posted by DeVoidCoder View Post
The RR 17.3+ thread was closed for being outdated once again, but it still works with 18.0.
Next time that happens. Just respond to the Close Thread message you got with proof that it still works. If you provide me a screenshot or the such. I can reopen it off mobile. Just can't check it atm.
Quote Originally Posted by Nisuxen View Post
I would recommend running around realms and printing out the contents of sound packets to see what soundIds you get.
Woah! That's a great idea!
Gimme some time ill brb with the script <3


Quote Originally Posted by Nisuxen View Post
Locking players can't be client sided. But now that you mention it, I'm interested to see how they work as well...


After some work, I found that the packet concerned is "EDITACCOUNTLIST".

Here is the script I used ; (may be usefull for futur works)

 
onpacket.js

Code:
//OnPacket.js


$.echo("> OnPacket loaded.");


var ID_ACCEPTTRADE = $.findPacketId("ACCEPTTRADE");
var ID_AOEACK = $.findPacketId("AOEACK");
var ID_BUY = $.findPacketId("BUY");
var ID_CANCELTRADE = $.findPacketId("CANCELTRADE");
var ID_CHANGEGUILDRANK = $.findPacketId("CHANGEGUILDRANK");
var ID_CHANGETRADE = $.findPacketId("CHANGETRADE");
var ID_CHECKCREDITS = $.findPacketId("CHECKCREDITS");
var ID_CHOOSENAME = $.findPacketId("CHOOSENAME");
var ID_CREATEGUILD = $.findPacketId("CREATEGUILD");
var ID_CREATE = $.findPacketId("CREATE");
var ID_EDITACCOUNTLIST = $.findPacketId("EDITACCOUNTLIST");
var ID_ENEMYHIT = $.findPacketId("ENEMYHIT");
var ID_ESCAPE = $.findPacketId("ESCAPE");
var ID_GOTOACK = $.findPacketId("GOTOACK");
var ID_GROUNDDAMAGE = $.findPacketId("GROUNDDAMAGE");
var ID_GUILDINVITE = $.findPacketId("GUILDINVITE");
var ID_GUILDREMOVE = $.findPacketId("GUILDREMOVE");
var ID_HELLO = $.findPacketId("HELLO");
var ID_INVDROP = $.findPacketId("INVDROP");
var ID_INVSWAP = $.findPacketId("INVSWAP");
var ID_JOINGUILD = $.findPacketId("JOINGUILD");
var ID_LOAD = $.findPacketId("LOAD");
var ID_MOVE = $.findPacketId("MOVE");
var ID_OTHERHIT = $.findPacketId("OTHERHIT");
var ID_PLAYERHIT = $.findPacketId("PLAYERHIT");
var ID_PLAYERSHOOT = $.findPacketId("PLAYERSHOOT");
var ID_PLAYERTEXT = $.findPacketId("PLAYERTEXT");
var ID_PONG = $.findPacketId("PONG");
var ID_REQUESTTRADE = $.findPacketId("REQUESTTRADE");
var ID_RESKIN = $.findPacketId("RESKIN");
var ID_SETCONDITION = $.findPacketId("SETCONDITION");
var ID_SHOOTACK = $.findPacketId("SHOOTACK");
var ID_SQUAREHIT = $.findPacketId("SQUAREHIT");
var ID_TELEPORT = $.findPacketId("TELEPORT");
var ID_UPDATEACK = $.findPacketId("UPDATEACK");
var ID_USEITEM = $.findPacketId("USEITEM");
var ID_USEPORTAL = $.findPacketId("USEPORTAL");





function onClientPacket(event) {
        // get the packet involved in this event
        var packet = event.getPacket();
		
		
		
        // if this event's packet is a TEXT packet...
		
		if (packet.id() == ID_ACCEPTTRADE) {$.echo("> Sent a accepttrade packet.");}
		if (packet.id() == ID_AOEACK) {$.echo("> Sent a aeoak packet.");}
		if (packet.id() == ID_BUY) {$.echo("> Sent a buy packet.");}
		if (packet.id() == ID_CANCELTRADE) {$.echo("> Sent a canceltrade packet.");}
		if (packet.id() == ID_CHANGEGUILDRANK) {$.echo("> Sent a changeguildrank packet.");}
		if (packet.id() == ID_CHANGETRADE) {$.echo("> Sent a changetrade packet.");}
		if (packet.id() == ID_CHECKCREDITS) {$.echo("> Sent a checkcredits packet.");}
		if (packet.id() == ID_CHOOSENAME) {$.echo("> Sent a choosename packet.");}
		if (packet.id() == ID_CREATEGUILD) {$.echo("> Sent a createguild packet.");}
		if (packet.id() == ID_CREATE) {$.echo("> Sent a create packet.");}
		if (packet.id() == ID_EDITACCOUNTLIST) {$.echo("> Sent an editaccountlist packet.");}
		if (packet.id() == ID_ENEMYHIT) {$.echo("> Sent an enemyhit packet.");}
		if (packet.id() == ID_ESCAPE) {$.echo("> Sent an escape packet.");}
		if (packet.id() == ID_GOTOACK) {$.echo("> Sent a gotoack packet.");}
		if (packet.id() == ID_GROUNDDAMAGE) {$.echo("> Sent a grounddamage packet.");}
		if (packet.id() == ID_GUILDINVITE) {$.echo("> Sent a guildinvite packet.");}
		if (packet.id() == ID_GUILDREMOVE) {$.echo("> Sent a guildremove packet.");}
		if (packet.id() == ID_HELLO) {$.echo("> Sent a hello packet.");}
		if (packet.id() == ID_INVDROP) {$.echo("> Sent a invdrop packet.");}
		if (packet.id() == ID_INVSWAP) {$.echo("> Sent a invswap packet.");}
		if (packet.id() == ID_JOINGUILD) {$.echo("> Sent a joinguild packet.");}
		if (packet.id() == ID_LOAD) {$.echo("> Sent a load packet.");}
		if (packet.id() == ID_MOVE) {$.echo("> Sent a move packet.");}//Update the pos
		if (packet.id() == ID_OTHERHIT) {$.echo("> Sent a otherhit packet.");}
		if (packet.id() == ID_PLAYERHIT) {$.echo("> Sent a playerhit packet.");}
		if (packet.id() == ID_PLAYERSHOOT) {$.echo("> Sent a playershoot packet.");}
		if (packet.id() == ID_PLAYERTEXT) {$.echo("> Sent a playertext packet.");}
		if (packet.id() == ID_PONG) {$.echo("> Sent a pong packet.");}//IDK?
		if (packet.id() == ID_REQUESTTRADE) {$.echo("> Sent a requesttrade packet.");}
		if (packet.id() == ID_RESKIN) {$.echo("> Sent a reskin packet.");}
		if (packet.id() == ID_SETCONDITION) {$.echo("> Sent a setcondition packet.");}
		if (packet.id() == ID_SHOOTACK) {$.echo("> Sent a shootack packet.");}
		if (packet.id() == ID_SQUAREHIT) {$.echo("> Sent a squarehit packet.");}
		if (packet.id() == ID_TELEPORT) {$.echo("> Sent a teleport packet.");}
		if (packet.id() == ID_UPDATEACK) {$.echo("> Sent a updateack packet.");}//Update the tiles and ojects
		if (packet.id() == ID_USEITEM) {$.echo("> Sent a useitem packet.");}
		if (packet.id() == ID_USEPORTAL) {$.echo("> Sent a useportal packet.");}
		
		
		
		
		
		
		
		
		
		
}


Todo :

Find a way to convert a players name into objectId...
Quote Originally Posted by DeVoidCoder View Post
The RR 17.3+ thread was closed for being outdated once again, but it still works with 18.0.
Ah I see. I only tried it on the rotmg website and it didn't work. Works fine with client. I'll know better next time.
Ah that's what that packet is for.
Quote Originally Posted by ZBORNOX View Post
Find a way to convert a players name into objectId...
I can help you out there. Whenever you get an update function with a bunch of Entities each containing a Satus with an array of StatDatas. Whichever StatData has an obf0 of 31 also has an obf2 containing the player's name. Couple of my scripts keep up with player names based on objectIds.
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us