Advertisement
makmukiper

sipcalc.tcl

May 17th, 2023 (edited)
2,208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.76 KB | None | 0 0
  1. set cmds ". ! ` -"
  2. foreach cmd $cmds { bind pub - ${cmd}sipcalc sipcalc }
  3. proc sipcalc {n u h c t} {
  4.  set t [stripcodes bcruag $t]
  5.  set ip [lindex $t 0]
  6.  catch {exec sipcalc $ip} ipres
  7.  putnow "PRIVMSG $c :Result for $t"
  8.  foreach line [split $ipres "\n"] {
  9.   if {[string match -nocase "*ipv*" $line] || [string match "*CIDR*" $line] || [string match "*decimal*" $line] || [string match "*hex*" $line] || [string match "*bits*" $line] || [string match "*masked*" $line] || [string match "*type*" $line] || [string match "*refix*" $line] || [string match "-" $line] || [string match "*wildcard*" $line] || [string match "*roadcast*" $line]} {continue}
  10.   regsub -all " " $line " " line
  11.   regsub -all " - " $line " » " line
  12.   putnow "PRIVMSG $c :$line"
  13.  }
  14.  return 0
  15. }
  16.  
Tags: TCL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement