Guest User

Untitled

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