Guest User

Untitled

a guest
Feb 28th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.31 KB | None | 0 0
  1. bind join - * checkident
  2.  
  3. proc checkident {n h hand c} {
  4.   if {[string match "*.html.chat" $h]} {set host "[lindex [split $h "@"] 0]" ;set ip [getiph $host]} else {set ip "[lindex [split $h @] 1]" }
  5.    dnslookup $ip resolve_rep $c $n
  6. }
  7.  
  8. proc iptohex {t} {
  9. set t1 [lindex [split $t .] 0]
  10. set t2 [lindex [split $t .] 1]
  11. set t3 [lindex [split $t .] 2]
  12. set t4 [lindex [split $t .] 3]
  13. regsub -all " " $t "" t
  14. set txta [format {%02x%02x%02x%02x} $t1 $t2 $t3 $t4]
  15. return "$txta"
  16.  
  17. }
  18.  
  19. proc getiph {t} {
  20. set txta [format {%d.%d.%d.%d} 0x[string range $t 0 1] 0x[string range $t 2 3] 0x[string range $t 4 5] 0x[string range $t 6 7]]
  21. return "$txta"
  22. }
  23.  
  24. proc resolve_rep {ip host status c n} {
  25. set hex [iptohex $ip]
  26. if {$host != $ip && $host != ""} {
  27.   putquick "PRIVMSG $c :$n ident = $hex -> $ip -> $host"
  28.   } else {
  29.   putquick "PRIVMSG $c :$n ident = $hex -> $ip"
  30.   }
  31. }
  32.  
  33. bind pub n !hex pgethex
  34. proc pgethex {n u h c t} {
  35. if {$t == ""} {putquick "notice $n :Ето пример: !hex 84.40.99.41 -> 54286329" }
  36. putquick "privmsg $c :IP $t = HEX :[iptohex $t]"
  37. }
  38.  
  39. bind pub n !ip pgetip
  40. proc pgetip {n u h c t} {
  41. if {$t == ""} {putquick "notice $n :Ето пример: !ip 54286329 -> 84.40.99.41" }
  42. putquick "privmsg $c :HEX $t = IP :[getiph $t]"
  43. }
  44.  
  45.  
  46. putlog "\[x\] WebChat IP/DNS by raspi loaded"
Add Comment
Please, Sign In to add comment