mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2006
Posts: 8
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2006
Posts: 8
I'm writing a little alias, just want to be away in all connections.
I tried:
Code:
away scid -a $1-

But I'm getting * Error allocating stack memory (line 23, aliases.ini)

Tried again but long an the error continue.
Code:
away { 
  var %x 1
  while ( %x <= $scid(0) ) {
    scid $scid(%x) away $1-
    inc %x
  }
}


My pc is not out of memory, I checked laugh


Sorry for my english
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This is a Windows error, not a mIRC bug.

Windows allocates a percentage of your total memory for stacks, and if those stacks become too full, you'll get that error message.

Additionally, since your alias is called away, and you had the away command in the alias, it would try to call itself.
This is referred to as recursive calling, which is not allowed in mIRC scripting.

The following code will do what it appears you want the alias to accomplish, while avoiding both problems.

Code:
alias away {
  .scon -at1 !away $1-
}


Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Originally Posted By: RusselB

Additionally, since your alias is called away, and you had the away command in the alias, it would try to call itself.



Actually that's not true.

From help.chm
An alias cannot call itself recursively mainly because this seems to cause more problems for users than it solves.

/help aliases


Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Except in this case the alias does not call itself directly but through /scid, so the restriction mentioned in the help file doesn't apply.

The problem is indeed caused by recursion but it has nothing to do with Windows. The "error allocating stack memory" is just mirc's way of saying "you reached a recursion depth that exceeds the limit I have set" (which varies among versions and is currently 85 for /scid-mediated recursion - the most you can get is 255 by mutually recursive aliases called as commands, not as identifiers).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2006
Posts: 8
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2006
Posts: 8
Ahhh I just missed one line in aliases help
Quote:

If you want to perform a command without it being processed as an alias, you can prefix it with a ! exclamation mark.

Thanks.


Sorry for my english
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Quote:
(which varies among versions and is currently 85 for /scid-mediated recursion - the most you can get is 255 by mutually recursive aliases called as commands, not as identifiers).
How do you get 255 ? I can only do it 85 time like you said by using /scid


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Code:
alias mutrec1 inc %i | echo -ag %i | mutrec2
alias mutrec2 inc %i | echo -ag %i | mutrec1

//set %i 0 | mutrec1

As you can see, to get the maximum (effective) depth you have to duplicate code (have two mirror aliases that call each other).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Oh ok, I thought you could do this with only one alias, thanks wink


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard