|
thomaspepon Beginner
Joined: 04 Sep 2008 Posts: 16
|
Posted: Tue Nov 18, 2008 12:10 am
odd scripting latency |
I have a trigger, with a pretty simple script afterwards, and I was just watching it, and it
taking a lot longer than it should have to run. It wasn't a problem with the mud. While the
script was firing (it has some #WAIT states in it) I was able to interact with the mud without
issue. Is this a problem with the #WAIT command, or am I just missing something?
I have a trigger
#TRIGGER {Thane tells you 'Spellup Complete'} {thank thane;tip thane;jakarta_@jakarta_run/step} "jakarta_run"
When this fires, @jakarta_run/step = 2, so it is calling the alias jakarta_2.
The alias is
#ALIAS jakarta_2 {#add jakarta_run/step 1;d;#wa 1000;s;#wa 1000;e;#wa 1000;e;#wa 1000;e;#wa 1000;open e;e;#wa 1000;e;#wa 1000;e;#wa 1000;n;#wa 1000;n;#wa 1000;n;#wa 1000;n;#wa 1000;n;#wa 1000;#5 sneak;#5 hide;#wa 1000;w;k shepherd} "jakarta_run"
Of course, I could just use a shortcut path, and eliminate the waits, and I don't remember what prompted me to add all the waits in at the moment.
I generally include waits when I have to use a mob counter in the room because of assisting mobs. So I have to reset the counter, and then walk in,
and then wait for the counter to be refreshed (the mud has to return the room description) and then I can access the counter to see if there are more than
say 3 of the same mob in the room, then I just move along.
In this case, I don't have that, but, in the time that I just watched, I received the trigger message, it sent 'thank thane' and 'tip thane' as expected, and
figured out that it should run jakarta_2 next. it sent the d command immediately, and one second later, sent s.
Then it sat there. I watched it for a few seconds. and then typed in 'sigth' (with the incorrect spelling) and the mud returned 'Eh?'.
I then typed in 'sigh', and I received 'You sigh.'
I then typed in 'say silly zMUD', and I received 'You say 'silly zMUD'.
My typing was over the course of 10-15 seconds. I then watched it for another 10-15 seconds, before finding my way to the forum.
This is not the only script I've encountered this with, I've seen this several times. And of course... it's not reproducable in any simple fashion.
My system (XP) was not lagging at the time, everything was responding fine, zMUD was responding fine, the mud was responding fine, but it
got lost in processing the #WA. It did come back after a time, and send the next direction, and wait a second, and continued on normally from there.
I've gone so far as to occasionally set zMUD to run as Above Normal priority. That was a silly step, since zMUD itself was never having a problem, it was
just an issue executing the wait. But that didn't help. It doesn't always stick on the wait. It doesn't always stick at all. I can get several runs without issue
and then get stuck.
I do a lot of this running in the background, so I'm not always there to watch it, but I've seen it several times when I was watching. Anyone else have
issues with the #WA command? |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Tue Nov 18, 2008 6:17 pm |
The #WAIT command is known to be buggy.
A better solution:
Code: |
#ALIAS jakarta_2 {
#add jakarta_run/step 1
#VAR jakarta_move {d;s;e;e;e;e;e;e;n;n;n;n;n;#5 sneak;#5 hide;w;k shepherd}
#ALARM "do_jak_mv" {*1} {
%pop(jakarta_move)
#IF !(@jakarta_move) {#UNTRIG do_jak_mv}
}
} |
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
thomaspepon Beginner
Joined: 04 Sep 2008 Posts: 16
|
Posted: Tue Nov 18, 2008 6:24 pm |
I've done a variable as a list, but didn't know you could work it as a stack.
Of course, even if I had known that, I probably would have used wait and
run into the same issue.
Thanks for the help. |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Tue Nov 18, 2008 6:41 pm |
You're welcome.
And %pop is such a wonderful thing ;) |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
thomaspepon Beginner
Joined: 04 Sep 2008 Posts: 16
|
Posted: Fri Dec 05, 2008 7:20 pm |
I've tried a different application of your solution earlier, and ran into syntax errors anytime I used a # command, like the repeats.
I found that by putting an #exec in front of the %pop statement, and putting the code pieces in double-quotes, I can get around the
syntax issue. In case anyone else is using this post for reference.
#VAR gold_run {"#ti 0"|wa|d|s|s|"#6 dr jug"|fil jug|ca 'gate' captain|get coins safe|ca 'gate' mistress|n|op e|e|get coins chest|"#5 recall"|n|u|sl|sc|who|tel apo 'gold run complete'}
#ALARM "gold_run_exec" {*2} {
#exec %pop( gold_run)
#IF !(@gold_run) {
#UNTRIG gold_run_exec
#UNVAR gold_run
}
}
(i'm triggering on the tell to restart my timer, so that I wait 150 seconds, since I finish the script before mud processes everything, and I want to wait 6 30-second ticks before repeating) |
|
|
|
thomaspepon Beginner
Joined: 04 Sep 2008 Posts: 16
|
Posted: Fri Dec 05, 2008 7:37 pm |
After more tweaking and timing, my gold_run_new alias code ended up as:
#VAR gold_run {"#ti 0;wa;.dss;#6 dr jug;fil jug"|"ca 'gate' captain;get coins safe"|"ca 'gate' mistress;n;op e;e;get coins chest"|"#5 recall;.nu;sl;sc;who;tel apo 'gold run complete'"}
#ALARM "gold_run_exec" {*6} {
#exec %pop( gold_run)
#IF !(@gold_run) {
#UNTRIG gold_run_exec
#UNVAR gold_run
}
} |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|