CoolAny K Relay Plugin Requests?

Posts 115 of 23 · Page 1 of 2
Any K Relay Plugin Requests?
If anyone has a (simple) request for a K Relay plugin, I'd be more than happy to try and make it for you.
I have been fiddling with the API but I'm out of ideas.
I always like to practice my C# skills, plus I have some free time in the next week.
If you could do this, a script to remove cloak timer
Since there's a worldedit and gravity gun hack i have an idea, Make a plugin that lets you change cloth/dyes and skins
My request is simple.
I tried to make a script that selects slots 1,2 and 3 of your inventory when undergoing a trade.
Perhaps you could make one that works unlike mine?
Here's what I made:

Code:
            Console.WriteLine("trying to select slots");
            ChangeTradePacket pkt = (ChangeTradePacket)Packet.Create(PacketType.CHANGETRADE);
            pkt.Offers = new bool[8];
            pkt.Offers[0] = true;
            pkt.Offers[1] = true;
            pkt.Offers[2] = true;
            pkt.Offers[3] = false;
            pkt.Offers[4] = false;
            pkt.Offers[5] = false;
            pkt.Offers[6] = false;
            pkt.Offers[7] = false;
            Console.WriteLine("Sending select packet");
            client.SendToServer(pkt);
            Console.WriteLine("done");
Quote Originally Posted by pixelzerg View Post
My request is simple.
I tried to make a script that selects slots 1,2 and 3 of your inventory when undergoing a trade.
Perhaps you could make one that works unlike mine?
Here's what I made:

Code:
            Console.WriteLine("trying to select slots");
            ChangeTradePacket pkt = (ChangeTradePacket)Packet.Create(PacketType.CHANGETRADE);
            pkt.Offers = new bool[8];
            pkt.Offers[0] = true;
            pkt.Offers[1] = true;
            pkt.Offers[2] = true;
            pkt.Offers[3] = false;
            pkt.Offers[4] = false;
            pkt.Offers[5] = false;
            pkt.Offers[6] = false;
            pkt.Offers[7] = false;
            Console.WriteLine("Sending select packet");
            client.SendToServer(pkt);
            Console.WriteLine("done");
The first 4 slots are the equip slots, but they can't be selected. So slot 1-3 are actually 5-7
Code:
pkt.Offers = new bool[12];
pkt.Offers[0] = false;
pkt.Offers[1] = false;
pkt.Offers[2] = false;
pkt.Offers[3] = false;
pkt.Offers[4] = true;
pkt.Offers[5] = true;
pkt.Offers[6] = true;
pkt.Offers[7] = false;
pkt.Offers[8] = false;
pkt.Offers[9] = false;
pkt.Offers[10] = false;
pkt.Offers[11] = false;
Quote Originally Posted by furbo View Post
Could you make a automatic teleport bot which teleports to a locked player whenever possible?
There is one already made, with Realm Relay.
Here's the link rotmgtool.com/realm-relay-rotmg-proxy-scripts/follow-t4579.html
Quote Originally Posted by pixelzerg View Post
There is one already made, with Realm Relay.
Here's the link rotmgtool.com/realm-relay-rotmg-proxy-scripts/follow-t4579.html
Code:
var ID_NOTIFICATION = $.findPacketId("NOTIFICATION");
var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_PLAYER_TEXT = $.findPacketId("PLAYERTEXT");
var ID_UPDATE = $.findPacketId("UPDATE");
var ID_TELEPORT = $.findPacketId("TELEPORT");
var ID_NEW_TICK = $.findPacketId("NEW_TICK");
var ID_MOVE = $.findPacketId("MOVE");

var player_id = -1;
var follow_id = -1;
var follow_pos = -1;
var following = false;
var playerLocs = {};
var players = {};
var playerLoc = null;
var myLoc = null;
var who = null;

function onClientPacket(event) {
   var packet = event.getPacket();
   switch (packet.id()) {
      case ID_PLAYER_TEXT: {
         var text = packet.text.toLowerCase();
         if(text.contains("/follow ")){
            event.cancel();
            who = text.substring('/follow '.length)
            $.echo("follow " + who);
            if(who == "off"){
                following = false;
               this.displayNotification(event, player_id, 0xFF0000, "follow " + who);
            }
            else{
                following = true;
               this.displayNotification(event, player_id, 0x00FF00, "follow " + who);
               findplayers(event,who);
            }
         }
         break;
      }
      case ID_MOVE: {
         break;
      }
   }
}
function findplayers(event,who){
   if(following){
      for(var player in players){
         var name = players[player].toLowerCase();
         if (who == name){
            follow_id = player;
            autotp(event,follow_id);
            break;
         }
      }
   }
}
function autotp(event,playerObjectId){
   if(following){
      var tp_packet = event.createPacket(ID_TELEPORT);
      tp_packet.objectId = playerObjectId;
      event.sendToServer(tp_packet);
      event.scheduleEvent(10, "findplayers",who);
   }
}
function onServerPacket(event) {
   var packet = event.getPacket();
   switch (packet.id()) {
      case ID_CREATE_SUCCESS: {
         player_id = packet.objectId;
         break;
      }
      case ID_UPDATE: {
         // New objects
         for (var i = 0; i < packet.newObjs.length; i++) {
            var objectData = packet.newObjs[i];
            var type = objectData.objectType;
               if(objectData.status.objectId == follow_id){
                  playerLoc = objectData.status.pos;
                  log("playerLoc",follow_id ,playerLoc);
               }
               if(objectData.status.objectId == player_id){
                  myLoc = objectData.status.pos;
                  log("myLoc",player_id ,myLoc);
               }
            if(type == 768 || type == 775 || type == 782 || type == 784 || (type >= 797 && type <= 806)){ // player classes
               playerLocs[objectData.status.objectId] = objectData.status.pos;
               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(playerLocs[droppedObjectId] != null){
               delete playerLocs[droppedObjectId];     
            }
            else if(droppedObjectId == follow_id){
               follow_id = -1;
               playerLoc = null;
            }
            else if(droppedObjectId == player_id){
               player_id = -1;
               myLoc = null;
            }
         }
         break;
      }
   }
}     
function displayNotification(event, playerObjectId, color, text) {
   var notificationPacket = event.createPacket(ID_NOTIFICATION);
   notificationPacket.objectId = playerObjectId;
   notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + text + "\"}}";
   notificationPacket.color = color;
   event.sendToClient(notificationPacket);
}
function log(title,id,data){
   $.echo(title);
   $.echo(id);
   $.echo(data);   
}
/follow playername
/follow off
Lastly, name it follow.js
Quote Originally Posted by UrASmurf View Post
Code:
var ID_NOTIFICATION = $.findPacketId("NOTIFICATION");
var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_PLAYER_TEXT = $.findPacketId("PLAYERTEXT");
var ID_UPDATE = $.findPacketId("UPDATE");
var ID_TELEPORT = $.findPacketId("TELEPORT");
var ID_NEW_TICK = $.findPacketId("NEW_TICK");
var ID_MOVE = $.findPacketId("MOVE");

var player_id = -1;
var follow_id = -1;
var follow_pos = -1;
var following = false;
var playerLocs = {};
var players = {};
var playerLoc = null;
var myLoc = null;
var who = null;

function onClientPacket(event) {
   var packet = event.getPacket();
   switch (packet.id()) {
      case ID_PLAYER_TEXT: {
         var text = packet.text.toLowerCase();
         if(text.contains("/follow ")){
            event.cancel();
            who = text.substring('/follow '.length)
            $.echo("follow " + who);
            if(who == "off"){
                following = false;
               this.displayNotification(event, player_id, 0xFF0000, "follow " + who);
            }
            else{
                following = true;
               this.displayNotification(event, player_id, 0x00FF00, "follow " + who);
               findplayers(event,who);
            }
         }
         break;
      }
      case ID_MOVE: {
         break;
      }
   }
}
function findplayers(event,who){
   if(following){
      for(var player in players){
         var name = players[player].toLowerCase();
         if (who == name){
            follow_id = player;
            autotp(event,follow_id);
            break;
         }
      }
   }
}
function autotp(event,playerObjectId){
   if(following){
      var tp_packet = event.createPacket(ID_TELEPORT);
      tp_packet.objectId = playerObjectId;
      event.sendToServer(tp_packet);
      event.scheduleEvent(10, "findplayers",who);
   }
}
function onServerPacket(event) {
   var packet = event.getPacket();
   switch (packet.id()) {
      case ID_CREATE_SUCCESS: {
         player_id = packet.objectId;
         break;
      }
      case ID_UPDATE: {
         // New objects
         for (var i = 0; i < packet.newObjs.length; i++) {
            var objectData = packet.newObjs[i];
            var type = objectData.objectType;
               if(objectData.status.objectId == follow_id){
                  playerLoc = objectData.status.pos;
                  log("playerLoc",follow_id ,playerLoc);
               }
               if(objectData.status.objectId == player_id){
                  myLoc = objectData.status.pos;
                  log("myLoc",player_id ,myLoc);
               }
            if(type == 768 || type == 775 || type == 782 || type == 784 || (type >= 797 && type <= 806)){ // player classes
               playerLocs[objectData.status.objectId] = objectData.status.pos;
               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(playerLocs[droppedObjectId] != null){
               delete playerLocs[droppedObjectId];     
            }
            else if(droppedObjectId == follow_id){
               follow_id = -1;
               playerLoc = null;
            }
            else if(droppedObjectId == player_id){
               player_id = -1;
               myLoc = null;
            }
         }
         break;
      }
   }
}     
function displayNotification(event, playerObjectId, color, text) {
   var notificationPacket = event.createPacket(ID_NOTIFICATION);
   notificationPacket.objectId = playerObjectId;
   notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + text + "\"}}";
   notificationPacket.color = color;
   event.sendToClient(notificationPacket);
}
function log(title,id,data){
   $.echo(title);
   $.echo(id);
   $.echo(data);   
}
/follow playername
/follow off
Lastly, name it follow.js
this is what exactly i was thinking of, a tool that teleports to a player automatically. first how to operate this script? by AHK or java script or batch file?
second, is it even possible to make the teleportation progress run in background? i have 2 account and i want one account to auto teleport at the other every given time, while monitoring that other account. i don't want auto follow, just auto tp, i wil have to open 2 flash files and so the script or the tool has to be able to choose the task to work on without affecting the frontground running progress. i would appreciate the help here and if u dont feel like doing it just give some hints or useful commands to make the it. and thanks
Quote Originally Posted by Ekramhadidi View Post
first how to operate this script? by AHK or java script or batch file?
You use realm relay - a combination of Java and Batch. Search for "Realm Relay" on these forums - i'm sure you'll find something useful.
I personally use RRGUID - it's good


Quote Originally Posted by Ekramhadidi View Post
second, is it even possible to make the teleportation progress run in background?
Yes, you can indeed do this, theoretically - I haven't tried it out. Realm Relay does have multiple account support. Bear in mind
that you will feel a lot of latency (I did - and I have 120mb/s fibreoptic broadband) - this is because the script is actually sending
the teleport packets and not controlling your keyboard or mouse whatsoever (unlike AHK scripts)
Could you make a automatic teleport bot which teleports to a locked player whenever possible?
Make plugins that show items that u need to get for daily quest. In corner or somewhere
Could you create a script that gives me instant account in use?
Quote Originally Posted by fdsagio69 View Post
Could you create a script that gives me instant account in use?
I know why you want something like this, but when I first read this, I laughed quite a bit just thinking of the horrors of acc in use
Posts 115 of 23 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?