Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ Jscript
➜ scripting and command stacking
scripting and command stacking
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Kingjames_IV
(10 posts) Bio
|
Date
| Sat 22 Feb 2003 06:23 PM (UTC) |
Message
| 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? | Top |
|
Posted by
| Shadowfyr
USA (1,788 posts) Bio
|
Date
| Reply #1 on Sat 22 Feb 2003 06:52 PM (UTC) |
Message
| 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. ;) | Top |
|
Posted by
| Kingjames_IV
(10 posts) Bio
|
Date
| Reply #2 on Mon 24 Feb 2003 03:48 AM (UTC) |
Message
| "Have everything script..."
Was REALLY hoping i didn't get that answer...Ok time to script all of my directions, backstab, and charge commands... | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #3 on Mon 24 Feb 2003 05:00 AM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Neva
USA (117 posts) Bio
|
Date
| Reply #4 on Tue 25 Feb 2003 04:00 PM (UTC) |
Message
| 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #5 on Sun 02 Mar 2003 12:13 AM (UTC) |
Message
| OK, this is a bug, pure and simple. I have added it as bug number 488 in the bug database. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Guest1
USA (256 posts) |
Date
| Reply #6 on Sun 02 Mar 2003 12:18 AM (UTC) |
Message
| *sniff sniff* vers 3.33 far away? :) | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #7 on Tue 04 Mar 2003 01:22 AM (UTC) |
Message
| I am catching up on the forum messages and will try to do a new version in the next day or so. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #8 on Thu 03 Apr 2003 01:54 AM (UTC) Amended on Thu 03 Apr 2003 01:55 AM (UTC) by Nick Gammon
|
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
31,019 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top