יוצר: Arthas
גירסא: 1.0
תיאור: בוט קלאבים
הפעלה: לשים ברימוט
קוד: בחר הכל
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;.
;;;. Clubsbot
;;;. by Arthas
;;;.
;;;. Sockets by ventox
;;;.
;;;. Version: 1.0
;;;.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias HL { set %C.HL-IP $1- | bset -t &hl 1 $str($chr(255),4) $+ TSource Engine Query | bset &hl $calc($bvar(&hl,0) + 1) 0 | set %C.HL-ticks $ticks | sockudp -k HL $replace($1,$chr(58),$chr(32)) &hl }
alias HLB { return $bvar(&HL,1,$bvar(&HL,0)).text }
on *:UDPREAD:HL: {
sockread &HL | breplace &HL 0 254 | var %C.HL-Type = $gettok($HLB,1,254) | var %C.HL-Name = $right($gettok($HLB,1,254),$calc($len($gettok($HLB,1,254)) -6)) | var %C.HL-Map = $gettok($HLB,2,254)
if (!$asc($mid($gettok($HLB,6,254),2,1))) { rc %C.Color2 $+ Hostname: $+ %C.Color1 %C.HL-Name %C.Color2 $+ IP: $+ %C.Color1 %C.HL-IP %C.Color2 $+ Players: $+ 14 0 $+ / $+ $asc($mid($gettok($HLB,6,254),1,1)) %C.Color2 $+ Map: $+ %C.Color1 %C.HL-Map %C.Color2 $+ Ping: $+ %C.Color1 $calc($ticks - %C.HL-ticks) $+ ms }
elseif ($asc($mid($gettok($HLB,6,254),2,1))) && ($asc($mid($gettok($HLB,6,254),1,1)) == $asc($mid($gettok($HLB,6,254),2,1))) { rc %C.Color2 $+ Hostname: $+ %C.Color1 %C.HL-Name %C.Color2 $+ IP: $+ %C.Color1 %C.HL-IP %C.Color2 $+ Players: $+ 4 $asc($mid($gettok($HLB,6,254),1,1)) $+ / $+ $asc($mid($gettok($HLB,6,254),2,1)) %C.Color2 $+ Map: $+ %C.Color1 %C.HL-Map %C.Color2 $+ Ping: $+ %C.Color1 $calc($ticks - %C.HL-ticks) $+ ms | inc %C.1 $asc($mid($gettok($HLB,6,254),1,1)) | inc %C.2 $asc($mid($gettok($HLB,6,254),2,1)) }
elseif ($asc($mid($gettok($HLB,6,254),2,1))) && ($asc($mid($gettok($HLB,6,254),1,1)) !== $asc($mid($gettok($HLB,6,254),2,1))) && ($asc($mid($gettok($HLB,6,254),1,1)) !== 0) { rc %C.Color2 $+ Hostname: $+ %C.Color1 %C.HL-Name %C.Color2 $+ IP: $+ %C.Color1 %C.HL-IP %C.Color2 $+ Players: $+ %C.Color1 $asc($mid($gettok($HLB,6,254),1,1)) $+ / $+ $asc($mid($gettok($HLB,6,254),2,1)) %C.Color2 $+ Map: $+ %C.Color1 %C.HL-Map %C.Color2 $+ Ping: $+ %C.Color1 $calc($ticks - %C.HL-ticks) $+ ms | inc %C.1 $asc($mid($gettok($HLB,6,254),1,1)) | inc %C.2 $asc($mid($gettok($HLB,6,254),2,1)) }
unset %C.HL-*
}
alias rc msg %C.Channel %C.Style1 $1- %C.Style2
alias HL2 { var %c = 1, %timer = 1 | mode %C.Channel +m | while (%c <= $lines(clubs.txt)) { .timer 1 %timer hl $read(clubs.txt,%c) | inc %c | inc %timer 2 } | .timer 1 $calc(%timer +3) mode %C.Channel -m }
menu * {
Clubs bot: dialog -m clubs clubs
}
on *:connect: .timer 1 3 join %c.channel
on *:text:!clubs:%C.Channel: if (!%c.flood) { hl2 | inc -u20 %c.flood }
dialog clubs {
title "Clubs bot"
size -1 -1 110 117
option dbu notheme
text "Channel:", 1, 5 11 23 8
text "Add ip:", 2, 5 27 18 8
edit "", 3, 28 9 52 12, autohs
button "SET", 4, 83 9 21 12
edit "", 5, 28 25 52 12, autohs
list 6, 5 37 99 60, size
button "Add", 7, 5 98 32 12
button "Clear", 8, 38 98 32 12
button "Remove", 9, 71 98 32 12
}
on *:dialog:clubs:*:*:{
if ($devent == sclick) {
If ($Did == 4) && (#* iswm $did(3)) { set %C.Channel $did(3) }
If ($Did == 7) && ($did(5)) { write Clubs.txt $did(5) | did -a $dname 6 $did(5) }
If ($Did == 9) && ($did($dname,6).seltext) { write -ds $did($dname,6).seltext Clubs.txt | did -d $dname 6 $did($dname,6).sel }
If ($Did == 8) { remove Clubs.txt | did -r $dname 6 }
}
if ($devent == init) { did -a $dname 3 %c.channel | var %c = 1 | while (%c <= $lines(Clubs.txt)) { did -a $dname 6 $read(Clubs.txt,%c) | inc %c } }
}