Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SOCKET CCTV ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- alias cctvon {
- var %h 1, %v
- while ($ini(cctv.ini,%h)) {
- %v = $ini(cctv.ini,%h)
- if ($v1 == config) { inc %h | continue }
- if (!$sock(cctv. $+ $v1)) sockopen $+(cctv.,%v) $readini(cctv.ini,%v,server) $readini(cctv.ini,%v,port)
- inc %h
- }
- }
- on *:sockopen:cctv.*: {
- if ($sockerr) return
- 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))
- sockwrite -n $sockname nick $+(:,$readini(cctv.ini,config,nick))
- }
- on *:sockread:cctv.*: {
- if ($sockerr) return
- var %sr, %h 1 | sockread -f %sr | tokenize 32 %sr
- var %sw sockwrite -n $sockname, %chan $readini(cctv.ini,config,chan)
- if ($1 == PING) %sw PONG $2
- if ($2 == 376) %sw JOIN %chan
- if ($2 == PRIVMSG) && ($3 == %chan) {
- inc -u5 %xfp
- if (%xfp > 20) {
- if (%halt) return
- inc -u5 %halt
- %sw PRIVMSG $3 $+(:,$chr(1),ACTION,detected fast line... halting for 5secs...,$chr(1))
- }
- var %srsn $remove($sockname,cctv.), %nick $right($gettok($1,1,33),-1), %v
- var %name $+($chr(3),$iif($readini(cctv.ini,%srsn,color),$v1,01),$readini(cctv.ini,%srsn,name),$chr(3))
- while ($ini(cctv.ini,%h)) {
- %v = $v1 | %sw = sockwrite -n $+(cctv.,%v) PRIVMSG $3
- if ($v1 == config) || ($+(*.,$v1) iswm $sockname) { inc %h | continue }
- if ($+(:,$chr(1),ACTION) == $4) %sw $+($4,$chr(32),* $+(%name,:,%nick) $5-)
- if ($asc($right($4,-1)) != 1) %sw $+(:,<,%name,:,%nick,>) $right($4-,-1)
- inc %h
- }
- }
- }
- on *:sockclose:cctv.*:sockopen $sockname $sock($sockname).ip $sock($sockname).port
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement