Results 1 to 7 of 7
  1. #1
    coolpop33's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Posts
    46
    Reputation
    10
    Thanks
    1
    My Mood
    Amused

    /tq command script

    So I know what your gonna say "This is with most sources" and you would be right.
    But this is for people who is making a new server so please don't flame me.

    Code:
    // tq.js
    
    var ID_CREATE_SUCCESS = 47;
    var ID_PLAYER_TEXT = 80;
    var ID_UPDATE = 66;
    var ID_TELEPORT = 67;
    var ID_NEW_TICK = 50;
    var ID_QUEST_OBJECTID = 48;
    
    var questObjectId = -1;
    var questLoc = null;
    var playerLocs = {};
    var myId = -1;
    
    function onClientPacket(event) {
       var packet = event.getPacket();
       switch (packet.id()) {
          case ID_PLAYER_TEXT: {
             var text = packet.text.toLowerCase();
             if(text == "/tq"){
                event.cancel();
    
                if(questObjectId == -1 || questLoc == null){
                   break;
                }
                var minDist = questLoc.distanceSquaredTo(playerLocs[myId]);
                var toTp = myId;
                for(var player in playerLocs){
                   var distToQuest = questLoc.distanceSquaredTo(playerLocs[player]);
                   
                   if(distToQuest < minDist){
                      minDist = distToQuest;
                      toTp = player;
                   }
                }
                if (toTp != myId){
                   //send tp packet
                   var tp_packet = event.createPacket(ID_TELEPORT);
                   tp_packet.objectId = toTp;
                   event.sendToServer(tp_packet);
                   break;
                }
             }
             break;
          }
       }
    }
    
    function onServerPacket(event) {
       var packet = event.getPacket();
       switch (packet.id()) {
          case ID_CREATE_SUCCESS: {
             myId = 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(type == 768 || type == 775 || type == 782 || type == 784 || (type >= 797 && type <= 806)){ // player classes
                   playerLocs[objectData.status.objectId] = objectData.status.pos;
                }else{
                   if(objectData.status.objectId == questObjectId){
                      questLoc = objectData.status.pos;
                   }
                }
             }
    
             // 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 == questObjectId){
                   questObjectId = -1;
                   questLoc = null;
                }
             }
             break;
          }
          case ID_NEW_TICK: {
             for (var i = 0; i < packet.statuses.length; i++) {
                var status = packet.statuses[i];
    
                for (player in playerLocs){
                   if(status.objectId == player){
                      playerLocs[player] = status.pos;
                      break;
                   }
                }
             }
             break;
          }
          case ID_QUEST_OBJECTID: {
             questObjectId = packet.objectId;
             break;
          }
       }
    }

    What this is for: This is the teleport to quest command. Very useful.

    Its most used on GM's, Mods and admins and up.


    Note: I did not make this script all credit goes to original maker!
    Last edited by coolpop33; 06-28-2014 at 01:37 PM. Reason: Did not add crdits
    Sup?

    Prod IGN: coryblack
    Pservers played: 10+
    Friends: -5...





    REMEMBER THAT TOMORROW IS ANOTHER DAY (btw my fav song <3 modstep <3)

    < how people think i am < how i am....on the internet

  2. #2
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666
    This same script was released already

  3. #3
    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
    Wtf is happenning...
    Alde is Alde is

  4. #4
    BARm's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    Tel Aviv
    Posts
    406
    Reputation
    32
    Thanks
    1,007
    My Mood
    Inspired
    Wrong section..
    And it's already released.

  5. #5
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Quote Originally Posted by coolpop33 View Post
    So I know what your gonna say "This is with most sources" and you would be right.
    But this is for people who is making a new server so please don't flame me.

    What this is for: This is the teleport to quest command. Very useful.

    Its most used on GM's, Mods and admins and up.

    ... umm server and GM's, Mod and admins up... definitely wrong section @Raple @Lovroman
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

  6. #6
    coolpop33's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Posts
    46
    Reputation
    10
    Thanks
    1
    My Mood
    Amused
    Yeah I know raple moved it '////' I'm still a noob cut me some slack.
    Sup?

    Prod IGN: coryblack
    Pservers played: 10+
    Friends: -5...





    REMEMBER THAT TOMORROW IS ANOTHER DAY (btw my fav song <3 modstep <3)

    < how people think i am < how i am....on the internet

  7. #7
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Quote Originally Posted by coolpop33 View Post
    Yeah I know raple moved it '////' I'm still a noob cut me some slack.
    Raple moved after I mentioned him into the thread
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

Similar Threads

  1. [Help Request] Realm Relay Command Script
    By apemanzilla in forum Realm of the Mad God Help & Requests
    Replies: 2
    Last Post: 10-31-2013, 01:42 PM
  2. [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
  3. Hey can some 1 tell/give me the kill commanded script
    By debo2132 in forum DayZ Mod & Standalone Hacks & Cheats
    Replies: 4
    Last Post: 01-05-2013, 01:13 PM
  4. AutoIt script that sends commands to AVA window only...
    By Sando1337 in forum Alliance of Valiant Arms (AVA) Help
    Replies: 4
    Last Post: 08-09-2012, 01:28 PM
  5. Commands Script's
    By tuve2 in forum RuneScape Discussions
    Replies: 3
    Last Post: 07-11-2010, 10:00 AM

Tags for this Thread