Jump to content

Recommended Posts

Posted (edited)

Whois Lookup

I reworked my script and changed it from Chatlog Viewer into Whois Lookup.

Chatlog Viewer couldn't put the whole Chatlog into the Messagebox.

Only works correctly with RAthena r15572 or above. (It uses the new Group System).

Files

Changelogs

  • 1.0.0 Release
  • 1.1.0 Rewritten query_sql (Thanks to Brian)
  • 1.1.1 Added "Status" & "Guild" into Character Information
  • 1.1.1 Changed some Informations (Gender, Email)

How do you use it ?

Write a private message to: "npc:whois" with text: "CHARACTER NAME HERE" and your Whois Lookup shows up.

Features

  • Only GM Level 99 can use it (you can edit it)
  • Shows a bunch of Informations about Account
  • Shows every Character with some Informations

How can you help me ?

  • Give me feedback
  • Report bugs
  • Tell me if you like it

tr0n

Edited by tr0n
  • Upvote 1
Posted (edited)

Very Nice, wish I could test it

Why not put a video up for it?

Thank you!

I've got only a UMTS-Stick (50kb/s). That's too slow. I can't even look a video on youtube, sry.

Maybe someone else can do it with faster internet?

Edited by tr0n
Posted (edited)

Found out that he can't put whole chatlog in Message Box, because of array limit.

Kinda fail by me... sorry folks. what a blame. /?

Maybe I could just make a whoislookup out of it. :)

EDIT: CHANGED SCRIPT INTO WHOIS LOOKUP.

Edited by tr0n
Posted

//--- Whois Lookup 1.0.0 -----------------------------------------//
//----------------------------------------------------------------//
//    ttt              000000000
//    ttt              000   000
// ttttttttt rrrrrrrrr 000   000 nnnnnnnnn
//    ttt    rrr       000   000 nnn   nnn
//    ttt    rrr       000   000 nnn   nnn
//    ttt    rrr       000   000 nnn   nnn
//    ttttt  rrr       000000000 nnn   nnn
//----------------------------------------------------------------//
//--- Changelogs: ------------------------------------------------//
// 1.0.0 Release
//----------------------------------------------------------------//
//--- Main Script ------------------------------------------------//
-	script	whois	-1,{
end;

OnWhisperGlobal:
if(getgmlevel()!=99) end;
query_sql "DELETE FROM `chatlog` WHERE `dst_charname`='npc:whois'";
query_Sql "SELECT `account_id` FROM `char` WHERE `name`='"+@whispervar0$+"'", .@account_id;
if(.@account_id==0){
mes "[^FF7700Whois Lookup^000000]";
mes "Account or Character does not exist.";
close;
}
mes "[^FF7700Account Information^000000]";
mes "-----------------------------------";
query_sql "SELECT `userid` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc1$;
query_sql "SELECT `user_pass` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc2$;
query_sql "SELECT `sex` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc3$;
query_sql "SELECT `email` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc4$;
query_sql "SELECT `group_id` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc5$;
query_sql "SELECT `lastlogin` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc6$;
query_sql "SELECT `last_ip` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc7$;
mes "Username: ["+.@whoisacc1$+"]";
mes "Password: ["+.@whoisacc2$+"]";
mes "Gender: ["+.@whoisacc3$+"]";
mes "Email: ["+.@whoisacc4$+"]";
mes "GM Level: ["+.@whoisacc5$+"]";
mes "Last Login: ["+.@whoisacc6$+"]";
mes "Last IP: ["+.@whoisacc7$+"]";
mes "-----------------------------------";
mes "[^FF7700Character Information^000000]";
mes "-----------------------------------";
query_sql "SELECT `name` FROM `char` WHERE `account_id`="+.@account_id+" ORDER BY `char_id`", .@whoischar1$;
query_sql "SELECT `char_id` FROM `char` WHERE `account_id`="+.@account_id+" ORDER BY `char_id`", .@whoischar2$;
query_sql "SELECT `class` FROM `char` WHERE `account_id`="+.@account_id+" ORDER BY `char_id`", .@whoischar3$;
query_sql "SELECT `base_level` FROM `char` WHERE `account_id`="+.@account_id+" ORDER BY `char_id`", .@whoischar4$;
query_sql "SELECT `job_level` FROM `char` WHERE `account_id`="+.@account_id+" ORDER BY `char_id`", .@whoischar5$;
query_sql "SELECT `zeny` FROM `char` WHERE `account_id`="+.@account_id+" ORDER BY `name`", .@whoischar6$;
for(set .@i,0; .@i < getarraysize(.@whoischar1$); set .@i,.@i+1) {
	mes "Character Name: ["+.@whoischar1$[.@i]+"]";
	mes "Character ID: ["+.@whoischar2$[.@i]+"]";
	mes "Job Class: ["+.@whoischar3$[.@i]+"]";
	mes "Level: [base: "+.@whoischar4$[.@i]+"/Job: "+.@whoischar5$[.@i]+"]";
	mes "Zeny: ["+.@whoischar6$[.@i]+"]";
	mes "-----------------------------------";
	}
close;
end;
}

Did you know that SELECT can select more than one column?!

For example, these 7 queries could be combined into one:

	query_sql "SELECT `userid` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc1$;
query_sql "SELECT `user_pass` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc2$;
query_sql "SELECT `sex` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc3$;
query_sql "SELECT `email` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc4$;
query_sql "SELECT `group_id` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc5$;
query_sql "SELECT `lastlogin` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc6$;
query_sql "SELECT `last_ip` FROM `login` WHERE `account_id`="+.@account_id, .@whoisacc7$;

:)

	query_sql "SELECT `userid`,`user_pass`,`sex`,`email`,`group_id`,`lastlogin`,`last_ip` " + 
          "FROM `login` WHERE `account_id`="+.@account_id, 
          .@whoisacc1$, .@whoisacc2$, .@whoisacc3$, .@whoisacc4$, .@whoisacc5$, .@whoisacc6$, .@whoisacc7$;

Posted (edited)

I'm very newbie in SQL Scripting. Thank you very much. I will change it.

I hope I can learn much more about SQL, I think it's great.

EDIT: UPDATED TO V.1.1.1

Edited by tr0n
  • 2 months later...
Posted (edited)

i have this DB error on my map server..

[sql]: DB error - Table 'ragnarok.chatlog' doesn't exist
[Debug]: at ..srcmapscript.c:13746 - DELETE FROM `chatlog` WHERE `dst_charnam
e`='npc:whois'
[Debug]: Source (NPC): whois (invisible/not on a map)

you got great script there ^^

Edited by v00m3r
  • 2 weeks later...
Posted

query_sql "DELETE FROM `chatlog` WHERE `dst_charname`='npc:whois'";

It should be:

query_logsql "DELETE FROM `chatlog` WHERE `dst_charname`='npc:whois'";

because many users don't have log db and ragnarok db the same, they may use logs in another database.

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...