Thread: Realm Relay /tp

Results 1 to 11 of 11
  1. #1
    Nisuxen's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    164
    Reputation
    10
    Thanks
    95

    Realm Relay /tp

    The feature from Odom I missed the most. Type /tp and the start of someones name and the script fills in the rest. Next release will be quite fun.

     
    Code:
    // tp.js
    
    var ID_PLAYER_TEXT = 80;
    var ID_UPDATE = 66;
    var ID_TELEPORT = 67;
    
    var players = {};
    
    function onClientPacket(event) {
    	var packet = event.getPacket();
    	switch (packet.id()) {
    		case ID_PLAYER_TEXT: {
    			var text = packet.text.toLowerCase();
    			if(text.length() >= 3 && text.substring(0,3) == "/tp"){
    				event.cancel();
    
    				if(text.length() <= 4){
    					break;
    				}
    				var toTp = text.substring(4, text.length());
    
    				for(var player in players){
    					var name = players[player].toLowerCase();
    					if(name.length() < toTp.length())
    						continue;
    					if (toTp == name.substring(0,toTp.length())){
    						//send tp packet
    						var tp_packet = event.createPacket(ID_TELEPORT);
    						tp_packet.objectId = player;
    						event.sendToServer(tp_packet);
    						break;
    					}
    				}
    			}
    			break;
    		}
    	}
    }
    
    function onServerPacket(event) {
    	var packet = event.getPacket();
    	switch (packet.id()) {
    		case ID_UPDATE: {
    			if(packet.newObjs == null)
    				break;
    
    			// New objects
    			for (var i = 0; i < packet.newObjs.length; i++) {
    				var objectData = packet.newObjs[i];
    
    				var type = objectData.objectType;
    				if(type == 768 || type == 775 || type == 782 || type == 784 || (type >= 797 && type <= 806)){ // player classes
    					for (var j = 0; j < objectData.status.data.length; j++) {
    						var statData = objectData.status.data[j];
    
    						if(statData != null && statData.obf0 == 31){
    							players[objectData.status.objectId] = statData.obf2;
    							break;
    						}
    					}
    				}
    			}
    
    			// Removed objects
    			for (var i = 0; i < packet.drops.length; i++) {
    				var droppedObjectId = packet.drops[i];
    
    				if(players[droppedObjectId] != null){
    					delete players[droppedObjectId];			
    				}
    			}
    			break;
    		}
    	}
    }

  2. The Following 2 Users Say Thank You to Nisuxen For This Useful Post:

    059 (12-17-2013),Alde. (12-17-2013)

  3. #2
    Zasx's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Location
    Northern Italy
    Posts
    1,379
    Reputation
    10
    Thanks
    442
    My Mood
    Yeehaw
    Obviously gonna try this.
    "First get me some porn accounts"
    . . . . . . . . . . . . . . .-Trapped

  4. #3
    JustAnoobROTMG's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    1,916
    Reputation
    185
    Thanks
    18,230
    You can easily do /tq now
    Due to a recent DMCA takedown attempt we had to remove Faintmako brain. Please do not paid attention to what he say or do.


  5. #4
    Nisuxen's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    164
    Reputation
    10
    Thanks
    95
    Quote Originally Posted by JustAnoobROTMG View Post
    You can easily do /tq now
    Forgot about that feature. Would just have to figure out what denotes an object as being the active quest event and compare locations. Doesn't really interest me much though.

  6. #5
    DANWARPER's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    0
    My Mood
    Blah
    Oh my god that would be awesome
    i think tq sounds really cool

  7. #6
    DeVoidCoder's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    105
    Reputation
    10
    Thanks
    702
    Sounds useful; thanks

  8. #7
    krazyshank's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Location
    RealmStock
    Posts
    2,589
    Reputation
    467
    Thanks
    16,666
    My Mood
    Angelic
    Quote Originally Posted by JustAnoobROTMG View Post
    You can easily do /tq now
    Amazing idea, i'm gunna make that naoo.

    Accepting PayPal - Bitcoin - Giftcards - Items:

    Find it here: MPGH Sales Thread

  9. #8
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Quote Originally Posted by Nisuxen View Post
    // Removed objects
    for (var i = 0; i < packet.drops.length; i++) {
    var droppedObjectId = packet.drops[i];

    if(players[droppedObjectId] != null){
    delete players[droppedObjectId];
    }
    }
    break;
    }
    }
    }[/CODE][/SPOILER]

    What is this for?
    Alde is Alde is

  10. #9
    Nisuxen's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    164
    Reputation
    10
    Thanks
    95
    Quote Originally Posted by ZBORNOX View Post
    What is this for?
    Every update packet tells the client what objects are in the area. The first update as you enter the nexus or anywhere is going to have a large amount of objects introduced to the client. Every subsequent update is going to give the objects that appeared and those that disappeared since the previous update packet. The /tp script takes all the people in a realm and puts it into a dictionary. If the player leaves the realm, it will be listed in droppedObjects. That section of the code removes all players that have left the area from the dictionary.

  11. The Following User Says Thank You to Nisuxen For This Useful Post:

    Alde. (12-13-2013)

  12. #10
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Quote Originally Posted by Nisuxen View Post
    Every update packet tells the client what objects are in the area. The first update as you enter the nexus or anywhere is going to have a large amount of objects introduced to the client. Every subsequent update is going to give the objects that appeared and those that disappeared since the previous update packet. The /tp script takes all the people in a realm and puts it into a dictionary. If the player leaves the realm, it will be listed in droppedObjects. That section of the code removes all players that have left the area from the dictionary.
    Couldnt be better explained! <3
    Alde is Alde is

  13. #11
    Lux Lux's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    18
    Does this script still work?

Similar Threads

  1. PLEASE NEED HELP WITH REALM RElAY
    By DANWARPER in forum Realm of the Mad God Help & Requests
    Replies: 18
    Last Post: 01-04-2014, 05:38 AM
  2. Realm Relay /con
    By Nisuxen in forum Realm of the Mad God Tutorials & Source Code
    Replies: 5
    Last Post: 12-15-2013, 12:10 PM
  3. Realm Relay /wc
    By Nisuxen in forum Realm of the Mad God Tutorials & Source Code
    Replies: 5
    Last Post: 10-27-2013, 11:32 PM
  4. [Release] Realm Relay Command Script!
    By angelofsilence123 in forum Realm of the Mad God Hacks & Cheats
    Replies: 7
    Last Post: 10-21-2013, 02:06 AM
  5. [Outdated] Realm Relay v1.0.0 - Proxy for RotMG 17.2
    By DeVoidCoder in forum Realm of the Mad God Hacks & Cheats
    Replies: 126
    Last Post: 10-17-2013, 10:23 PM