mIRC Home    About    Download    Register    News    Help

Print Thread
#7691 21/01/03 09:24 PM
Joined: Dec 2002
Posts: 45
P
piko Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Dec 2002
Posts: 45
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

#7692 21/01/03 09:50 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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).

#7693 21/01/03 10:26 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Or perhaps .raw QUIT :ragnarök 1.0 › $1-


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#7694 21/01/03 10:47 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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

#7695 21/01/03 11:18 PM
Joined: Dec 2002
Posts: 39
F
Ameglian cow
Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 39
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?

#7696 21/01/03 11:32 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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

#7697 22/01/03 05:58 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard