Advertisement
Guest User

Untitled

a guest
May 20th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SOCKET CCTV ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. alias cctvon {
  3. var %h 1, %v
  4. while ($ini(cctv.ini,%h)) {
  5. %v = $ini(cctv.ini,%h)
  6. if ($v1 == config) { inc %h | continue }
  7. if (!$sock(cctv. $+ $v1)) sockopen $+(cctv.,%v) $readini(cctv.ini,%v,server) $readini(cctv.ini,%v,port)
  8. inc %h
  9. }
  10. }
  11.  
  12. on *:sockopen:cctv.*: {
  13. if ($sockerr) return
  14. sockwrite -n $sockname user cctv "" $+(127.0.0.1:,$chr(3),05,$chr(44),07 CCTV ,$chr(3),07,$chr(44),05 Socket version created by unclean,$chr(32),$chr(3))
  15. sockwrite -n $sockname nick $+(:,$readini(cctv.ini,config,nick))
  16. }
  17.  
  18. on *:sockread:cctv.*: {
  19. if ($sockerr) return
  20. var %sr, %h 1 | sockread -f %sr | tokenize 32 %sr
  21. var %sw sockwrite -n $sockname, %chan $readini(cctv.ini,config,chan)
  22. if ($1 == PING) %sw PONG $2
  23. if ($2 == 376) %sw JOIN %chan
  24. if ($2 == PRIVMSG) && ($3 == %chan) {
  25. inc -u5 %xfp
  26. if (%xfp > 20) {
  27. if (%halt) return
  28. inc -u5 %halt
  29. %sw PRIVMSG $3 $+(:,$chr(1),ACTION,detected fast line... halting for 5secs...,$chr(1))
  30. }
  31. var %srsn $remove($sockname,cctv.), %nick $right($gettok($1,1,33),-1), %v
  32. var %name $+($chr(3),$iif($readini(cctv.ini,%srsn,color),$v1,01),$readini(cctv.ini,%srsn,name),$chr(3))
  33. while ($ini(cctv.ini,%h)) {
  34. %v = $v1 | %sw = sockwrite -n $+(cctv.,%v) PRIVMSG $3
  35. if ($v1 == config) || ($+(*.,$v1) iswm $sockname) { inc %h | continue }
  36. if ($+(:,$chr(1),ACTION) == $4) %sw $+($4,$chr(32),* $+(%name,:,%nick) $5-)
  37. if ($asc($right($4,-1)) != 1) %sw $+(:,<,%name,:,%nick,>) $right($4-,-1)
  38. inc %h
  39. }
  40. }
  41. }
  42.  
  43. on *:sockclose:cctv.*:sockopen $sockname $sock($sockname).ip $sock($sockname).port
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement