Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Ip Check for Eggdrop

Recommended Posts

  • Administrators

This script grabs some ip information from www.melissadata.com and returns it to irc.

Default trigger is: !ipinfo

Syntax: !ipinfo 1.2.3.4

Chanset: +ipinfo

ScreenShot:

1rwyrt.jpg

[color=#5A346F]##############################################################################################[/color][color=#5A346F]##   To use this script you must set channel flag +ipinfo (ie .chanset #chan +ipinfo)	 ##[/color][color=#5A346F]##############################################################################################[/color][color=#5A346F]##############################################################################################[/color][color=#5A346F]##  ##							 Start Setup.										 ##  ##[/color][color=#5A346F]##############################################################################################[/color][color=#5A346F]## Change the character between the "" below to change the command character/trigger.	   ##[/color]set Ipinfocmdchar [color=#7E7A80]"!"[/color]proc Ipinfo [color=#853E66]{[/color]nick host hand chan search[color=#853E66]}[/color] [color=#853E66]{[/color]  if [color=#853E66]{[/color][color=#853E66][[/color]lsearch -exact [color=#853E66][[/color]channel info [color=#7E7A80]$chan[/color][color=#853E66]][/color] +ipinfo[color=#853E66]][/color] [color=#853E66]![/color]= -[color=#A6A64D]1[/color][color=#853E66]}[/color] [color=#853E66]{[/color][color=#5A346F]## Change the format codes between the "" below to change the color/state of the text.	  ##[/color]	set titlef [color=#7E7A80]"[color=#7D8B54]0[/color]034"[/color]	set textf [color=#7E7A80]"[color=#7D8B54]0[/color]03[color=#7D8B54]0[/color]02"[/color][color=#5A346F]##############################################################################################[/color][color=#5A346F]##  ##						   End Setup.											  ## ##[/color][color=#5A346F]##############################################################################################[/color]	set Ipinfosite [color=#7E7A80]"www.melissadata.com"[/color]	if [color=#853E66]{[/color][color=#7E7A80]$search[/color] == [color=#7E7A80]""[/color][color=#853E66]}[/color] [color=#853E66]{[/color]	 putserv [color=#7E7A80]"PRIVMSG $chan :${textf}You must provide an ip address to check!"[/color]	[color=#853E66]}[/color] else [color=#853E66]{[/color]		 set Ipinfourl [color=#7E7A80]"/lookups/iplocation.asp?ipaddress=${search}"[/color]		 if [color=#853E66]{[/color][color=#853E66][[/color]catch [color=#853E66]{[/color]set Ipinfosock [color=#853E66][[/color]socket -async [color=#7E7A80]$Ipinfosite[/color] [color=#A6A64D]80[/color][color=#853E66]][/color][color=#853E66]}[/color] sockerr[color=#853E66]][/color][color=#853E66]}[/color] [color=#853E66]{[/color]		   putlog [color=#7E7A80]"$Ipinfosite $Ipinfourl $sockerr error"[/color]		   return [color=#A6A64D]0[/color]		 [color=#853E66]}[/color] else [color=#853E66]{[/color]			 puts [color=#7E7A80]$Ipinfosock[/color] [color=#7E7A80]"GET $Ipinfourl HTTP/1.0"[/color]			 puts [color=#7E7A80]$Ipinfosock[/color] [color=#7E7A80]"Host: $Ipinfosite"[/color]			 puts [color=#7E7A80]$Ipinfosock[/color] [color=#7E7A80]"User-Agent: Opera 9.6"[/color]			 puts [color=#7E7A80]$Ipinfosock[/color] [color=#7E7A80]""[/color]			 flush [color=#7E7A80]$Ipinfosock[/color]			 while [color=#853E66]{[/color][color=#853E66]![/color][color=#853E66][[/color]eof [color=#7E7A80]$Ipinfosock[/color][color=#853E66]][/color][color=#853E66]}[/color] [color=#853E66]{[/color]			   set Ipinfovar [color=#7E7A80]" [gets $Ipinfosock] "[/color]	  if [color=#853E66]{[/color][color=#853E66][[/color]regexp [color=#853E66]{[/color][color=#853E66]<[/color]div align=[color=#7E7A80]'center'[/color] class=[color=#7E7A80]'Lookupserror'[/color][color=#853E66]>[/color][color=#853E66]([/color][color=#853E66][[/color]^[color=#853E66]<[/color][color=#853E66]][/color][color=#853E66]*[/color][color=#853E66])[/color][color=#853E66]<[/color]b[color=#853E66]>[/color][color=#853E66]([/color][color=#853E66][[/color]^[color=#853E66]<[/color][color=#853E66]][/color][color=#853E66]*[/color][color=#853E66])[/color][color=#853E66]<[/color]/b[color=#853E66]>[/color][color=#853E66]([/color][color=#853E66][[/color]^[color=#853E66]<[/color][color=#853E66]][/color][color=#853E66]*[/color][color=#853E66])[/color][color=#853E66]<[/color]br[color=#853E66]>[/color][color=#853E66]([/color][color=#853E66][[/color]^[color=#853E66]<[/color][color=#853E66]][/color][color=#853E66]*[/color][color=#853E66])[/color][color=#853E66]<[/color]/div[color=#853E66]>[/color][color=#853E66]}[/color] [color=#7E7A80]$Ipinfovar[/color][color=#853E66]][/color][color=#853E66]}[/color] [color=#853E66]{[/color]		putserv [color=#7E7A80]"PRIVMSG $chan : ${titlef}Syntax error: ${textf}Ip must be in the form of 1.2.3.4"[/color]		close [color=#7E7A80]$Ipinfosock[/color]				  return [color=#A6A64D]0[/color] 	   [color=#853E66]}[/color] elseif [color=#853E66]{[/color][color=#853E66][[/color]regexp [color=#853E66]{[/color][color=#853E66]<[/color]td class=[color=#7E7A80]'columresult'[/color][color=#853E66]>[/color][color=#853E66]([/color][color=#853E66][[/color]^[color=#853E66]<[/color][color=#853E66]][/color][color=#853E66]*[/color][color=#853E66])[/color][color=#853E66]<[/color]/td[color=#853E66]><[/color]td align=[color=#7E7A80]'left'[/color][color=#853E66]><[/color]b[color=#853E66]>[/color][color=#853E66]([/color][color=#853E66][[/color]^[color=#853E66]<[/color][color=#853E66]][/color][color=#853E66]*[/color][color=#853E66])[/color][color=#853E66]<[/color]/b[color=#853E66]><[/color]/td[color=#853E66]><[/color]/tr[color=#853E66]>[/color][color=#853E66]}[/color] [color=#7E7A80]$Ipinfovar[/color][color=#853E66]][/color][color=#853E66]}[/color] [color=#853E66]{[/color]		   set IPResult [color=#853E66][[/color]regexp -all -inline [color=#853E66]{[/color][color=#853E66]<[/color]td class=[color=#7E7A80]'columresult'[/color][color=#853E66]>[/color][color=#853E66]([/color][color=#853E66][[/color]^[color=#853E66]<[/color][color=#853E66]][/color][color=#853E66]*[/color][color=#853E66])[/color][color=#853E66]<[/color]/td[color=#853E66]><[/color]td align=[color=#7E7A80]'left'[/color][color=#853E66]><[/color]b[color=#853E66]>[/color][color=#853E66]([/color][color=#853E66][[/color]^[color=#853E66]<[/color][color=#853E66]][/color][color=#853E66]*[/color][color=#853E66])[/color][color=#853E66]<[/color]/b[color=#853E66]><[/color]/td[color=#853E66]><[/color]/tr[color=#853E66]>[/color][color=#853E66]}[/color] [color=#7E7A80]$Ipinfovar[/color][color=#853E66]][/color]		   set IPResults [color=#7E7A80]"${titlef}[lindex $IPResult {1}]: ${textf}[lindex $IPResult {2}] [lindex $IPResult {3}]"[/color]		   putserv [color=#7E7A80]"PRIVMSG $chan : [ipinforecode $IPResults]"[/color]	   [color=#853E66]}[/color]		  [color=#853E66]}[/color]		  close [color=#7E7A80]$Ipinfosock[/color]		  return [color=#A6A64D]0[/color]	   [color=#853E66]}[/color]	[color=#853E66]}[/color]  [color=#853E66]}[/color][color=#853E66]}[/color]proc ipinforecode [color=#853E66]{[/color] textin [color=#853E66]}[/color] [color=#853E66]{[/color]  return [color=#853E66][[/color]string map [color=#853E66]{[/color][color=#853E66]&[/color]quot[color=#853E66];[/color] [color=#7E7A80]" · "[/color][color=#7E7A80]" & &   "[/color][color=#7E7A80]"} [subst [regsub -nocase -all {([0-9]{1,5});} $textin {[color=#7D8B54]u[/color][color=#7D8B54]1[/color]}]]]}bind pub - ${Ipinfocmdchar}ipinfo Ipinfosetudef flag ipinfoputlog "[/color]Ipinfo Script by Ford_Lawnmower successfully loaded[color=#853E66]![/color] irc.geekshed.net [color=#5A346F]#Script-Help"[/color]
 
Link to comment
Share on other sites



×
×
  • Create New...