egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Editing connect script to !whois

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Mon Aug 31, 2020 5:21 pm    Post subject: Editing connect script to !whois Reply with quote

So found this piece of code on this forum.
http://forum.egghelp.org/viewtopic.php?t=20844 << this page
Code:

package require http
package require json

set ExpChan "#opers"

bind raw - NOTICE Client_Connect

proc Client_Connect {from key arg} {
   if {[string match *!*@* $from] || ![string match -nocase "*client connecting*" $arg]} { return }
   if {[scan $arg %\[^\:\]\:%\[^(\](%\[^@\]@%\[^\)\] _ nick ident host] == "4"} {
      set token [http::geturl http://ip-api.com/json/$host?fields=status,city,isp,country,query,regionName,countryCode]
      set data [json::json2dict [http::data $token]]
      ::http::cleanup $token
      if {[dict get $data status] eq "success"} {
         puthelp "PRIVMSG $::ExpChan :\002Nick\002: $nick - \002IP\002: [dict get $data query] - \002Country\002: [dict get $data country] -\
            \002City\002: [dict get $data city] - \002ISP\002: [dict get $data isp] [dict get $data countryCode]"
      } else {
         putcmdlog "Error! it fails to get data for this $host"
      }
   }
   return 0
}


Possible to make this code show normal whois info on !whois And show the location of,
The ip.

Would be super appreciated if someone could edit this to do so, Thanks in advanced Very Happy
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber