mIRC Home    About    Download    Register    News    Help

Print Thread
I
InvisibleClown
InvisibleClown
I
Script returns "#:{ Unknown command" when checked in active window. If you view another window the script works.

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

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

N
naki
naki
N
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 } 
}

M
MonoSex
MonoSex
M
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
}

_
_D3m0n_
_D3m0n_
_
why start ur loop at 0? if u see the users quit u already know there is a common chan between u?

P
Prizm
Prizm
P
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,737
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Feb 2003
Posts: 2,737
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

N
Nem3sis
Nem3sis
N
aaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhh labels!!!!!! die!!!!!!!!!!!!!!! :P


Link Copied to Clipboard