bump......
Hi there, last builds all my realm relay scripts worked fine but now some of them wouldn't work. I decompiled the client to see if the packets I need changed but that wasn't the case.
The code that worked fine but stopped working now:can anyone help me get this too work again?Code:$.echo("test loaded."); var ID_REQUESTTRADE = $.findPacketId("REQUESTTRADE"); var ID_TRADEREQUESTED = $.findPacketId("TRADEREQUESTED"); function onServerPacket(event) { packet = event.getPacket(); if (packet.id() == ID_TRADEREQUESTED) { var trade_packet = event.createPacket(ID_REQUESTTRADE); trade_packet.name = packet.name; event.sendToServer(trade_packet); } }
thanks
pieoewieoe
bump......
Can someone test this in realm relay and reply if it accept the trade or not? That way I know if it's me or if there is something wrong with the packets.
edit
just found out that the attribute "name" from the TRADEREQUESTED packed is "TRADEREQUESTED" where it was the name of the player before the update.
Last edited by pieoewieoe; 10-08-2014 at 09:39 AM.
When someone trades you, this code would print the name of the guy who traded you on the cmd screen.Code:$.echo("test loaded."); var ID_REQUESTTRADE = $.findPacketId("REQUESTTRADE"); var ID_TRADEREQUESTED = $.findPacketId("TRADEREQUESTED"); function onServerPacket(event) { packet = event.getPacket(); if (packet.id() == ID_TRADEREQUESTED) { $.echo(packet.name); } }
ex. player1 trades you, so on the cmd it would say "player1"
But last 2 builds the code above would print the name of the packed on the cmd screen.
ex. player1 trades you, but the cmd it would print "TRADEREQUESTED"
I still don't know if it's still me or if the packet changed or something.
edit. I changed the attribute name in the source to name_ and build the jar and now it works don't need help anymore
Last edited by pieoewieoe; 10-09-2014 at 01:15 PM.
I Would check https://www.mpgh.net/forum/showthread.php?t=788869
Thats the only script i've seen with automatic trade accepting