Jump to content
chain

TCL Traceroute

Recommended Posts

  • Administrators
# TCL SCRIPT FOR !nslookup !traceroute

putlog "Channel script version 0.5.3 by |SmUrF| loaded"

proc commandchar {} {
	return "!"
}

bind pub - [commandchar]nslookup nslookup
bind pub - [commandchar]traceroute traceroute

proc nslookup {nick host hand chan text} {
		if {[onchan $text $chan] == 1} {
			set host [lindex [split [getchanhost $text $chan] @] 1]
		} else {
			set host $text
		}
		set input [open "|nslookup $host" r]
		set trash [gets $input]
		set trash [gets $input]
		while {![eof $input]} {
			catch {set contents [gets $input]}
			putserv "PRIVMSG $nick :$contents"
		}
		catch {close $input}
}

proc traceroute {nick host hand chan text} {
		if {[onchan $text $chan] == 1} {
			set host [lindex [split [getchanhost $text $chan] @] 1]
		} else {
			set host $text
		}
		set input [open "|traceroute $host" r]
		while {![eof $input]} {
		        catch {set contents [gets $input]}
		        putserv "PRIVMSG $nick :$contents"
	        }
		catch {close $input}
}

 

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.

Loading...


×
×
  • Create New...