#ServerChecker off
[color:red]; Your syntax for $nick() was incorrect, and your while loop had no
; comparison (%a was always going to exist)[/color]
on *:text:!collect:#: {
var %x = 1, %y = $nick($chan,0,v)
while (%x <= %y) {
write -s $+ $nick($chan,%x,v) tocheck.txt $nick($chan,%x,v)
inc %x
}
}
[color:red]; no need for the else, just use a return in the initial if, again your while
; syntax is broken. used var instead of set, no need for a global variable.
; No need to send line number to check.voice, just send the nickname as
; read from the file.[/color]
on *:text:!begin &:*:{
if ($2 !isnum) { .msg $nick Format: !begin <number> | return }
var %a = $iif($2 > $lines(tocheck.txt),$lines(tocheck.txt), $2)
while (%a > 0) {
check.voice $read(tocheck.txt)
dec %a
}
}
[color:red]; this is about where your code go off on its own, not sure why your
; enabling the second group here at all, since its never disabled... rather
; than use a group that will not be enabled/disabled at the correct times
; store the nicks in a global variable for later checking[/color]
alias check.voice {
if (!$findtok(%check_voice_nicks,$1,1,32)) { set %check_voice_nicks %check_voice_nicks $1 }
ctcp $1 !list
}
#ServerChecker end
[color:red]; i've no idear the point of this, looks like you were trying to get the
; trigger from the ad, but iirc server ads are sent via notice not private
; message when requested with !list ?[/color]
on *:text:*:?:{
var %text = $pos($1-,/,1)
while %text <= $len($1-) && %text isnum {
if $mid($1-,%text,1) !isalnum {
set %text $mid($1-,$pos($1-,/,1),%text)
}
if %text isnum {
inc %text
}
}
/ctcp $(%text,2)
}
[color:red]; this makes no sense at all to me, again your while loop is completely
; broken, if %text gets set to a non alnum in the first if, %text will never
; increase and you will enter an endless loop.[/color]
on *:notice:*:?:{
var %text = 1
while %text <= $len($1-) && %text isnum {
if $mid($1-,%text,1) !isalnum {
set %text $mid($1-,1,%text)
}
if %text isnum {
inc %text
}
}
}
[color:red]; i think i would simply abandon these last two events[/color]