Jump to content

Utility: @ whois Command


Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

File Name: WhoisCommand.txt
File Submitter: keitenai
File Submitted: 31 July 2017
File Category: Utility Script
Content Author: keitenai

Information:

      Admins or GMs mostly find it hard to track a player when certain player has many accounts created with many characters on each accounts.

      I too had this problem so I made this script to simplify tracing a player with a simple @ whois command.

How does it work?

      By typing the complete player's name after the command ( @ whois name of player ) will trigger sql searching for accounts which is linked to the player's IP address.

      Tracking is limited to last IP used by the player so this script is not capable of completely identifying all accounts of the player if a player use a different IP on a different account.

Features:

  1. NO src editing needed!
  2. Able to track account IDs, Character Names, and current online character on an account.

 

Script LINK: https://github.com/keitenai/keitenai/blob/master/WhoisCommand.txt

 

Give me hugs and kisses if you find this useful :D

 

 

  • Upvote 1
  • Love 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

You can actually replace this whole part here...

https://github.com/keitenai/keitenai/blob/master/WhoisCommand.txt#L30-L60

with this

for (.@i = 0; .@i < .@atcmd_numparameters; .@i++) 
	.@name$ = .@name$ + (.@i > 0 ? " ":"") + .@atcmd_parameters$[.@i];

or this

.@name$ = implode(.@atcmd_parameters$, " ");

(may get errors or warnings if the array size is less than 1 or 0)

Edited by Emistry
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

Cool!! i didn't know there is such function! haha

thanks @emistry

 

Git updated

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

when you use query_sql() ... always use escape_sql() for all the string variables that you passed in.

otherwise your scripts are vulnerable to SQL injection.

query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+.@name$+"'",.@acc_ID$)

change to

query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+escape_sql(.@name$)+"'",.@acc_ID$)

etc..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

I was totally unaware of that. Thanks a bunch! now i know why i get script errors when there's a special character on a player's name like ' .

Git Updated!

Link to comment
Share on other sites

  • 2 years later...

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  09/08/13
  • Last Seen:  

@Keitenai awesome. thx for the script !

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

I love this script. Thank you so much!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...