- //===== eAthena Script =======================================
- //= IP Lookup NPC
- //===== By: ==================================================
- //= Brian
- //===== Current Version: =====================================
- //= 1.0
- //===== Compatible With: =====================================
- //= eAthena SVN
- //===== Description: =========================================
- //= Look up a char's IP
- //===== Additional Comments: =================================
- //=
- //============================================================
- quiz_00,0,0,0 script ip -1,{
- OnWhisperGlobal:
- if (getgmlevel() < 50) end;
- query_sql "SELECT `account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(@whispervar0$)+"'", .@account_id,.@name$;
- if (.@account_id) {
- query_sql "SELECT `last_ip` FROM `login` WHERE `account_id`="+.@account_id, .@last_ip$;
- if (getstrlen(.@last_ip$) >= 7) {
- dispbottom .@name$+" "+.@last_ip$;
- cleararray .@name$[0], "", getarraysize(.@name$);
- query_sql "SELECT `char`.`name` FROM `char` LEFT JOIN `login` ON `char`.`account_id`=`login`.`account_id` WHERE `login`.`last_ip`='"+.@last_ip$+"' AND `char`.`online`", .@name$;
- if (getarraysize(.@name$)) {
- set .@mes$, .@last_ip$ + " = ";
- for( set .@i,0; .@i<getarraysize(.@name$); set .@i, .@i +1 )
- set .@mes$, .@mes$ + .@name$[.@i] + ", ";
- } else {
- set .@mes$, "No online chars from that IP.";
- }
- dispbottom .@mes$;
- } else
- dispbottom "Last IP not found.";
- } else {
- dispbottom "Char name does not exist.";
- }
- end;
- }
- quiz_00,0,0,0 script char -1,{
- OnWhisperGlobal:
- if (getgmlevel() < 50) end;
- set .@last_ip$, escape_sql(@whispervar0$);
- query_sql "SELECT INET_ATON('"+.@last_ip$+"')", .@ip_dec;
- if (.@ip_dec) {
- query_sql "SELECT `char`.`name` FROM `char` LEFT JOIN `login` ON `char`.`account_id`=`login`.`account_id` WHERE `login`.`last_ip`='"+.@last_ip$+"' AND `char`.`online`", .@name$;
- if (getarraysize(.@name$)) {
- set .@mes$, .@last_ip$ + " = ";
- for( set .@i,0; .@i<getarraysize(.@name$); set .@i, .@i +1 )
- set .@mes$, .@mes$ + .@name$[.@i] + ", ";
- } else {
- set .@mes$, "No online chars from that IP.";
- }
- } else {
- set .@mes$, "Invalid IP address.";
- }
- dispbottom .@mes$;
- end;
- }
ip_lookup.txt
Posted by Anonymous on Wed 2nd Mar 2011 18:03
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.