Author Topic: RTB ID Lookup  (Read 7315 times)

RTB ID Lookup



It's a server script that pulls ID data from the RTB id lookup system. In order to use it, you can type "id ##" or /lookupID ##.

To get more information, type /idLookup (confusing I know)

Planned features

  • name history
  • a client sided version

Do you have suggestions? Leave them below. This is my first public script and I am glad to receive constructive criticism.

Server_idLookup

What the people think
i like
« Last Edit: December 03, 2013, 08:58:24 PM by ultimamax »

I think it'd be better if it was in a small GUI, reason being if you have someone like the brony trio who have changed their name over 150 times its gonna be hell trying to scroll back up to see what they all are or what the last person said to you. I like the idea a lot. Good luck!

Already exists as a GUI??


Already exists as a GUI??
thats the client sided one this is server sided

fair enough then. client-sided is cancelled!


Why is it nested? Does it still execute?
+ Server_idLookup > Server_idLookup


Seeing from part of the code, this can be spammed.

EDIT:

Forgot -
This is my first public script
You can set timeouts on the command and the chat, using a main function.

Something like this can help:

function serverCmdMessageSent(%client,%message)
{
   if(getWord(%message,0) $= "id" && %client.isSuperAdmin)
   {
      RTB_LookUpID(%client,getWord(%message,1));
      $nameFound = 0;
   }
   return Parent::serverCmdMessageSent(%client,%message);
}

function serverCmdLookupId(%client,%id)
{
   if(!%client.isSuperAdmin)
      return;
   RTB_LookUpID(%client,%id)
}

function RTB_LookUpID(%client,%ID)
{
   if(!isObject(%client)) return; //Does it exist?
   if(%client.getClassName() !$= "GameConnection") return; //Is it a client?
   if(%ID=mFloor(%ID) <= 0) return; //Is it even a full number?
   if(!%client.lastLookUp) //Does the var even exist?
      %client.lastLookUp = getSimTime();
   else if((getSimTime() - %client.lastLookUp) <= 3000) //1000ms = 1s : 3 seconds
      return messageClient(%client,'',"\c6You can't lookup an ID that fast!");
   %client.lastLookUp = getSimTime();
   messageAll('',%client.getPlayerName() @ "\c6 has looked up an ID. (" @ %ID @ ")");
   httpPage.get("http://forum.returntoblockland.com/list.php?cmd=view&id=" @ %ID);
}


I understand it is super admin only, but they could probably spam it too, depending on who it is, and the server command, should be super admin too.
« Last Edit: December 03, 2013, 09:47:04 PM by Advanced Bot »

oh shoot, it's nested? let me fix it and rehost it
edit: fixed
« Last Edit: December 03, 2013, 09:45:52 PM by ultimamax »

Why is it nested? Does it still execute?
+ Server_idLookup > Server_idLookup


Seeing from part of the code, this can be spammed.

EDIT:

Forgot -You can set timeouts on the command and the chat, using a main function.

Something like this can help:

function serverCmdMessageSent(%client,%message)
{
   if(getWord(%message,0) $= "id" && %client.isSuperAdmin)
   {
      RTB_LookUpID(%client,getWord(%message,1));
      $nameFound = 0;
   }
   return Parent::serverCmdMessageSent(%client,%message);
}

function serverCmdLookupId(%client,%id)
{
   RTB_LookUpID(%client,%id)
}

function RTB_LookUpID(%client,%ID)
{
   if(!isObject(%client)) return; //Does it exist?
   if(%client.getClassName() !$= "GameConnection") return; //Is it a client?
   if(%ID=mFloor(%ID) <= 0) return; //Is it even a full number?
   if(!%client.lastLookUp) //Does the var even exist?
      %client.lastLookUp = getSimTime();
   else if((getSimTime() - %client.lastLookUp) <= 3000) //1000ms = 1s : 3 seconds
      return messageClient(%client,'',"\c6You can't lookup an ID that fast!");
   %client.lastLookUp = getSimTime();
   messageAll('',%client.getPlayerName() @ "\c6 has looked up an ID. (" @ %ID @ ")");
   httpPage.get("http://forum.returntoblockland.com/list.php?cmd=view&id=" @ %ID);
}

in reply to your edit, i felt i didn't need to add a timeout for it checks if you are superadmin. hopefully your chat isnt being spammed by your own admins. also, it already checks if it's a full number with isDigit

Your main code does messageAll, it tells EVERYONE on the server.

you need to put in timeouts

i dont give a stuff who can run it, it needs timeouts for everyone except maybe the host himself.

literally just like 5 seconds by default with preferences to make it custom lengths

also i've never heard of "isDigit" before. is it default?

also i've never heard of "isDigit" before. is it default?
no doesn't look like it

you need to put in timeouts

i dont give a stuff who can run it, it needs timeouts for everyone except maybe the host himself.

literally just like 5 seconds by default with preferences to make it custom lengths

also i've never heard of "isDigit" before. is it default?
isDigit is in the code.

I also gave him the timeout idea and the code as I have above. He doesn't want it though.

isn't there a default function for checking for a number