mIRC Home    About    Download    Register    News    Help

Print Thread
Error in "on ^1:join/quit:#:{ COMMAND }" #23231 08/05/03 08:14 PM
Joined: May 2003
Posts: 1
I
InvisibleClown Offline OP
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.

Re: Error in "on ^1:join/quit:#:{ COMMAND }" #23232 08/05/03 08:18 PM
Joined: Dec 2002
Posts: 2,022
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,022
You probably got the error ON QUIT because there is no # for QUIT.

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

Re: Error in "on ^1:join/quit:#:{ COMMAND }" #23233 10/05/03 01:25 AM
Joined: Feb 2003
Posts: 143
N
naki Offline
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)
Re: Error in "on ^1:join/quit:#:{ COMMAND }" #23234 10/05/03 11:57 AM
Joined: Dec 2002
Posts: 395
M
MonoSex Offline
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
}

Re: Error in "on ^1:join/quit:#:{ COMMAND }" #23235 10/05/03 04:42 PM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
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
Re: Error in "on ^1:join/quit:#:{ COMMAND }" #23236 10/05/03 04:55 PM
Joined: May 2003
Posts: 177
P
Prizm Offline
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
}

Re: Error in "on ^1:join/quit:#:{ COMMAND }" #23237 11/05/03 08:52 AM
Joined: Feb 2003
Posts: 2,722
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,722
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!
Re: Error in "on ^1:join/quit:#:{ COMMAND }" #23238 12/05/03 03:29 PM
Joined: Dec 2002
Posts: 29
N
Nem3sis Offline
Ameglian cow
Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 29
aaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhh labels!!!!!! die!!!!!!!!!!!!!!! :P