scripting and command stacking

Posted by Kingjames_IV on Sat 22 Feb 2003 06:23 PM — 9 posts, 41,070 views.

#0
I was wondering why it is that if i stack a few commands and one of them is a scripted alias it always gets sent first. for instance if i enter north;hide;bb where bb is a scripted alias for backstab XXX the first thing that gets sent is backstab then norht then hide, which makes it basically useless. Anyone know a way to fix this?
USA #1
Fix it? Have everything script... lol But seriously, the client as I understand it does:

1. Process commands to find script calls and place them on a stack.
2. Process stack.
3. Send all other text.

Needless to say, "Ooops!".

Most clients that build in the scripting tend to do:

1. Get next command.
2. Check if scripting and process immediately if so, otherwise send.
3. Get next command...

Nick kind of goofed here and should have used some sort of queue that stored both sent commands and script calls, so that they both executed in the order they arrived and not as seperate processes. I think it is likely high on his list of stuff to fumigate next. ;)
#2
"Have everything script..."

Was REALLY hoping i didn't get that answer...Ok time to script all of my directions, backstab, and charge commands...
Australia Forum Administrator #3
Hmmm - this isn't very good is it?

All I can suggest for now is to do a delayed send, if you can tolerate a 1-second delay.

ie. in your script, rather than:

world.send "backstab"

do

world.doafter 1, "backstab"

That will delay the backstab, so it will appear after the non-scripted commands.
USA #4
Now, see, if I set up an alias that does 'WHO' when I type 'test', and I do a command stack which does two commands and then 'test'... it does do the first two commands, and then the WHO. But if the alias calls a script which does the same thing, it does the WHO first.

Which does, in fact, look like it's a bug in the client. The command stacks ought to do each command individually, and not evaluate the script for an alias until it's already handled the items ahead of that alias in the command stack. If it won't process a *normal* alias until the right point, it also shouldn't do a script until that point.

What happens if you've got a very large stack, like A;B;C;D;E;F;G;H;I, and the alias there is actually C, but all the rest are regular commands? If the script doesn't delay, it'll be sent too soon... but if it delays, it'll go too late. The script needs to be processed at the point where the command is.
Australia Forum Administrator #5
OK, this is a bug, pure and simple. I have added it as bug number 488 in the bug database.
USA #6
*sniff sniff* vers 3.33 far away? :)
Australia Forum Administrator #7
I am catching up on the forum messages and will try to do a new version in the next day or so.
Australia Forum Administrator #8
Fixed in version 3.35 - see the release notes, it will behave a bit differently (that is the idea isn't it?) which will hopefully fix these problems and not annoy anyone else.