Script returns "#:{ Unknown command" when checked in active window. If you view another window the script works.
You probably got the error ON QUIT because there is no # for QUIT.
on *:JOIN:#:{ COMMANDS }
on *:PART:#:{ COMMANDS }
on *:QUIT:{ COMMANDS }
if you are making a script and are changing the way that mIRC looks and want to set it up so mIRC shows users who quit on multiple channels then you might want to take a look at this thing I made.
on ^*:QUIT:{
set %loop 1
:again
if $chan(%loop) == $null { halt }
if $nick ison $chan(%loop) { echo $chan(%loop) 06*** 01(05QUIT01)05 $nick 05( $+ 01 $+ $gettok($address,-2,64) $+ 00@01 $+ $unmask($gettok($address,2,64)) $+ 05)05 has quit IRC 01(05 $+ $remove( $+ $1-,$chr(40),$chr(41) $+ ) $+ 05)
inc %loop
goto again }
else { inc %loop | goto again }
}
You'd better use $comchan($nick,N) in a while() loop with local vars
on ^*:QUIT:{
var %loop = 0
while (%loop < $comchan($nick,0)) {
inc %loop
echo $comchan($nick,%loop) <your stuff here>
}
haltdef
}
why start ur loop at 0? if u see the users quit u already know there is a common chan between u?
Here's a more cleaned up version:
on ^*:QUIT:{
var %i = 1
while ($comchan($nick,%i)) {
echo $ifmatch <insert data here>
inc %i
}
haltdef
}
Personally, I'm a fan of:
var %i = 0, %n = $comchan($nick,0)
WHILE ( %i < %n ) {
inc %i
echo $comchan($nick,%i)
}
Though I do respect the performance gain of:
var %i = 1
WHILE ($comchan($nick,%i)) {
echo $ifmatch
inc %i
}
The first version of a WHILE loop is much eaiser for the average coder to understand, very basic logic. While $ifmatch may be sexy, it can be confusing for beginners who haven't used ( %i < %n ) yet and gotten comfortable with casual sex.
- Raccoon
aaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhh labels!!!!!! die!!!!!!!!!!!!!!! :P