mIRC Homepage
Posted By: piko quit alias - 21/01/03 09:24 PM
Code:
 
alias quit {
  if ($1) {
    scon -at1 .quit ragnarök 1.0 › $1
    set %qreason ragnarök 1.0 › $1
    echo $color(other text) -at ( $+ $kolorj(›) $+ ) Was connected for $uptime(server,1)
    echo $color(other text) -at ( $+ $kolorj(›) $+ ) Quit: %qreason
    halt
  }
  else {
    scon -at1 .quit ragnarök 1.0
    set %qreason ragnarök 1.0 
    echo $color(other text) -at ( $+ $kolorj(›) $+ ) Was connected for $uptime(server,1)
    echo $color(other text) -at ( $+ $kolorj(›) $+ ) Quit: %qreason
  }
}
 


why doesnt this work? without scon -at it works fine, so i guess it should be scon thats wrong? smile
Posted By: Online Re: quit alias - 21/01/03 09:50 PM
Seems like using /scon to quit, makes the alias to recursively call itself. you can use /scon -at1 !quit... to solve it, (as '!' bypasses aliases).
Posted By: Hammer Re: quit alias - 21/01/03 10:26 PM
Or perhaps .raw QUIT :ragnarök 1.0 › $1-
Posted By: Online Re: quit alias - 21/01/03 10:47 PM
Yeah, although I always prefer the shorter smile
anyway, I didn't know that /scon would make recursive calls. I know about a few scripters who'd love to know that grin
Posted By: fraggle Re: quit alias - 21/01/03 11:18 PM
anyway, I didn't know that /scon would make recursive calls. I know about a few scripters who'd love to know that

There are ways to do recursive calls without relying on undocumented behaviour... so surely it'd be better to do that - even if you are using scon to execute it somewhere else?
Posted By: Online Re: quit alias - 21/01/03 11:32 PM
That's right. Speaking of /scon, I tried this:

alias recursive {
echo - I call myself!
scid $cid recursive
}

Fortunately, mIRC limits recursive calls to 500, so mIRC wouldn't freeze for long if you try it yourself...

smirk
Posted By: qwerty Re: quit alias - 22/01/03 05:58 AM
Yep, /scon can make recursive calls but is significantly slower than the good ol' way of having two aliases calling each other. If speed isn't a main issue though, /scon is a nice and quick way to call a command recursively.
© mIRC Discussion Forums