mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2003
Posts: 1
I
Mostly harmless
OP Offline
Mostly harmless
I
Joined: May 2003
Posts: 1
Script returns "#:{ Unknown command" when checked in active window. If you view another window the script works.

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
You probably got the error ON QUIT because there is no # for QUIT.

on *:JOIN:#:{ COMMANDS }
on *:PART:#:{ COMMANDS }
on *:QUIT:{ COMMANDS }

Joined: Feb 2003
Posts: 143
N
Vogon poet
Offline
Vogon poet
N
Joined: Feb 2003
Posts: 143
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.

Code:
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 } 
}


We don't just write the scripts, we put them to the test! (ScriptBusters)
Joined: Dec 2002
Posts: 395
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
You'd better use $comchan($nick,N) in a while() loop with local vars wink

Code:
on ^*:QUIT:{
  var %loop = 0
  while (%loop < $comchan($nick,0)) {
    inc %loop
    echo $comchan($nick,%loop)  <your stuff here>
  }
  haltdef
}

Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
why start ur loop at 0? if u see the users quit u already know there is a common chan between u?


D3m0nnet.com
Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
Here's a more cleaned up version:

on ^*:QUIT:{
var %i = 1
while ($comchan($nick,%i)) {
echo $ifmatch <insert data here>
inc %i
}
haltdef
}

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 29
N
Ameglian cow
Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 29
aaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhh labels!!!!!! die!!!!!!!!!!!!!!! :P


Link Copied to Clipboard