 |
Nattie |
Posted: Wed Aug 06, 2008 1:26 pm
Getting lots of strange "bugs" and errors, what are my options? |
 |
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Fri Aug 29, 2008 8:17 am |
Regarding %additem/#additem
I assumed Nattie used %additem because there are multiple items with duplicated names in the list.
queue jab
queue kick
queue jab
queue kick
etc |
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Aug 29, 2008 5:28 pm |
Hmm, that's true, I had forgotten about that. Given the performance advantage of #ADDITEM over %additem, it might be time for me to add another argument to #ADDITEM to indicate whether duplicates should be allowed in the list.
|
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Fri Aug 29, 2008 11:57 pm |
Okay, well this is good so far! I haven't caught anything not properly triggering yet, and I thought for sure I would. I think the #SECTION thing might have done the trick. :-) I've only tested four of my scripts over and over so far, though, in addition to the queue thing I had set up. I'll keep running the script debugger as I venture into testing other ones.
I'm going to go back and see if the jab/kick script and some other scripts work, I'm just not in a place in the game where I can do that right now.
After that I'm going to go back to some more complicated stuff I tried to do earlier and postponed, retest events to see if they still work oddly, and then I have a relatively more complicated script planned. Then I'm going to try again with the mapper, which I hope will run smoother now that I don't have all these other little errors floating around. In other words, I'll probably have a lot more stuff to ask about, heh. Thank you so much for the help so far, I'm very happy to have it (apparently) stable now. :-) |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Sun Aug 31, 2008 1:25 am |
Okay, I am getting something strange happening sometimes. In an alias, I might tell it to queue blah blah blah, and every now and then, these commands will get skipped over. The script debugger doesn't seem helpful in this instance because it isn't showing anything strange for why the command got skipped over. I am still testing, but I was thinking about the issue with two things trying to change a variable at the same time... could it maybe be a problem if two different things, say an alias and a trigger, both tried to access the same alias at the same time? Would one maybe slip through the cracks?
As an example of code that I had get skipped over:
Code: |
queue stand
queue get my @jugglies
queue exp skill perception
#WAITFOR {OKAY, IT'S THE END.} |
I tested this two times in a row. Each time it executed "stand" properly and ignored the next two lines. When I did a #THREAD it showed that it was waiting for the #WAITFOR. After each time, I did a #SHOW OKAY, IT'S THE END. to end the script, and I double-checked that its thread no longer existed.
The third time I executed it, it ran fine.
The reason I ask if maybe things accessing the queue alias at the same time is causing it is because I have a set of triggers that perform actions every few minutes. Of course, the commands these triggers send to the game have to access the queue alias. I have tested those triggers on their own for a few hours each with no problems whatsoever. Whenever I test a new script, I turn those triggers off to be safe and test the script on its own at least three times. If I have no problems, I turn on the aforementioned triggers again and see if they play well with the script. It seems that this is when I start having problems.
If I have those triggers turned on, and they try to access the queue alias at the same time the script I'm running tries to access it too, would that maybe screw things up? If so, am I going to have to make a #SECTION main (or something) and put it around every line where I access the queue alias? I'm willing to do that, if necessary, but it will be some extra tedious work so I don't want to do it unless I have to.
In other news, a preliminary test of the jab/kick script from earlier seems to have the same problem... after I run it a few times, I can no longer run aliases from the command line. I haven't had time to figure out what's going on there, but I thought I'd just mention it for now because it seemed like protecting the rtqueue variable might help that, but it didn't so it must be something else.
Oh, one other unrelated issue is that a few times now, I have had a button change its colors to the default after closing and opening the program. I'm not sure what's up with that. I told the button to be black with white text, but when I relog it is tan with black text. This has happened a few times. I'm going to change it back again and see if it keeps happening. |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Sun Aug 31, 2008 2:24 am |
Okay, try as I might I cannot replicate this bug when I want to, and the script debugger doesn't show anything specific, but this has happened a few times now and it's way weird.
Whenever a script begins or ends, I check #THREAD to make sure only the threads that should be running are running.
Just now, I created a new alias that has nothing to do with any other aliases -- except queue like all my other scripts do. Here is the code...
Code: |
IF (%1=="off") {queue remove my leathers
queue put my leathers in my @maincontainer
queue remove my gloves
queue put my gloves in my @maincontainer
queue remove my cowl
queue put my cowl in my @maincontainer} {
queue get my leathers
queue wear my leathers
queue get my gloves
queue wear my gloves
queue get my cowl
queue wear my cowl} |
When I executed it with the "off" argument attached, it got all the way to "remove my cowl" with no incident... at which point, somehow, the commands "get my black compendium" and "get my balls" were sent to the queue. Those are lines from two other scripts I have, and there is no way that the game text triggered this because I checked the folders for the triggers associated with these scripts and they were disabled. Furthermore, those commands aren't actually ones that triggers execute anyway, they're commands that are in the text of those respective aliases. In other words, to send those commands to the game, those aliases would have to execute -- except that they aren't executing, either (see more details below). Furthermore, the only way to execute those aliases is to type them manually into the command line; I have no triggers, no buttons, no anything that execute them, and I did not type anything into the command line other than zarmor off.
"get my black compendium" comes from this alias, zcomp:
Code: |
#IF (@pupil==0) {queue assess teach}
#VAR ./universal/generic_scripts/compendium/compturns 0
#T+ comptrigs
queue get my black compendium
#WAITFOR {OKAY, IT'S THE END.}
queue close my compendium
queue put my compendium in my cloak
#T- comptrigs
#VAR ./universal/generic_scripts/compendium/compturns 0
#SHOW SCRIPT HAS ENDED.
#PLAY C:\WINDOWS\Media\notify.wav |
"get my balls" comes from this alias, zjuggle:
Code: |
IF (@pupil==0) {queue assess teach}
#T+ jugtrigs
#VAR ./universal/generic_scripts/juggling/jugglies %1
queue stand
queue get my @jugglies
queue exp skill perception
#WAITFOR {OKAY, IT'S THE END.}
#T- jugtrigs
queue put my @jugglies in my cloak
queue kneel
#SHOW SCRIPT HAS ENDED.
#PLAY C:\WINDOWS\Media\notify.wav |
Okay, to make things even weirder, I immediately did a #THREAD and those aliases were not shown. If they had been executed somehow, they ought to be on the "waiting for string: OKAY, IT'S THE END." stage, because that text never appeared. They were simply not there, though.
And the weirdness cherry on the top of the bizarro sundae is that the C:\WINDOWS\Media\notify.wav from those scripts will sometimes play at random times, and this has never happened to me previously. Every trigger I have that plays a sound is coupled with colored text, of which there was none when the sound played, and the C:\WINDOWS\Media\notify.wav I use exclusively for when scripts end and nothing else anyway. I've heard the sound three times now when a script has not ended.
Those two aliases are ones that I ran a few times earlier in the session. Plus, one curious thing is that those two lines are ones that got passed over before, like I mentioned in my above post! (I only showed the jugglies one as an example, but "get my black compendium" was also skipped over a few times.) I'm not sure if that's a coincidence or not. Either way, it seems like pieces of my aliases are getting stuck somewhere without showing up in #THREAD... and if the lines that showed up in this case are not due to coincidence, they're apparently getting regurgitated later, at strange times. |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Sun Aug 31, 2008 2:36 am |
Since it seems possible that there is a strange threading issue going on still, and I know #WAIT commands put things into threads, I wanted to put this out there.
The queue and emptyqueue aliases that I use for all the commands that get sent to the game rely on this trigger to know how much time I need to wait before I can perform another action:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="300" regex="true" copy="yes">
<pattern>Roundtime(?:\:)?\s+(\d(?:\d)*)</pattern>
<value>#VAR tmax %1
#VAR t @tmax
#SHOW T IS SET.
#WHILE (@t > 0)
{
#WAIT 1000
#ADD t -1
}</value>
</trigger>
</cmud>
|
So I get a command from the game that says something like "Roundtime: 20 seconds." It sets @tmax to 20 seconds, and @t equal to @tmax. @tmax is only there so I can have a timer gauge. What I think might be causing threading issues is what happens to @t... it goes through that #WHILE loop as long as @t is greater than 0. So if the game tells me my roundtime is 20 seconds, it has to do a #WAIT 1000 twenty times.
I'm pretty much always getting roundtimes, so that's a lot of threads it has to make and destroy over the course of a session. Would that maybe cause problems? |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Sun Aug 31, 2008 3:51 am |
The thing where it passed over a line and spit it out a long time later just happened again! Another thing worth mentioning is that when it puts the lost line through the queue, it stops the emptyqueue alias from emptying correctly. Every time it's happened so far, I have noticed that the queue abruptly quits emptying once the lost line is sent to the game. The @rtqueue variable just sits there with strings in it. I have to manually enter emptyqueue to fix it.
Maybe half an hour ago, I ran zjuggle and it skipped only the line queue get my balls. I made note of it, entered the command manually, and the alias completed as it should.
Just now, I made this trigger:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="5490" regex="true" copy="yes">
<pattern>It's not even locked, why bother\?$</pattern>
<value>#VAR lockdifficulty ""
queue put my lockpick in my cloak
queue open my @currentbox
queue look in my @currentbox</value>
</trigger>
</cmud>
|
The game sent me the line, "It's not even locked, why bother?" so that trigger executed. This is what happened in the game:
Quote: |
It's not even locked, why bother?
put my lockpick in my cloak
You put your lockpick in your satin cloak.
> get my balls
You get a set of colorful balls from inside your satin cloak. |
I noticed the queue is backed up and not emptying. I check #THREAD, and nothing is running at all. I do an emptyqueue, and here's what it sent to the game and got back:
Quote: |
> open my coffer
You open your driftwood coffer.
> look in my coffer
In the driftwood coffer you see some copper coins, a bronze coin and a small red-green bloodstone. |
Unfortunately I didn't have the debugger running when it happened, because I wasn't running a script at the time. :-/ However, maybe the above will still be helpful. I'm pretty sure now that it's getting commands stuck somewhere and spitting those commands out much, much later, I just can't figure out why. I wonder if it's a bug with #SECTION or something? |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Sun Aug 31, 2008 5:20 am |
I caught the zjuggle skipping over the line queue get my @jugglies while the script debugger was open. I had the other triggers I mentioned earlier running since I don't seem to have any trouble running the script by itself. Here is the script debugger info...
Code: |
0.0005 | c DragonRealms | [218] DragonRealms Comline : start :
0.0026 | d DragonRealms | [218] DragonRealms Comline : wait -16246 ms
0.7514 | e DragonRealms | [218] DragonRealms Comline : resumed
0.0023 | e DragonRealms | [218] DragonRealms Comline : resumed
0.1663 | a DragonRealms |> assess teach
0.0004 | j DragonRealms >assess teach
0.2011 | a DragonRealms ]>
0.5999 | a DragonRealms |>
0.1649 | a DragonRealms |You assess the teaching environment...
0.0013 | a DragonRealms |
0.1687 | a DragonRealms |No one seems to be teaching.
0.0008 | f DragonRealms | Pattern: No one seems to be teaching.
0.0007 | c DragonRealms | exec : Pattern "No one seems to be teaching." : #VAR teacher "" ...
0.0006 | a DragonRealms |Roundtime: 5 seconds.
0.0001 | f DragonRealms | Pattern: Roundtime(?:\:)?\s+(\d(?:\d)*) : (%1=5)
0.0006 | c DragonRealms | [217] DragonRealms Trigger : start : Pattern "Roundtime(?:\:)?\s+(\d(?:\d)*)" : #VAR tmax %1 #...
0.0009 | a DragonRealms |
0.0011 | a DragonRealms |T IS SET.
0.0002 | f DragonRealms | Pattern: T IS SET.
0.0006 | c DragonRealms | exec : Pattern "T IS SET." : #COLOR black
0.0008 | d DragonRealms | [217] DragonRealms Trigger : wait -15985 ms
0.0596 | e DragonRealms | [218] DragonRealms Comline : resumed
1.0611 | e DragonRealms | [217] DragonRealms Trigger : resumed
0.8343 | e DragonRealms | [217] DragonRealms Trigger : resumed
1.1694 | e DragonRealms | [217] DragonRealms Trigger : resumed
0.8342 | e DragonRealms | [217] DragonRealms Trigger : resumed
1.1695 | e DragonRealms | [217] DragonRealms Trigger : resumed
0.0056 | d DragonRealms | [217] DragonRealms Trigger : terminated
0.0949 | e DragonRealms | [218] DragonRealms Comline : resumed
0.1643 | a DragonRealms |> stand
0.0010 | j DragonRealms >stand
0.4049 | a DragonRealms |
0.0011 | a DragonRealms |You stand back up. |
At this point, the next command should have been queue get my @jugglies, but it isn't even put in the queue. It skips to the next line instead, queue exp skill perception.
Code: |
0.0022 | a DragonRealms ]>
0.3441 | e DragonRealms | [218] DragonRealms Comline : resumed
0.0023 | e DragonRealms | [218] DragonRealms Comline : resumed
0.1705 | a DragonRealms |>
0.0008 | j DragonRealms >
0.5851 | e DragonRealms | [218] DragonRealms Comline : resumed
0.1704 | e DragonRealms | [218] DragonRealms Comline : resumed
0.0033 | a DragonRealms |exp skill perception
0.0010 | j DragonRealms >exp skill perception
0.2134 | a DragonRealms |
0.0011 | a DragonRealms |Showing Perception experience:
0.0011 | a DragonRealms |
0.1662 | a DragonRealms | SKILL: Rank/Percent towards next rank/Amount learning
0.0014 | a DragonRealms | Perception: 70 89.95% learning
0.0003 | f DragonRealms | Pattern: Perception:%s(%d) : (%1=70)
0.0006 | c DragonRealms | exec : Pattern "Perception:%s(%d)" : #VAR cperception %1
0.0004 | f DragonRealms | Pattern: Perception:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thought...
0.0011 | c DragonRealms | [219] DragonRealms Trigger : start : Pattern "percmind2" : queue juggle my @jugglies
0.1685 | d DragonRealms | [219] DragonRealms Trigger : wait -16239 ms
0.1658 | a DragonRealms |
0.0012 | a DragonRealms |Time Development Points: 16 Favors: 7 Deaths: 0
0.0014 | a DragonRealms |Overall state of mind: clear
0.0011 | a DragonRealms |EXP HELP for more information
0.1701 | a DragonRealms ]>
0.7429 | e DragonRealms | [219] DragonRealms Trigger : resumed
0.0025 | e DragonRealms | [219] DragonRealms Trigger : resumed
0.0029 | a DragonRealms |> juggle my balls
0.0010 | j DragonRealms >juggle my balls
0.0012 | d DragonRealms | [219] DragonRealms Trigger : terminated
0.1516 | a DragonRealms |
0.0012 | a DragonRealms |But you're not holding a set of colorful balls. |
Here it trips up because I'm not holding the balls as I'm expected to be... The following chunk (exp skill appraisal and appraise my bundle) is the result of the aforementioned triggers that perform actions every few minutes.
Code: |
0.0018 | a DragonRealms ]>
5.6225 | a DragonRealms |>
0.0013 | a DragonRealms |You continue to hum a quiet lament with only the slightest hint of difficulty.
0.0025 | a DragonRealms |
0.1653 | a DragonRealms ]>
4.3624 | a DragonRealms |>
0.0019 | a DragonRealms | * Valleseria was just struck down!
0.0020 | a DragonRealms ]>
11.797 | a DragonRealms |>
0.0036 | a DragonRealms |You continue to hum your song.
0.0031 | a DragonRealms |
0.1705 | a DragonRealms ]>
12.616 | e DragonRealms | [212] DragonRealms Trigger : resumed
0.9205 | e DragonRealms | [212] DragonRealms Trigger : resumed
0.0029 | e DragonRealms | [212] DragonRealms Trigger : resumed
0.0035 | a DragonRealms |> exp skill appraisal
0.0009 | j DragonRealms >exp skill appraisal
0.0008 | d DragonRealms | [212] DragonRealms Trigger : terminated
0.1415 | a DragonRealms |
0.0011 | a DragonRealms |Showing Appraisal experience:
0.0011 | a DragonRealms |
0.0011 | a DragonRealms | SKILL: Rank/Percent towards next rank/Amount learning
0.0012 | a DragonRealms | Appraisal: 74 74.12% perplexed
0.0003 | f DragonRealms | Pattern: Appraisal:%s(%d) : (%1=74)
0.0006 | c DragonRealms | exec : Pattern "Appraisal:%s(%d)" : #VAR cappraisal %1
0.0004 | f DragonRealms | Pattern: Appraisal:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtf...
0.0006 | c DragonRealms | [220] DragonRealms Trigger : start : Pattern "appmind2" : queue appraise my bundle #WAIT 30000...
0.0009 | d DragonRealms | [220] DragonRealms Trigger : wait -16250 ms
0.1660 | a DragonRealms |
0.1690 | a DragonRealms |Time Development Points: 16 Favors: 7 Deaths: 0
0.0015 | a DragonRealms |Overall state of mind: clear
0.0012 | a DragonRealms |EXP HELP for more information
0.0019 | a DragonRealms ]>
0.7455 | e DragonRealms | [220] DragonRealms Trigger : resumed
0.0028 | e DragonRealms | [220] DragonRealms Trigger : resumed
0.0034 | a DragonRealms |> appraise my bundle
0.0009 | j DragonRealms >appraise my bundle
0.7483 | a DragonRealms |
0.0013 | a DragonRealms |It appears that the lumpy bundle can be slung over one shoulder.
0.0012 | a DragonRealms |The lumpy bundle feels quite heavy.
0.1551 | a DragonRealms |You scan through the skins in the lumpy bundle and finally decide that they're worth a total of about 856 Dokoras.
0.0014 | a DragonRealms |Roundtime: 8 seconds.
0.0002 | f DragonRealms | Pattern: Roundtime(?:\:)?\s+(\d(?:\d)*) : (%1=8)
0.0009 | c DragonRealms | [221] DragonRealms Trigger : start : Pattern "Roundtime(?:\:)?\s+(\d(?:\d)*)" : #VAR tmax %1 #...
0.1690 | a DragonRealms |
0.1663 | a DragonRealms |T IS SET.
0.0002 | f DragonRealms | Pattern: T IS SET.
0.0006 | c DragonRealms | exec : Pattern "T IS SET." : #COLOR black
0.0009 | d DragonRealms | [221] DragonRealms Trigger : wait -15832 ms
0.7571 | a DragonRealms |> You continue to hum a quiet lament with only the slightest hint of difficulty.
0.0018 | a DragonRealms |
0.1655 | a DragonRealms ]>
0.4075 | e DragonRealms | [221] DragonRealms Trigger : resumed
1.0019 | e DragonRealms | [221] DragonRealms Trigger : resumed
0.9314 | a DragonRealms |>
0.0012 | a DragonRealms |You've gained a new rank in your harness ability.
0.0002 | f DragonRealms | Pattern: You've gained a new rank
0.0007 | c DragonRealms | exec : Pattern "You've gained a new rank" : #color yellow #PLAY ...
0.0012 | a Gained R |You've gained a new rank in your harness ability.
0.0097 | a DragonRealms ]>
0.0572 | e DragonRealms | [221] DragonRealms Trigger : resumed
1.0018 | e DragonRealms | [221] DragonRealms Trigger : resumed
1.0019 | e DragonRealms | [221] DragonRealms Trigger : resumed
1.0019 | e DragonRealms | [221] DragonRealms Trigger : resumed
1.1695 | e DragonRealms | [221] DragonRealms Trigger : resumed
0.8342 | e DragonRealms | [221] DragonRealms Trigger : resumed
0.1733 | d DragonRealms | [221] DragonRealms Trigger : terminated |
Now I manually enter the commands get my balls and juggle my balls and the rest of the alias runs fine. I clipped it after the first few actions since I didn't have any more issues.
Code: |
0.8882 | ---
0.0011 | c DragonRealms | [222] DragonRealms Comline : start :
0.1698 | a DragonRealms |> get my balls
0.0012 | j DragonRealms >get my balls
0.0004 | d DragonRealms | [222] DragonRealms Comline : stopped
0.2048 | a DragonRealms |
0.0012 | a DragonRealms |You get a set of colorful balls from inside your satin cloak.
0.0025 | a DragonRealms ]>
1.2008 | ---
0.0005 | c DragonRealms | [222] DragonRealms Comline : start :
0.1663 | a DragonRealms |> juggle my balls
0.0011 | j DragonRealms >juggle my balls
0.0005 | d DragonRealms | [222] DragonRealms Comline : stopped
0.8953 | a DragonRealms |
0.1662 | a DragonRealms |You toss three of your colorful balls into the air and start juggling them. You get a good rhythm going, and the colorful balls fly high into the air in a nice even pattern. You finally decide to stop, and deftly catch each one as it comes down.
0.0016 | f DragonRealms | Pattern: ^You toss
0.0008 | c DragonRealms | exec : Pattern "^You toss" : #SEND exp skill perception
0.0007 | a DragonRealms |exp skill perception
0.0003 | j DragonRealms >exp skill perception
0.0007 | a DragonRealms |Roundtime: 12 seconds.
0.0003 | f DragonRealms | Pattern: Roundtime(?:\:)?\s+(\d(?:\d)*) : (%1=12)
0.1689 | c DragonRealms | [223] DragonRealms Trigger : start : Pattern "Roundtime(?:\:)?\s+(\d(?:\d)*)" : #VAR tmax %1 #...
0.1660 | a DragonRealms |
0.1690 | a DragonRealms |T IS SET.
0.0002 | f DragonRealms | Pattern: T IS SET.
0.0006 | c DragonRealms | exec : Pattern "T IS SET." : #COLOR black
0.0010 | d DragonRealms | [223] DragonRealms Trigger : wait -15999 ms |
|
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Sun Aug 31, 2008 5:59 am |
I realized a few things about the lines that are lost, and when the lines are forced back out again...
It's always in a chunk of code where I have two or more nearly consecutive lines that start with the queue alias. I say "nearly" consecutive because if there is something simple, like a #VAR declaration between them, it will happen too.
Furthermore, I found that I can force those lines out and replicate the emptyqueue alias failing to empty the @rtqueue variable by executing any chunk of code where three or more consecutive lines start with the queue alias.
I caught this all -- the line being skipped over, and the line being forced out later -- in the script debugger. This will be a long post since I need to post all the aliases and the script debugger. This time I lost lines while trying to do the zvocals alias and I forced them out with zarmor off.
Here is the class zvocals is in, including all its triggers and subclasses and everything:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="vocals" copy="yes">
<alias name="zvocals" copy="yes">
<value>queue stop hum
#IF (%1=="") {#T+ VocTriggers
#IF (@vocdiff<1) {#VAR vocdiff 1}
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay
}
#IF (%1=="end") {#T- VocMind; #T- VocTriggers}</value>
</alias>
<var name="vocdiff" copy="yes">10</var>
<var name="vocplay" copy="yes">lament</var>
<class name="VocTriggers" copy="yes">
<trigger name="vocmessage3" priority="30360" copy="yes">
<pattern>You begin to hum %w %w %w.$</pattern>
<value>#ADD vocdiff 1
queue stop hum
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay</value>
</trigger>
<trigger name="vocmessage1" priority="30370" regex="true" copy="yes">
<pattern>You effortlessly begin to hum [^\n]*, your heart swelling in pride at your hard-earned skill.$</pattern>
<value>#ADD vocdiff 1
queue stop hum
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay</value>
</trigger>
<trigger name="vocmessage2" priority="30380" regex="true" copy="yes">
<pattern>You begin to hum [^\n]*, your skill in your craft showcased in every note.$</pattern>
<value>#ADD vocdiff 1
queue stop hum
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay</value>
</trigger>
<trigger name="vocmessage6" priority="30390" regex="true" copy="yes">
<pattern>You begin to hum [^\n]* with only the slightest hint of difficulty.$</pattern>
<value>#ADD vocdiff 1
queue stop hum
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay</value>
</trigger>
<trigger name="vocmessage4" priority="30400" regex="true" copy="yes">
<pattern>You fumble slightly as you begin to hum [^\n]*.$</pattern>
<value>#ADD vocdiff -1
queue stop hum
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay</value>
</trigger>
<trigger name="vocmessage5" priority="30410" regex="true" copy="yes">
<pattern>You struggle to begin to hum [^\n]*.$</pattern>
<value>#ADD vocdiff -1
queue stop hum
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay</value>
</trigger>
<trigger name="vocmessage7" priority="30390" regex="true" copy="yes">
<pattern>You begin to hum [^\n]* with only the slightest hint of difficulty.$</pattern>
<trigger regex="true">
<pattern>You fumble slightly as you begin to hum [^\n]*.$</pattern>
<value>#T+ VocMind
queue exp skill vocals
#T- VocTriggers</value>
</trigger>
</trigger>
</class>
<class name="VocMind" copy="yes">
<trigger name="vocmind1" priority="30450" regex="true" copy="yes">
<pattern>Vocals:\s+\d+\s+\d+\.\d+%\s+(?:dazed|mind lock)</pattern>
<value>queue stop hum
#WAIT 120000
queue exp skill vocals</value>
</trigger>
<trigger name="vocmind2" priority="30480" regex="true" copy="yes">
<pattern>Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|pondering|concentrating|muddled|perplex|bewilder|very)</pattern>
<value>queue hum @vocplay</value>
</trigger>
<trigger priority="30550" regex="true" copy="yes">
<pattern>You finish humming [^\n]*.$</pattern>
<value>queue exp skill vocals</value>
</trigger>
<trigger priority="5190" copy="yes">
<pattern>You've gained a new rank in vocal instruments.</pattern>
<value>zvocals</value>
</trigger>
</class>
<var name="playdifficulty" type="Record" copy="yes">30=aria|31=sonata|32=concerto|10=lament|11=wedding|12=hymn|13=rumba|14=polka|15=battle|16=reel|17=elegy|18=serenade|19=minuet|1=scales|2=arpeggio|3=ditty|4=folk|5=ballad|6=waltz|7=lullaby|8=march|9=jig|20=psalm|21=dirge|22=gavotte|23=tango|24=tarantella|25=bolero|26=nocturne|27=requiem|28=fantasia|29=rondo</var>
</class>
</cmud> |
Here is the script debugger. I've put in some comments to make it easier to see what's going on. "You will no longer work the vocals skill." and "You will now work the vocals skill." is an #ECHO from a button I use to execute zvocals end and zvocals respectively.
In other words, this begins with me pressing the button to do zvocals end, then zvocals.
Code: |
0.0019 | a DragonRealms ]>
1.8140 | a DragonRealms |> stop hum
0.1678 | j DragonRealms >stop hum
0.0018 | a DragonRealms |You will no longer work the vocals skill.
0.4003 | a DragonRealms |
0.0011 | a DragonRealms |You stop playing your song.
0.0021 | a DragonRealms ]>
0.7534 | a DragonRealms |> You will now work the vocals skill.
0.7550 | a DragonRealms |stop hum
0.0007 | j DragonRealms >stop hum
0.1774 | a DragonRealms ]>
0.2804 | a DragonRealms |>
0.0011 | a DragonRealms |In the name of love?
0.0013 | a DragonRealms ]>
0.1227 | a DragonRealms |> hum lament
0.0008 | j DragonRealms >hum lament
0.3823 | a DragonRealms |
0.0011 | a DragonRealms |You begin to hum a quiet lament with only the slightest hint of difficulty.
-168.5082 | f DragonRealms |Pattern: You begin to hum [^\n]* with only the slightest hint of d...
-168.6762 | c DragonRealms |[376] DragonRealms Trigger : start : Pattern "vocmessage6" : #ADD vocdiff 1 queue stop hum #VA...
-168.6754 | d DragonRealms | [376] DragonRealms Trigger : wait -16142 ms
0.0004 | f DragonRealms | Pattern: You begin to hum [^\n]* with only the slightest hint of d...
-168.5044 | a DragonRealms ]>
0.7492 | e DragonRealms | [376] DragonRealms Trigger : resumed
0.1670 | e DragonRealms | [376] DragonRealms Trigger : resumed
0.0014 | a DragonRealms |> stop hum
0.0008 | j DragonRealms >stop hum
0.1702 | d DragonRealms | [376] DragonRealms Trigger : terminated
0.1660 | a DragonRealms |
0.0011 | a DragonRealms |You stop playing your song. |
At this point, it should have tried the next hardest song by bumping @vocdiff up one. It should then check that number against the database variable, set @vocplay to "wedding" accordingly, and queue hum @vocplay. In other words, I'm expecting it to send the command hum wedding to the game.
But it doesn't. queue hum wedding goes into the void.
So I press my button again to execute zvocals end and then again to execute zvocals and try again.
Code: |
0.0021 | a DragonRealms ]>
8.2189 | a DragonRealms |> stop hum
0.0008 | j DragonRealms >stop hum
0.1672 | a DragonRealms |You will no longer work the vocals skill.
0.3519 | a DragonRealms |
0.0011 | a DragonRealms |In the name of love?
0.0013 | a DragonRealms ]>
0.5697 | a DragonRealms |> You will now work the vocals skill.
0.9237 | a DragonRealms |stop hum
0.0006 | j DragonRealms >stop hum
0.0703 | a DragonRealms |
0.0011 | a DragonRealms |In the name of love?
0.0013 | a DragonRealms ]>
0.6794 | a DragonRealms |> hum wedding
0.0009 | j DragonRealms >hum wedding |
Note that it got the "wedding" part right and is no longer set to "lament". So I know that it did the check against the database, changed the variables... it's really, truly just the queue hum @vocplay that got stuck somewhere.
Code: |
0.1749 | a DragonRealms |
0.0011 | a DragonRealms |You fumble slightly as you begin to hum a quiet wedding march.
-156.7491 | f DragonRealms |Pattern: You fumble slightly as you begin to hum [^\n]*.$
0.0009 | c DragonRealms |[377] DragonRealms Trigger : start : Pattern "You fumble slightly as you begin to hum [^\n]*.$...
-156.7469 | d DragonRealms | [377] DragonRealms Trigger : wait -16300 ms
0.0001 | f DragonRealms | Pattern: You fumble slightly as you begin to hum [^\n]*.$
0.0009 | c DragonRealms | [378] DragonRealms Trigger : start : Pattern "vocmessage4" : #ADD vocdiff -1 queue stop hum #V...
-156.7449 | d DragonRealms | [378] DragonRealms Trigger : stopped
0.1385 | a DragonRealms ]>
0.7189 | e DragonRealms | [377] DragonRealms Trigger : resumed
0.1709 | e DragonRealms | [377] DragonRealms Trigger : resumed
0.1675 | a DragonRealms |> exp skill vocals
0.0008 | j DragonRealms >exp skill vocals
0.2349 | a DragonRealms |
0.0010 | a DragonRealms |Showing Vocals experience:
0.0009 | a DragonRealms |
0.1699 | a DragonRealms | SKILL: Rank/Percent towards next rank/Amount learning
-155.9216 | a DragonRealms | Vocals: 84 07.80% bewildering
0.0003 | f DragonRealms | Pattern: Vocals:%s(%d) : (%1=84)
0.0005 | c DragonRealms | exec : Pattern "Vocals:%s(%d)" : #VAR cvocals %1
0.0004 | f DragonRealms | Pattern: Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|...
-155.9199 | c DragonRealms | [378] DragonRealms Trigger : start : Pattern "vocmind2" : queue hum @vocplay
-155.9198 | d DragonRealms | [378] DragonRealms Trigger : stopped
0.1674 | a DragonRealms |
0.0012 | a DragonRealms |Time Development Points: 18 Favors: 7 Deaths: 0
0.1704 | a DragonRealms |Overall state of mind: clear
0.0011 | a DragonRealms |EXP HELP for more information
0.0017 | a DragonRealms ]>
0.3338 | e DragonRealms | [377] DragonRealms Trigger : resumed
0.1708 | e DragonRealms | [377] DragonRealms Trigger : resumed
0.0014 | a DragonRealms |> stop hum
0.0008 | j DragonRealms >stop hum
0.1423 | a DragonRealms |
0.0011 | a DragonRealms |You stop playing your song.
0.0022 | a DragonRealms ]>
0.6069 | e DragonRealms | [377] DragonRealms Trigger : resumed
0.0019 | e DragonRealms | [377] DragonRealms Trigger : resumed
0.0014 | a DragonRealms |> hum lament
0.0008 | j DragonRealms >hum lament
0.0315 | d DragonRealms | [377] DragonRealms Trigger : terminated
0.1650 | a DragonRealms |
0.0011 | a DragonRealms |You begin to hum a quiet lament with only the slightest hint of difficulty.
-154.2809 | a DragonRealms ]>
5.3376 | a DragonRealms |> exp
0.1678 | j DragonRealms >exp
0.3216 | a DragonRealms |
0.0010 | a DragonRealms |Circle: 14
0.0002 | f DragonRealms |Pattern: ^Circle: (%d)$ : (%1=14)
0.0006 | c DragonRealms |exec : Pattern "^Circle: (%d)$" : #VAR ccircle %1
0.0011 | a DragonRealms |Showing all skills with field experience.
0.0011 | a DragonRealms |
0.0009 | a DragonRealms | SKILL: Rank/Percent towards next rank/Amount learning
-148.7828 | a DragonRealms | Primary Magic: 56 12% concentrating Harness Ability: 54 18% thoughtful
-148.7824 | f DragonRealms |Pattern: Primary Magic:%s(%d) : (%1=56)
0.0006 | c DragonRealms |exec : Pattern "Primary Magic:%s(%d)" : #VAR cprimary %1
0.0002 | f DragonRealms |Pattern: Harness Ability:%s(%d) : (%1=54)
0.1681 | c DragonRealms |exec : Pattern "Harness Ability:%s(%d)" : #VAR charness %1
0.1701 | a DragonRealms | Power Perceive: 41 46% learning Magical Devices: 32 42% learning
-148.7794 | f DragonRealms |Pattern: Power Perceive:%s(%d) : (%1=41)
0.0006 | c DragonRealms |exec : Pattern "Power Perceive:%s(%d)" : #VAR cpower %1
0.0001 | f DragonRealms |Pattern: Magical Devices:%s(%d) : (%1=32)
0.0005 | c DragonRealms |exec : Pattern "Magical Devices:%s(%d)" : #VAR cdevices %1
0.0010 | a DragonRealms | Perception: 71 01% dazed First Aid: 63 85% pondering
-148.7769 | f DragonRealms |Pattern: First Aid:%s(%d) : (%1=63)
0.0005 | c DragonRealms |exec : Pattern "First Aid:%s(%d)" : #VAR cfirstaid %1
0.0001 | f DragonRealms |Pattern: Perception:%s(%d) : (%1=71)
0.0005 | c DragonRealms |exec : Pattern "Perception:%s(%d)" : #VAR cperception %1
0.0011 | a DragonRealms | Scholarship: 74 18% learning Appraisal: 75 01% mind lock
-148.9432 | f DragonRealms |Pattern: Appraisal:%s(%d) : (%1=75)
0.0005 | c DragonRealms |exec : Pattern "Appraisal:%s(%d)" : #VAR cappraisal %1
0.0001 | f DragonRealms |Pattern: Scholarship:%s(%d) : (%1=74)
0.0005 | c DragonRealms |exec : Pattern "Scholarship:%s(%d)" : #VAR cscholar %1
0.0011 | a DragonRealms | Vocals: 84 07% bewildering
0.0003 | f DragonRealms |Pattern: Vocals:%s(%d) : (%1=84)
0.0005 | c DragonRealms |exec : Pattern "Vocals:%s(%d)" : #VAR cvocals %1
0.0010 | a DragonRealms |
0.0015 | a DragonRealms |Total Ranks Displayed: 550
0.0011 | a DragonRealms |Time Development Points: 18 Favors: 7 Deaths: 0
0.0011 | a DragonRealms |Overall state of mind: clear
0.0010 | a DragonRealms |EXP HELP for more information
0.0017 | a DragonRealms ]>
9.6074 | a DragonRealms |>
0.0052 | a DragonRealms |You continue to hum your song.
0.1669 | a DragonRealms |
0.0017 | a DragonRealms ]>
16.184 | a DragonRealms |>
0.0011 | a DragonRealms |You continue to hum a quiet lament with only the slightest hint of difficulty. |
So that worked, but I was wondering about that lost command. Since I noticed that having some queue lines in a row forced the line out the other times, I did a zarmor off like I did before. (The code for zarmor is in an earlier post.) Maybe...
Code: |
-123.2978 | a DragonRealms |
0.1667 | a DragonRealms ]>
14.144 | ---
0.1684 | c DragonRealms |[222] DragonRealms Comline : start :
0.0008 | d DragonRealms | [222] DragonRealms Comline : wait -16134 ms
0.7508 | e DragonRealms | [222] DragonRealms Comline : resumed
0.0021 | e DragonRealms | [222] DragonRealms Comline : resumed
0.0027 | a DragonRealms |> remove my leathers
0.0008 | j DragonRealms >remove my leathers
0.4418 | a DragonRealms |
0.0010 | a DragonRealms |You work your way out of some ebon-hued leathers.
0.0014 | a DragonRealms ]>
0.3075 | e DragonRealms | [222] DragonRealms Comline : resumed
0.0023 | e DragonRealms | [222] DragonRealms Comline : resumed
0.1719 | a DragonRealms |> stop hum
0.0008 | j DragonRealms >stop hum
0.1644 | a DragonRealms |
0.0011 | a DragonRealms |You stop playing your song.
0.0021 | a DragonRealms ]>
0.6021 | e DragonRealms | [222] DragonRealms Comline : resumed
0.0027 | e DragonRealms | [222] DragonRealms Comline : resumed
0.0028 | a DragonRealms |> get my balls
0.0008 | j DragonRealms >get my balls
0.0444 | a DragonRealms |
0.0011 | a DragonRealms |You get a set of colorful balls from inside your satin cloak. |
Aha! My lost balls! (No laughing!) I had written down that queue get my @jugglies was lost from before, so that checks out. But what about queue hum @vocplay?
Code: |
0.0019 | a DragonRealms ]>
0.5359 | e DragonRealms | [222] DragonRealms Comline : resumed
0.0023 | e DragonRealms | [222] DragonRealms Comline : resumed
0.0028 | a DragonRealms |> hum wedding
0.0008 | j DragonRealms >hum wedding
0.1724 | d DragonRealms | [222] DragonRealms Comline : terminated
0.2023 | a DragonRealms |
0.0011 | a DragonRealms |You fumble slightly as you begin to hum a quiet wedding march.
-106.0605 | a DragonRealms ]> |
There it goes.
And emptyqueue ceases to actually empty anything, like it always does at this point.
I make note of everything and finally enter emptyqueue manually, which wraps things up. None of the following may be important, I just included it in case.
Code: |
14.734 | a DragonRealms |>
0.0074 | a DragonRealms |You continue to hum your song.
0.1667 | a DragonRealms |
0.0020 | a DragonRealms ]>
10.478 | e DragonRealms |[372] DragonRealms Trigger : resumed
0.1730 | d DragonRealms |[372] DragonRealms Trigger : terminated
5.7451 | a DragonRealms |>
0.0023 | a DragonRealms |You continue to fumble slightly as you hum a quiet wedding march.
-75.0815 | a DragonRealms |
0.0032 | a DragonRealms ]>
15.746 | a DragonRealms |>
0.0085 | a DragonRealms |You continue to hum your song.
0.0025 | a DragonRealms |
0.1659 | a DragonRealms ]>
16.008 | a DragonRealms |>
0.0017 | a DragonRealms |You continue to fumble slightly as you hum a quiet wedding march.
-43.4742 | a DragonRealms |
0.0018 | a DragonRealms ]>
16.140 | a DragonRealms |>
0.0012 | a DragonRealms |You continue to hum your song.
0.0015 | a DragonRealms |
0.0018 | a DragonRealms ]>
15.990 | a DragonRealms |>
0.0083 | a DragonRealms |You continue to fumble slightly as you hum a quiet wedding march.
-11.4955 | a DragonRealms |
0.0019 | a DragonRealms ]>
16.155 | a DragonRealms |>
0.0011 | a DragonRealms |You continue to hum your song.
0.0021 | a DragonRealms |
0.0018 | a DragonRealms ]>
15.809 | a DragonRealms |>
0.1748 | a DragonRealms |You finish humming a quiet wedding march.
0.0006 | f DragonRealms |Pattern: You finish humming [^\n]*.$
0.0006 | c DragonRealms |[378] DragonRealms Trigger : start : Pattern "You finish humming [^\n]*.$" : queue exp skill v...
0.1684 | d DragonRealms |[378] DragonRealms Trigger : stopped
0.0018 | a DragonRealms |
0.0005 | f DragonRealms |Pattern: You finish humming [^\n]*.$
0.0006 | c DragonRealms |[378] DragonRealms Trigger : start : Pattern "You finish humming [^\n]*.$" : queue exp skill v...
0.0006 | d DragonRealms |[378] DragonRealms Trigger : stopped
0.1722 | a DragonRealms ]>
81.901 | a DragonRealms |>
0.0011 | a DragonRealms | * Nilerbone was just struck down!
0.0018 | a DragonRealms ]>
43.787 | ---
0.0006 | c DragonRealms |[379] DragonRealms Comline : start :
0.1700 | d DragonRealms | [379] DragonRealms Comline : wait -16321 ms
0.7513 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0018 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0014 | a DragonRealms |> put my leathers in my backpack
0.1678 | j DragonRealms >put my leathers in my backpack
0.2365 | a DragonRealms |
0.0009 | a DragonRealms |You put your leathers in your spidersilk backpack.
0.0014 | a DragonRealms ]>
0.6823 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0018 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0013 | a DragonRealms |> remove my gloves
0.0011 | j DragonRealms >remove my gloves
0.1989 | a DragonRealms |
0.0010 | a DragonRealms |You pull off some ebon-hued gloves from your hands.
0.0014 | a DragonRealms ]>
0.3817 | e DragonRealms | [379] DragonRealms Comline : resumed
0.1712 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0014 | a DragonRealms |> put my gloves in my backpack
0.0011 | j DragonRealms >put my gloves in my backpack
0.2066 | a DragonRealms |
0.1681 | a DragonRealms |You put your gloves in your spidersilk backpack.
0.0016 | a DragonRealms ]>
0.7120 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0018 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0013 | a DragonRealms |> remove my cowl
0.0010 | j DragonRealms >remove my cowl
0.2492 | a DragonRealms |
0.0009 | a DragonRealms |You take an ebon-hued cowl off your head.
0.0014 | a DragonRealms ]>
0.3316 | e DragonRealms | [379] DragonRealms Comline : resumed
0.1712 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0014 | a DragonRealms |> put my cowl in my backpack
0.0010 | j DragonRealms >put my cowl in my backpack
0.2103 | a DragonRealms |
0.0009 | a DragonRealms |You put your cowl in your spidersilk backpack.
0.0014 | a DragonRealms ]>
0.5395 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0018 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0014 | a DragonRealms |> exp skill appraisal
0.0009 | j DragonRealms >exp skill appraisal
0.1920 | a DragonRealms |
0.0010 | a DragonRealms |Showing Appraisal experience:
0.0010 | a DragonRealms |
0.0009 | a DragonRealms | SKILL: Rank/Percent towards next rank/Amount learning
0.0010 | a DragonRealms | Appraisal: 75 08.26% perplexing
0.0003 | f DragonRealms | Pattern: Appraisal:%s(%d) : (%1=75)
0.0006 | c DragonRealms | exec : Pattern "Appraisal:%s(%d)" : #VAR cappraisal %1
0.0004 | f DragonRealms | Pattern: Appraisal:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtf...
0.0002 | c DragonRealms | [378] DragonRealms Trigger : start : Pattern "appmind2" : queue appraise my bundle #WAIT 30000...
0.0005 | d DragonRealms | [378] DragonRealms Trigger : wait 12934 ms
0.0015 | a DragonRealms |
0.0012 | a DragonRealms |Time Development Points: 18 Favors: 7 Deaths: 0
0.0013 | a DragonRealms |Overall state of mind: clear
0.0010 | a DragonRealms |EXP HELP for more information
0.0017 | a DragonRealms ]>
0.3769 | e DragonRealms | [379] DragonRealms Comline : resumed
0.1712 | e DragonRealms | [379] DragonRealms Comline : resumed
0.0013 | a DragonRealms |> exp skill vocals
0.0010 | j DragonRealms >exp skill vocals
0.2548 | a DragonRealms |
0.0009 | a DragonRealms |Showing Vocals experience:
0.0009 | a DragonRealms |
0.0012 | a DragonRealms | SKILL: Rank/Percent towards next rank/Amount learning
0.0011 | a DragonRealms | Vocals: 84 14.23% perplexed
0.0003 | f DragonRealms | Pattern: Vocals:%s(%d) : (%1=84)
0.0006 | c DragonRealms | exec : Pattern "Vocals:%s(%d)" : #VAR cvocals %1
0.0004 | f DragonRealms | Pattern: Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|...
0.0006 | c DragonRealms | [380] DragonRealms Trigger : start : Pattern "vocmind2" : queue hum @vocplay
0.0009 | d DragonRealms | [380] DragonRealms Trigger : stopped
0.0015 | a DragonRealms |
0.1707 | a DragonRealms |Time Development Points: 18 Favors: 7 Deaths: 0
0.0014 | a DragonRealms |Overall state of mind: clear
0.1681 | a DragonRealms |EXP HELP for more information
0.1712 | a DragonRealms ]>
0.4818 | e DragonRealms | [379] DragonRealms Comline : resumed
0.1673 | e DragonRealms | [379] DragonRealms Comline : resumed
0.1707 | a DragonRealms |> appraise my bundle
0.1682 | j DragonRealms >appraise my bundle
0.3534 | a DragonRealms |
0.0011 | a DragonRealms |It appears that the lumpy bundle can be slung over one shoulder.
0.0010 | a DragonRealms |The lumpy bundle feels quite heavy.
0.1854 | a DragonRealms |You scan through the skins in the lumpy bundle and finally decide that they're worth a total of about 819 Dokoras.
0.0016 | a DragonRealms |Roundtime: 8 seconds.
0.0001 | f DragonRealms | Pattern: Roundtime(?:\:)?\s+(\d(?:\d)*) : (%1=8)
0.0006 | c DragonRealms | [380] DragonRealms Trigger : start : Pattern "Roundtime(?:\:)?\s+(\d(?:\d)*)" : #VAR tmax %1 #...
0.0008 | a DragonRealms |
0.0010 | a DragonRealms |T IS SET.
0.0001 | f DragonRealms | Pattern: T IS SET.
0.0005 | c DragonRealms | exec : Pattern "T IS SET." : #COLOR black
0.0008 | d DragonRealms | [380] DragonRealms Trigger : wait -16077 ms
0.3741 | e DragonRealms | [379] DragonRealms Comline : resumed
0.4575 | e DragonRealms | [380] DragonRealms Trigger : resumed
1.0019 | e DragonRealms | [380] DragonRealms Trigger : resumed
1.0031 | e DragonRealms | [380] DragonRealms Trigger : resumed
1.0016 | e DragonRealms | [380] DragonRealms Trigger : resumed
1.0019 | e DragonRealms | [380] DragonRealms Trigger : resumed
1.0034 | e DragonRealms | [380] DragonRealms Trigger : resumed
1.0022 | e DragonRealms | [380] DragonRealms Trigger : resumed
1.1713 | e DragonRealms | [380] DragonRealms Trigger : resumed
0.0068 | d DragonRealms | [380] DragonRealms Trigger : terminated
0.1820 | e DragonRealms | [379] DragonRealms Comline : resumed
0.1729 | a DragonRealms |> hum lament
0.0009 | j DragonRealms >hum lament
0.0011 | d DragonRealms | [379] DragonRealms Comline : terminated
0.0391 | a DragonRealms |
0.1706 | a DragonRealms |You begin to hum a quiet lament with only the slightest hint of difficulty. |
Once I lose a command I can replicate the whole mess, so if you need more information let me know. I noticed that I lose the queue get my @juggles command a lot, so I can probably even force myself to lose a command. |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Sun Aug 31, 2008 10:10 pm |
I noticed another weird thing happening.
The variable @rtqueue is in this class: ./universal/commandqueue_handler
Sometimes, for some reason, it creates a @rtqueue in the root directory, or even in another window. ./universal/commandqueue_handler is never disabled at any time. I noticed this happening a few times as I was testing the jab/kick script.
Interesting to note is that when this happens, sometimes I will lose a command to the new @rtqueue variable; it usually only gets sent the one thing and CMUD keeps using the @rtqueue in the class folder like it's supposed to. Sometimes it's just empty, though. Also, this will screw up the emptyqueue alias so it quits emptying properly.
However, I don't think this is what was happening to commands earlier. The reason I noticed this today is because when the root directory @rtqueue is created, my status monitor that shows me the contents of the string showed nothing but commands were still being sent to the game. In other words, the status monitor reflected the root directly @rtqueue where nothing was happening, and meanwhile the commands were going through the class directory @rtqueue which the status monitor no longer showed.
This is actually not the first time I've noticed unnecessary duplicate variables being created in the root directory or other windows while its class was enabled. It's probably happened to me most sessions. I did notice that when I put all my scripts into separate classes early on, this seemed to cause even more problems. |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Mon Sep 01, 2008 12:08 am |
Another setback... zvocals just completely quit functioning properly. Whenever it gets a fumble message it freaks out and doesn't do the subtraction properly. I went into the trigger and added #ECHO lines to display the value of @vocdiff.
It's not set to trigger more than once off the same line, but each echo is shown twice so it must be triggering twice. Also, after adding the #ECHOs it changed how the triggers work... the subtraction started working, but it's subtracting two at a time instead of one since the trigger is triggering twice for some reason.
This is the sort of thing that happened to me before when everything was all messed up, so I thought maybe I'd somehow corrupted my session again. I tried exporting to XML, deleting the session and its files, and importing again, but it does the same thing.
Well, almost. The first time I ran it, the triggers fired but did not even show the #ECHOs. I have no idea why not. I tried running it a second time and it showed the #ECHOs and was just as messed up as before.
I'm going to see if I can fix it but I'm not really sure what to do at this point. :-/ |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Mon Sep 01, 2008 1:10 am |
I put nothing but the queue handling stuff and the zvocals stuff in a test session and toyed with it until I got it working. I'm going to slowly start adding things in and go from there.
|
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Mon Sep 01, 2008 4:43 am |
Okay, this is just weird. Like I said, zvocals went wonky -- it was not adding and subtracting like it should -- so I made a test session with only the vocals class and the classes that handle the queue. I got it working by making a few edits to some triggers in the vocals class.
I export the vocals class to XML, open my normal session, and import the vocals class from XML and get rid of the old one. I test it. It doesn't work.
So I figure I might have a problem with my normal session. I open the test session to double-check first, though.
It doesn't work anymore. And not only that, now that I just tried again -- after having opened and closed the program a few times since the time it just didn't work -- I get a pop-up error as soon as I execute the alias. To clarify, this is the test session that has barely anything in it that is giving me a pop-up error.
That tends to happen to me a lot. I think I mentioned this in one of the earlier posts, but I will set up a new alias and some triggers and they'll work great during the session in which I created them. Then, next time I open CMUD, they go all screwy.
I'm not entirely sure what to make of this. I wonder if something in the queue handler code causes things to get stuck in weird places; something weird definitely seems to be going on there, and the zvocals stuff seems straightforward. |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Mon Sep 01, 2008 5:23 am |
Alright, here is a big report on what I did with my test session and zvocals. Either the queue or zvocals is slowly corrupting the session. I can replicate some of the stuff to a point, but I'm still trying to figure out how to get it to the point of pop-up errors.
Step 1: CMUD is closed. I delete my test session's folder in the My Games/CMUD folder.
Step 2: I open CMUD and connect to the test session.
Step 3: I import the vocals class and the commandqueue_handler class from XML. (Note: there is another class that handles the @t variable. However, I got these same errors without it, and since the zvocals class actions don't incur any wait times from the game, I did not import the class that handles the @t variable in subsequent tests just to be sure it wasn't causing the problem.)
Code for these as is follows:
commandqueue_handler class:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="commandqueue_handler" copy="yes">
<alias name="queue" copy="yes">
<value>#SECTION QQ {#ADDITEM rtqueue %-1}
#IF ((%item(@rtqueue, 2))=="") {emptyqueue}</value>
</alias>
<alias name="emptyqueue" copy="yes">
<value>#WAIT 750
#WAIT @t*1000
#SEND %item(@rtqueue, 1)
#SECTION QQ {#VARIABLE rtqueue {%delitem(%item(@rtqueue, 1), @rtqueue)}}
#IF (@rtqueue!="") {emptyqueue}</value>
</alias>
<var name="rtqueue" type="Literal" copy="yes"/>
<stat name="InTheQueue" priority="33470" copy="yes">
<value>In the queue: @rtqueue</value>
</stat>
</class>
</cmud>
|
vocals class:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="vocals" copy="yes">
<alias name="zvocals" copy="yes">
<value>queue stop hum
#IF (%1=="") {#T+ VocTriggers
#IF (@vocdiff<1) {#VAR vocdiff 1}
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay
}
#IF (%1=="end") {#T- VocMind; #T- VocTriggers}</value>
</alias>
<var name="vocdiff" copy="yes">10</var>
<var name="vocplay" copy="yes">lament</var>
<class name="VocTriggers" copy="yes">
<trigger name="vocmessage3" priority="30360" copy="yes">
<pattern>You begin to hum %w %w %w.$</pattern>
<value>#ADD vocdiff 1
queue stop hum</value>
</trigger>
<trigger name="vocmessage1" priority="30370" regex="true" copy="yes">
<pattern>You effortlessly begin to hum [^\n]*, your heart swelling in pride at your hard-earned skill\.$</pattern>
<value>#ADD vocdiff 1
queue stop hum</value>
</trigger>
<trigger name="vocmessage2" priority="30380" regex="true" copy="yes">
<pattern>You begin to hum [^\n]*, your skill in your craft showcased in every note\.$</pattern>
<value>#ADD vocdiff 1
queue stop hum</value>
</trigger>
<trigger name="vocmessage6" priority="30390" regex="true" copy="yes">
<pattern>You begin to hum [^\n]* with only the slightest hint of difficulty\.$</pattern>
<value>#ADD vocdiff 1
queue stop hum</value>
</trigger>
<trigger name="vocmessage4" priority="30400" regex="true" copy="yes">
<pattern>You fumble slightly as you begin to hum [^\n]*\.$</pattern>
<value>#ADD vocdiff -1
queue stop hum</value>
</trigger>
<trigger name="vocmessage5" priority="30410" regex="true" copy="yes">
<pattern>You struggle to begin to hum [^\n]*\.$</pattern>
<value>#ADD vocdiff -1
queue stop hum</value>
</trigger>
<trigger name="vocmessage7" priority="30390" regex="true" copy="yes">
<pattern>You begin to hum [^\n]* with only the slightest hint of difficulty\.$</pattern>
<trigger trigontrig="false" regex="true">
<pattern>You fumble slightly as you begin to hum [^\n]*\.$</pattern>
<value>#ADD vocdiff -1
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue stop hum
#T+ VocMind
queue exp skill vocals
#T- VocTriggers</value>
</trigger>
</trigger>
<trigger priority="5850" copy="yes">
<pattern>You stop playing your song.$</pattern>
<value>#VAR vocplay %db(@playdifficulty,@vocdiff)
queue hum @vocplay</value>
</trigger>
</class>
<class name="VocMind" copy="yes">
<trigger name="vocmind1" priority="30450" regex="true" copy="yes">
<pattern>Vocals:\s+\d+\s+\d+\.\d+%\s+(?:dazed|mind lock)</pattern>
<value>queue stop hum
#WAIT 120000
queue exp skill vocals</value>
</trigger>
<trigger name="vocmind2" priority="30480" regex="true" copy="yes">
<pattern>Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|pondering|concentrating|muddled|perplex|bewilder|very)</pattern>
<value>queue hum @vocplay</value>
</trigger>
<trigger priority="30550" regex="true" copy="yes">
<pattern>You finish humming [^\n]*\.$</pattern>
<value>queue exp skill vocals</value>
</trigger>
<trigger priority="5190" copy="yes">
<pattern>You've gained a new rank in vocal instruments.</pattern>
<value>zvocals</value>
</trigger>
</class>
<var name="playdifficulty" type="Record" copy="yes">30=aria|31=sonata|32=concerto|10=lament|11=wedding|12=hymn|13=rumba|14=polka|15=battle|16=reel|17=elegy|18=serenade|19=minuet|1=scales|2=arpeggio|3=ditty|4=folk|5=ballad|6=waltz|7=lullaby|8=march|9=jig|20=psalm|21=dirge|22=gavotte|23=tango|24=tarantella|25=bolero|26=nocturne|27=requiem|28=fantasia|29=rondo</var>
</class>
</cmud>
|
Step 4: I execute the zvocals alias from the command line. I did a #THREAD before and after. It works perfectly. Here is the script debugger of all of that:
Code: |
|
0.0008 | c Test | [1] Test Comline : start :
0.0014 | a Test |> Threads:
0.0010 | a Test | # ID Window Name Status Script
0.0007 | a Test | -------------------------------------------------------------------------------------------------
0.0007 | a Test | 1 [u] Test running
0.0006 | d Test | [1] Test Comline : stopped
3.7980 | a Test ]>
2.7635 | ---
0.0004 | c Test | [1] Test Comline : start :
0.0034 | d Test | [1] Test Comline : wait 362 ms
0.7593 | e Test | [1] Test Comline : resumed
0.0155 | e Test | [1] Test Comline : resumed
0.0013 | a Test |> stop hum
0.0007 | j Test >stop hum
0.2422 | a Test |
0.0027 | a Test |In the name of love?
0.0009 | a Test ]>
0.5176 | e Test | [1] Test Comline : resumed
0.0155 | e Test | [1] Test Comline : resumed
0.0010 | a Test |> hum lament
0.0007 | j Test >hum lament
0.0012 | d Test | [1] Test Comline : terminated
0.2024 | a Test |
0.0006 | a Test |You begin to hum a quiet lament with only the slightest hint of difficulty.
0.0004 | f Test | Pattern: You begin to hum [^\n]* with only the slightest hint of d...
0.0002 | f Test | Pattern: You begin to hum [^\n]* with only the slightest hint of d...
0.0004 | c Test | exec : Pattern "vocmessage6" : #ADD vocdiff 1queue stop hum
0.0106 | a Test ]>
0.7342 | a Test |> stop hum
0.0005 | j Test >stop hum
0.1809 | a Test |
0.0009 | a Test |You stop playing your song.
0.0002 | f Test | Pattern: You stop playing your song.$
0.0011 | c Test | exec : Pattern "You stop playing your song.$" : #VAR vocplay %db...
0.0043 | a Test ]>
0.4058 | a Test |>
0.0005 | a Test | * Savvis was just struck down!
0.0011 | a Test ]>
0.3243 | a Test |> hum wedding
0.0004 | j Test >hum wedding
0.2323 | a Test |
0.0005 | a Test |You fumble slightly as you begin to hum a quiet wedding march.
0.0004 | f Test | Pattern: You fumble slightly as you begin to hum [^\n]*\.$
0.0013 | c Test | exec : Pattern "You fumble slightly as you begin to hum [^\n]*\....
0.0142 | a Test ]>
0.7365 | a Test |> stop hum
0.0004 | j Test >stop hum
0.2182 | a Test |
0.0004 | a Test |You stop playing your song.
0.0013 | a Test ]>
0.5296 | a Test |> exp skill vocals
0.0004 | j Test >exp skill vocals
0.3730 | a Test |
0.0005 | a Test |Showing Vocals experience:
0.0004 | a Test |
0.0004 | a Test | SKILL: Rank/Percent towards next rank/Amount learning
0.0004 | a Test | Vocals: 85 66.06% thoughtful
0.0001 | f Test | Pattern: Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|...
0.0005 | c Test | exec : Pattern "vocmind2" : queue hum @vocplay
0.0108 | a Test |
0.0005 | a Test |Time Development Points: 21 Favors: 7 Deaths: 0
0.0004 | a Test |Overall state of mind: clear
0.0004 | a Test |EXP HELP for more information
0.0011 | a Test ]>
0.7344 | a Test |> hum lament
0.0003 | j Test >hum lament
0.2129 | a Test |
0.0005 | a Test |You begin to hum a quiet lament with only the slightest hint of difficulty.
0.0008 | a Test ]>
4.4740 | ---
0.0005 | c Test | [2] Test Comline : start :
0.0012 | a Test |> Threads:
0.0018 | a Test | # ID Window Name Status Script
0.0015 | a Test | -------------------------------------------------------------------------------------------------
0.0016 | a Test | 2 [u] Test running
0.0014 | d Test | [2] Test Comline : stopped
3.8883 | --- |
And here I do a zvocals end, then a #THREAD. Works fine.
Code: |
0.0003 | c Test | [2] Test Comline : start :
0.0006 | d Test | [2] Test Comline : wait 362 ms
0.7550 | e Test | [2] Test Comline : resumed
0.0180 | e Test | [2] Test Comline : resumed
0.0010 | a Test |stop hum
0.0014 | j Test >stop hum
0.0015 | d Test | [2] Test Comline : terminated
0.1783 | a Test |
0.0005 | a Test |You stop playing your song.
0.0014 | a Test ]>
5.1931 | ---
0.0005 | c Test | [3] Test Comline : start :
0.0012 | a Test |> Threads:
0.0018 | a Test | # ID Window Name Status Script
0.0016 | a Test | -------------------------------------------------------------------------------------------------
0.0016 | a Test | 3 [u] Test running
0.0014 | d Test | [3] Test Comline : stopped
4.2422 | a Test ]>
|
Step 5: I do the same thing one more time, to make sure it still works. Exact same results.
Step 6: I disconnect from the game. I chose the "quit CMUD" option. CMUD closes. I open CMUD. I connect to the Test session. I do a zvocals with very different results:
Code: |
| ---
0.0008 | c Test | [1] Test Comline : start :
0.0012 | a Test |> Threads:
0.0010 | a Test | # ID Window Name Status Script
0.0007 | a Test | -------------------------------------------------------------------------------------------------
0.0007 | a Test | 1 [u] Test running
0.0006 | d Test | [1] Test Comline : stopped
1.5525 | a Test |
0.0006 | a Test |******************************************************
0.0009 | a Test |*** Please check for new or updated items in NEWS! ***
0.0006 | a Test |******************************************************
0.0012 | a Test |
0.0011 | a Test ]>
1.7406 | ---
0.0004 | c Test | [1] Test Comline : start :
0.0036 | d Test | [1] Test Comline : wait 342 ms
0.7514 | e Test | [1] Test Comline : resumed
0.0154 | e Test | [1] Test Comline : resumed
0.0011 | a Test |> stop hum
0.0007 | j Test >stop hum
0.1971 | a Test |
0.0028 | a Test |In the name of love?
0.0009 | a Test ]>
0.5628 | e Test | [1] Test Comline : resumed
0.0155 | e Test | [1] Test Comline : resumed
0.0009 | a Test |> hum lament
0.0007 | j Test >hum lament
0.0011 | d Test | [1] Test Comline : terminated
0.1942 | a Test |
0.0006 | a Test |You begin to hum a quiet lament with only the slightest hint of difficulty.
0.0004 | f Test | Pattern: You begin to hum [^\n]* with only the slightest hint of d...
0.0002 | f Test | Pattern: You begin to hum [^\n]* with only the slightest hint of d...
0.0008 | c Test | [2] Test Trigger : start : Pattern "vocmessage6" : #ADD vocdiff 1 queue stop hum
0.0013 | d Test | [2] Test Trigger : wait 342 ms
0.0011 | a Test ]>
0.7497 | e Test | [2] Test Trigger : resumed
0.0155 | e Test | [2] Test Trigger : resumed
0.0009 | a Test |> stop hum
0.0007 | j Test >stop hum
0.0012 | d Test | [2] Test Trigger : terminated
0.1983 | a Test |
0.0008 | a Test |You stop playing your song.
0.0001 | f Test | Pattern: You stop playing your song.$
0.0014 | c Test | [3] Test Trigger : start : Pattern "You stop playing your song.$" : #VAR vocplay %db...
0.0035 | d Test | [3] Test Trigger : wait 331 ms
0.0017 | a Test ]>
0.7571 | e Test | [3] Test Trigger : resumed
0.0180 | e Test | [3] Test Trigger : resumed
0.0011 | a Test |> hum wedding
0.0007 | j Test >hum wedding
0.0007 | d Test | [3] Test Trigger : terminated
0.2355 | a Test |
0.0005 | a Test |You fumble slightly as you begin to hum a quiet wedding march.
0.0004 | f Test | Pattern: You fumble slightly as you begin to hum [^\n]*\.$
0.0017 | c Test | [4] Test Trigger : start : Pattern "You fumble slightly as you begin to hum [^\n]*\....
0.0012 | d Test | [4] Test Trigger : wait 335 ms
0.0002 | f Test | Pattern: You fumble slightly as you begin to hum [^\n]*\.$
0.0008 | c Test | [5] Test Trigger : start : Pattern "vocmessage4" : #ADD vocdiff -1 queue stop hum
0.0008 | d Test | [5] Test Trigger : wait 338 ms
0.0010 | a Test ]>
0.7588 | e Test | [5] Test Trigger : resumed
0.0002 | e Test | [4] Test Trigger : resumed
0.0153 | e Test | [5] Test Trigger : resumed
0.0000 | e Test | [4] Test Trigger : resumed
0.0009 | a Test |> stop hum
0.0007 | j Test >stop hum
0.0008 | a Test |stop hum
0.0006 | j Test >stop hum
0.0011 | d Test | [5] Test Trigger : terminated
0.2356 | a Test |
0.0018 | a Test |You stop playing your song.
0.0001 | f Test | Pattern: You stop playing your song.$
0.0009 | c Test | [6] Test Trigger : start : Pattern "You stop playing your song.$" : #VAR vocplay %db...
0.0011 | d Test | [6] Test Trigger : stopped
0.0017 | a Test ]>
0.2383 | a Test |>
0.0005 | a Test |In the name of love?
0.0008 | a Test ]>
0.2800 | e Test | [4] Test Trigger : resumed
0.0179 | e Test | [4] Test Trigger : resumed
0.0010 | a Test |> exp skill vocals
0.0007 | j Test >exp skill vocals
0.1907 | a Test |
0.0005 | a Test |Showing Vocals experience:
0.0004 | a Test |
0.0004 | a Test | SKILL: Rank/Percent towards next rank/Amount learning
0.0004 | a Test | Vocals: 85 66.54% thoughtful
0.0002 | f Test | Pattern: Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|...
0.0005 | c Test | [6] Test Trigger : start : Pattern "vocmind2" : queue hum @vocplay
0.0005 | d Test | [6] Test Trigger : wait 336 ms
0.0009 | a Test |
0.0005 | a Test |Time Development Points: 21 Favors: 7 Deaths: 0
0.0005 | a Test |Overall state of mind: clear
0.0004 | a Test |EXP HELP for more information
0.0011 | a Test ]>
0.5655 | e Test | [4] Test Trigger : resumed
0.0154 | e Test | [4] Test Trigger : resumed
0.0011 | a Test |> hum jig
0.0008 | j Test >hum jig
0.0015 | d Test | [4] Test Trigger : terminated
0.1684 | e Test | [6] Test Trigger : resumed
0.0155 | e Test | [6] Test Trigger : resumed
0.0008 | a Test |
0.0003 | j Test >
0.0010 | d Test | [6] Test Trigger : terminated
0.2062 | a Test |
0.0005 | a Test |You begin to hum a spritely jig with only the slightest hint of difficulty.
0.0008 | a Test ]>
6.4539 | ---
0.0005 | c Test | [7] Test Comline : start :
0.0012 | a Test |> Threads:
0.0018 | a Test | # ID Window Name Status Script
0.0015 | a Test | -------------------------------------------------------------------------------------------------
0.0017 | a Test | 7 [u] Test running
0.0014 | d Test | [7] Test Comline : stopped
1.9746 | --- |
The second state of the single multistate trigger is set so that other triggers cannot trigger while it is triggering. Yet here the other trigger has done exactly that, on the part where I fumble the wedding song. Furthermore, this is completely different behavior from the previous session in which I first imported the XML, though I have changed nothing whatsoever about the code. When the program closes, or else when it opens, something weird happens. I don't know what though, or what in my code causes that.
I do a zvocals end without incident.
Code: |
0.0003 | c Test | [7] Test Comline : start :
0.0006 | d Test | [7] Test Comline : wait 335 ms
0.7566 | e Test | [7] Test Comline : resumed
0.0156 | e Test | [7] Test Comline : resumed
0.0010 | a Test |stop hum
0.0014 | j Test >stop hum
0.0015 | d Test | [7] Test Comline : terminated
0.1813 | a Test |
0.0005 | a Test |You stop playing your song.
0.0014 | a Test ]> |
For what it's worth, when I import the XML into my normal, non-test session, I get the wonky behavior right off the bat. It functions in my normal session exactly as I have shown it function in step 6 here.
Now, at some point, I get pop-up errors whenever I try to run the zvocals alias in the test session. I have not been able to replicate that yet. Simply closing and opening the program a third, fourth, and fifth time just produced step 6 behavior and no pop-up errors. I had a hunch that maybe to get pop-up errors I needed to close the test session, open my usual session, import the vocals class from XML, run the zvocals alias wonky-mode, then select "close all" which always errors the program and requires that I choose to shut CMUD down, then open CMUD, connect to the test session, and try doing zvocals again -- this is all I could remember having done before I started getting pop-up errors, but I hadn't been keeping track entirely. Anyway, doing this didn't get me the pop-up errors, just more step 6 behavior. If I can replicate the pop up errors I will post again.
Anyway, once I know what is causing things to act differently once the program opens and closes again, I suspect a lot of errors I'm having will go away. I'm glad I've narrowed it down to either the queue or zvocals, although I'm uncertain how to test the queue without using another script... in other words, it's rather difficult to test it by itself. |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Sep 01, 2008 11:38 am |
The first problem I see is with some of your triggers in the VocTrigs class. Specifically the ones regarding fumbling.
Code: |
<trigger name="vocmessage6" priority="30390" regex="true" copy="yes">
<pattern>You begin to hum [^\n]* with only the slightest hint of difficulty\.$</pattern>
<value>#ADD vocdiff 1
queue stop hum</value>
</trigger>
<trigger name="vocmessage4" priority="30400" regex="true" copy="yes">
<pattern>You fumble slightly as you begin to hum [^\n]*\.$</pattern>
<value>#ADD vocdiff -1
queue stop hum</value>
</trigger>
<trigger name="vocmessage7" priority="30390" regex="true" copy="yes">
<pattern>You begin to hum [^\n]* with only the slightest hint of difficulty\.$</pattern>
<trigger trigontrig="false" regex="true">
<pattern>You fumble slightly as you begin to hum [^\n]*\.$</pattern>
<value>#ADD vocdiff -1
#VAR vocplay %db(@playdifficulty,@vocdiff)
queue stop hum
#T+ VocMind
queue exp skill vocals
#T- VocTriggers</value>
</trigger>
</trigger> |
Here we see vocmessage6 and vocmessage7 have the same priority. Both will fire on the initial line. Then vocmessage7 will be stuck in state 1 if the funble message is not received. You have the seperate vocmessage4 trigger that can now also fire on the funble line. In that particular state your variable is now decreased twice and "queue stop hum" occurs twice. This seems to be what caused your strange output during you main session.
If the fumble message can only occur after a 'with difficulty' then you should eliminate vocmessage6 and vocmessage4, change the trigger type for state 1 of vocmessage7 to Within, and consilidate all the commands into that trigger.
If the fumble message can occur after any of the other messages then you should move all the commands from state 1 of vocmessage7 into vocmessage4 and eliminate the entire vocmessage7 trigger.
----
Next I played around with you queue and emptyqueue aliases some and couldn't get them to drop a command. I don't personally like how they are implemented, but it appears that they mostly work for you. The part I don't like about thier implementation is that all usages of the queue force a #WAIT 750, and the queue does not actually queue anything, it just forces the script to wait. A much better implementation would be to have the queue actually queue commands. The queue would need to be told which ones have to wait for a round time, and would send as many commands as it can in a single shot. Finally you make the sending of queued commands run in its own thread that is started when the session is loaded, and all delaying is done on that thread. Triggers or aliases would not delay at all in order to queue commands. Looking back through the code you have posted I don't actually see any aliases that would require a major change inorder to use this implementation.
Your roundtime trigger needs to be totally redesigned in any case. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Tue Sep 02, 2008 12:40 am |
That's weird... I'm not sure why the triggers have the same priority. It also seems strange that it works one way when I first create the triggers, and then works differently once the program is closed and opened again.
I do have a question, though... What exactly does unchecking the "trigger on trigger" option do, then? I seem to have misunderstood it. If you mouse over it, it says that checking it lets other triggers fire while it's firing, so I thought unchecking it would prevent the trigger with the same pattern from firing if that one fires.
Quote: |
If the fumble message can only occur after a 'with difficulty' then you should eliminate vocmessage6 and vocmessage4, change the trigger type for state 1 of vocmessage7 to Within, and consilidate all the commands into that trigger.
If the fumble message can occur after any of the other messages then you should move all the commands from state 1 of vocmessage7 into vocmessage4 and eliminate the entire vocmessage7 trigger. |
Ah, yeah... that's somewhat problematic because it doesn't work out that simply in the game. Basically, to learn the vocals skill the fastest, you want to hum the hardest thing you can that still gives the "with only the slightest hint of difficulty" message. As you gain ranks, song types that were once too hard become a little easier. So it works like this for me right now...
humming a jig gives the the "with only a slightest hint of difficulty" message, but it's still not the hardest thing I can hum.
ditto for humming a march.
humming a lament is the hardest thing I can hum with that message.
Then I get the fumble message for humming a wedding song, and also for the the next couple things in the database variable after wedding. Then after that, I get the "you struggle" message, and so on.
So the problem is I have to be certain that it's getting the most difficult song that I do not fumble, but I have to be sure it doesn't matter whether it's counting up (starting on too easy a song) or counting down (starting on too hard a song). Counting up, that means it must get the slightest hint of difficulty message, then the first time it gets the fumble message it knows to subtract one to get the thing I need to hum. Counting down, that means it must get the fumble message, then keep subtracting one until it gets the slightest hint of difficulty message. To simplify this, the way I (thought I) have it set up now is that when it counts down, the same multistate trigger works as when it counts up... it adds one to get back to the thing it just fumbled and it knows for certain that's the right thing to hum.
If I understand what you're suggesting correctly, neither change would make it do this. For example, I can get the "with only a slightest hint of difficulty" message multiple times in a row and I need them to add to the variable each time, so I can't have that part in a multistate trigger because it will move on to waiting for the next state the first time it gets it. In other words, if I hum a jig it will add one, and I'll hum a march, but it won't add one then because it will be waiting for a fumble message it isn't going to get since the variable is not increasing. The other problem with putting the addition and subtraction in a "within" type trigger is that I can't guarantee how many lines it will take for the line to show up if other scripts are running too, and if it's going through only the one script at the time I can't put a reasonable time-out on the message either -- it might need to be reset so it can change the variable again in less than a second.
The other thing is it does work how it's set up as long as I don't close the program, and this is puzzling to me. I had a flash of insight and determined that the queue handler is doing something to cause the weirdness about opening and closing the program, though; I deleted the queue handler and replaced all the queue commands with #SEND -- since none of the commands in zvocals cause a wait time anyway -- and it works completely, every time, even if I open and close the program. Here's a script debugger of it -- I opened and closed the program multiple times and always got this same result:
Doing a zvocals from the command line:
Code: |
0.0014 | a Test | -------------------------------------------------------------------------------------------------
0.0114 | a Test | 1 [u] Test running
0.0013 | d Test | [1] Test Comline : stopped
4.1124 | a Test ]>
0.0682 | ---
0.0004 | c Test | [1] Test Comline : start :
0.0010 | a Test |> stop hum
0.0013 | j Test >stop hum
0.0113 | a Test |hum lament
0.0016 | j Test >hum lament
0.0004 | d Test | [1] Test Comline : stopped
0.2162 | a Test |
0.0006 | a Test |In the name of love?
0.0009 | a Test ]>
0.2762 | a Test |>
0.0006 | a Test |You begin to hum a quiet lament with only the slightest hint of difficulty.
0.0003 | f Test | Pattern: You begin to hum [^\n]* with only the slightest hint of d...
0.0002 | f Test | Pattern: You begin to hum [^\n]* with only the slightest hint of d...
0.0001 | c Test | exec : Pattern "vocmessage6" : #ADD vocdiff 1 #SEND stop hum
0.0006 | a Test |stop hum
0.0003 | j Test >stop hum
0.0120 | a Test ]>
0.2007 | a Test |>
0.0006 | a Test |You stop playing your song.
0.0002 | f Test | Pattern: You stop playing your song.$
0.0007 | c Test | exec : Pattern "You stop playing your song.$" : #VAR vocplay %db...
0.0007 | a Test |hum wedding
0.0003 | j Test >hum wedding
0.0113 | a Test ]>
0.2559 | a Test |>
0.0006 | a Test |You fumble slightly as you begin to hum a quiet wedding march.
0.0004 | f Test | Pattern: You fumble slightly as you begin to hum [^\n]*\.$
0.0007 | c Test | exec : Pattern "You fumble slightly as you begin to hum [^\n]*\....
0.0006 | a Test |stop hum
0.0003 | j Test >stop hum
0.0122 | a Test |exp skill vocals
0.0003 | j Test >exp skill vocals
0.0011 | a Test ]>
0.2109 | a Test |>
0.0005 | a Test |You stop playing your song.
0.0014 | a Test ]>
0.2521 | a Test |>
0.0005 | a Test |Showing Vocals experience:
0.0004 | a Test |
0.0004 | a Test | SKILL: Rank/Percent towards next rank/Amount learning
0.0005 | a Test | Vocals: 85 69.46% learning
0.0001 | f Test | Pattern: Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|...
0.0005 | c Test | exec : Pattern "vocmind2" : #SEND hum @vocplay
0.0006 | a Test |hum lament
0.0003 | j Test >hum lament
0.0124 | a Test |
0.0005 | a Test |Time Development Points: 21 Favors: 7 Deaths: 0
0.0004 | a Test |Overall state of mind: clear
0.0004 | a Test |EXP HELP for more information
0.0023 | a Test ]>
0.2136 | a Test |>
0.0005 | a Test |You begin to hum a quiet lament with only the slightest hint of difficulty.
0.0008 | a Test ]>
4.0321 | ---
0.0003 | c Test | [1] Test Comline : start :
0.0009 | a Test |> Threads:
0.0016 | a Test | # ID Window Name Status Script
0.0148 | a Test | -------------------------------------------------------------------------------------------------
0.0014 | a Test | 1 [u] Test running
0.0015 | d Test | [1] Test Comline : stopped
3.4262 | --- |
Then a zvocals end from the command line:
Code: |
0.0003 | c Test | [1] Test Comline : start :
0.0011 | a Test |stop hum
0.0011 | j Test >stop hum
0.0007 | d Test | [1] Test Comline : stopped
0.2520 | a Test |
0.0005 | a Test |You stop playing your song.
0.0116 | a Test ]> |
So the problem seems to be the code in the queue is messing things up somehow, and that explains a lot of why I would make scripts that worked fine and went nuts the next time I opened the program.
This post is getting long so I'll ask questions about the queue in a following post... :-) |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Tue Sep 02, 2008 12:59 am |
Quote: |
Next I played around with you queue and emptyqueue aliases some and couldn't get them to drop a command. |
That's strange... it should send a command as long as you type queue whatever. It didn't do that? Oh! Or do you mean you couldn't get it to lose a command? Haha, sorry, I'm not sure which you mean there. I'm guessing the latter, right?
Quote: |
I don't personally like how they are implemented, but it appears that they mostly work for you. The part I don't like about thier implementation is that all usages of the queue force a #WAIT 750, and the queue does not actually queue anything, it just forces the script to wait. |
Oh, I'm so glad you said that because I don't like that either! I kept trying to think of ways to not have to put in that wait time, because on top of having to deal with threading stuff it just gives me artificial lag, but I couldn't come up with anything that works. (The problem was that it could try to empty the queue before the wait time had been read in from the game. :()
Quote: |
A much better implementation would be to have the queue actually queue commands. The queue would need to be told which ones have to wait for a round time, and would send as many commands as it can in a single shot. Finally you make the sending of queued commands run in its own thread that is started when the session is loaded, and all delaying is done on that thread. Triggers or aliases would not delay at all in order to queue commands. Looking back through the code you have posted I don't actually see any aliases that would require a major change inorder to use this implementation. |
You just blew my mind... That sounds perfect, like the holy grail of what I was hoping I could do before, I just didn't realize it's possible to have an actual queue of commands so I went with the stringlist variable. I searched through the documentation when I started out but I was just looking for something along the lines of the word "queue," and looking over it now I'm still missing it. I hate to be a bother but where should I start looking?
I have a few things that I worry will muck that up, though. First, there are a couple of commands that sometimes cause a roundtime and sometimes do not. Off the top of my head, sending "stand" the game usually does not cause a roundtime, but if I'm holding a lot of items it might take me a few seconds to stand up. Would I just need to have a third list of these commands with a time-out of a second or so on them? There are very few commands like this.
Second, the game only allows me to send up to two lines at once. If I send more than that, it tells me sorry but I can't send that many, and they're ignored. Would I be able to work around that?
Third, the commands that always have roundtime I would set up to wait for the roundtime message, right? So there's no chance that the time could not be read in by my trigger and before it tries to send the next command?
Quote: |
Your roundtime trigger needs to be totally redesigned in any case. |
To clarify, because of the #WAIT part, right? I can change it. Would something like the current trigger reading in @t work, and then an #ALARM {+@t} {however I figure out to make it send commands} work?
Thank you so much for the help. It's very kind of you. I'm excited to hear that I can make a better queue... that would make things a lot simpler. :D |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Sep 02, 2008 7:21 pm |
I decided to just write a queueing system for you. 2 command limit, not a problem, variable need for a roundtime will be up to you to handle with triggers.
You really do need to simplify your vocmessage series of triggers. They are the entire cause of things not working right for you. Basically just eliminating the vocmessage7 and its secondary state should fix things. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Tue Sep 02, 2008 7:58 pm |
That's very nice of you to write the queue for me. Thank you!
Quote: |
Basically just eliminating the vocmessage7 and its secondary state should fix things. |
I hate to be difficult, but without the multistate trigger the script would just never end. The multistate trigger is there to determine that I have hit the "with only a slightest hint of difficulty" message and then counted upward to the "fumble" message, regardless of whether I started at a much higher difficulty than the fumble message. The second phase of the trigger is what says, "Okay, we've figured this out now and we can move on," and I cannot consolidate it with any other trigger for the reasons in my first post. If I deleted vocmessage7 it would bounce back and forth between adding and subtracting and never settle on a song. I'm not sure how else to write the script so that it does what it needs to, but I still don't understand what is problematic about the code; when I replace the queues with #SEND, it acts exactly how I would expect it to act even when I close and open the program again. It only doesn't work right when I use queue and then close and open the program.
I'm not sure if you noticed that I posted two posts, but I wouldn't blame you if you didn't see the first one since they're both so long... the first one was about what the vocals script needs to do and why the suggestions would not make sure it does that because the game doesn't make things simple, and it shows the script debugger running the zvocals alias when everything is changed to #SEND instead of queue. Since the second state of the multistate trigger does not allow other triggers to fire while it's triggering, it does what I expect it to, at least when I use #SEND. This is the same way it behaves when I first use queue, too, unless I close and open the program again. To me, the fact that it acts completely differently when I close and open the program only when using the queue, and that the vocals class does everything I meant for it to when there is no queue system and just #SENDs, seems to be evidence that something weird is going on with the queue, not the vocals class... Things are supposed to behave the same whether I created/imported them that session or not, right? (Honest question. If they're not supposed to, then knowing that would be helpful.)
Unless I don't understand what the "Trigger on trigger" option is supposed to do -- which is certainly possible; I checked through the documentation but didn't find a better explanation -- then I don't understand why the vocal triggers are a problem. The way I understand it, since I have "trigger on trigger" unchecked for the second phase of the multistate trigger, the other fumble message should not be triggered when the second phase trigger is. Therefore it should not be subtracting twice, which it doesn't unless I use the queue and open and close the program. If that is not what Trigger on trigger is supposed to do, though, then I don't understand why it ends up doing it during the sessions where I first import the zvocals-with-queue, and during all the zvocals-with-send sessions.
Sorry for all these questions. Thank you for being so patient with me, I appreciate it. |
|
|
 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Tue Sep 02, 2008 11:51 pm |
Just to stick my nose in for a moment.
Trigger on trigger means that it is okay for other triggers to fire on the results of this trigger.
An example.
If I had a trigger that fired on the line.
Jonas says, 'You are an excellent bard my friend.'
When I get this text I use a #show message to display extra text to the screen like so.
#show {This guy is sucking up to you don't listen!}
I would see this on the screen the next time Jonas complements me.
Jonas says, 'You are an excellent bard my friend.'
This guy is sucking up to you don't listen!
If I then had a trigger that fired on 'sucking up to you' with trigger on trigger checked that trigger would also fire.
With trigger on trigger not checked the 'sucking up to you', trigger would NOT fire. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Wed Sep 03, 2008 12:00 am |
Oh, thank you for the explanation. :-)
I'm going to change my triggers slightly, then... On the first phase of the multistate trigger, I'll have it set some variable to one, and the other trigger will only fire if that variable is not one. I'll go see if that works, thanks! |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Wed Sep 03, 2008 12:18 am |
That change works great. I caught another problem with the triggers while I was testing it... I could get this string back from the game: "You fumble slightly as you begin to hum a quiet rumba."
It would trigger both "You fumble slightly as you begin to hum [^\n]*\.$" and "You begin to hum %w %w %w.$" I would add a ^ to the latter trigger except sometimes the game screws up and displays it next to the prompt instead, so I just made that trigger case-sensitive and it works great. :-)
My code for the vocals class is now this:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="vocals" copy="yes">
<alias name="zvocals" copy="yes">
<value>#SEND stop hum
#IF (%1=="") {#T+ VocTriggers
#VAR vocset 0
#IF (@vocdiff<1) {#VAR vocdiff 1}
#VAR vocplay %db(@playdifficulty,@vocdiff)
#SEND hum @vocplay
}
#IF (%1=="end") {#T- VocMind; #T- VocTriggers;#VAR vocset 0}</value>
</alias>
<var name="vocdiff" copy="yes">10</var>
<var name="vocplay" copy="yes">lament</var>
<class name="VocTriggers" copy="yes">
<trigger name="vocmessage3" priority="30360" case="true" copy="yes">
<pattern>You begin to hum %w %w %w.$</pattern>
<value>#ADD vocdiff 1
#SEND stop hum</value>
</trigger>
<trigger name="vocmessage1" priority="30370" regex="true" copy="yes">
<pattern>You effortlessly begin to hum [^\n]*, your heart swelling in pride at your hard-earned skill\.$</pattern>
<value>#ADD vocdiff 1
#SEND stop hum</value>
</trigger>
<trigger name="vocmessage2" priority="30380" regex="true" copy="yes">
<pattern>You begin to hum [^\n]*, your skill in your craft showcased in every note\.$</pattern>
<value>#ADD vocdiff 1
#SEND stop hum</value>
</trigger>
<trigger name="vocmessage6" priority="30390" regex="true" copy="yes">
<pattern>You begin to hum [^\n]* with only the slightest hint of difficulty\.$</pattern>
<value>#ADD vocdiff 1
#SEND stop hum</value>
</trigger>
<trigger name="vocmessage4" priority="30400" regex="true" copy="yes">
<pattern>You fumble slightly as you begin to hum [^\n]*\.$</pattern>
<value>#IF (@vocset=0) {#ADD vocdiff -1;#SEND stop hum}</value>
</trigger>
<trigger name="vocmessage5" priority="30410" regex="true" copy="yes">
<pattern>You struggle to begin to hum [^\n]*\.$</pattern>
<value>#ADD vocdiff -1
#SEND stop hum</value>
</trigger>
<trigger name="vocmessage7" priority="30390" regex="true" copy="yes">
<pattern>You begin to hum [^\n]* with only the slightest hint of difficulty\.$</pattern>
<value>#VAR vocset 1</value>
<trigger regex="true">
<pattern>You fumble slightly as you begin to hum [^\n]*\.$</pattern>
<value>#ADD vocdiff -1
#VAR vocplay %db(@playdifficulty,@vocdiff)
#SEND stop hum
#T+ VocMind
#SEND exp skill vocals
#T- VocTriggers</value>
</trigger>
</trigger>
<trigger priority="5850" copy="yes">
<pattern>You stop playing your song.$</pattern>
<value>#VAR vocplay %db(@playdifficulty,@vocdiff)
#SEND hum @vocplay</value>
</trigger>
</class>
<class name="VocMind" copy="yes">
<trigger name="vocmind1" priority="30450" regex="true" copy="yes">
<pattern>Vocals:\s+\d+\s+\d+\.\d+%\s+(?:dazed|mind lock)</pattern>
<value>#SEND stop hum
#WAIT 120000
#SEND exp skill vocals</value>
</trigger>
<trigger name="vocmind2" priority="30480" regex="true" copy="yes">
<pattern>Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|pondering|concentrating|muddled|perplex|bewilder|very)</pattern>
<value>#SEND hum @vocplay</value>
</trigger>
<trigger priority="30550" regex="true" copy="yes">
<pattern>You finish humming [^\n]*\.$</pattern>
<value>#SEND exp skill vocals</value>
</trigger>
<trigger priority="5190" copy="yes">
<pattern>You've gained a new rank in vocal instruments.</pattern>
<value>zvocals</value>
</trigger>
</class>
<var name="playdifficulty" type="Record" copy="yes">30=aria|31=sonata|32=concerto|10=lament|11=wedding|12=hymn|13=rumba|14=polka|15=battle|16=reel|17=elegy|18=serenade|19=minuet|1=scales|2=arpeggio|3=ditty|4=folk|5=ballad|6=waltz|7=lullaby|8=march|9=jig|20=psalm|21=dirge|22=gavotte|23=tango|24=tarantella|25=bolero|26=nocturne|27=requiem|28=fantasia|29=rondo</var>
<var name="vocset" copy="yes">0</var>
</class>
</cmud>
|
FWIW, I tried putting the queue back in and changing the #SENDs back to queue, and this version works even if I close and open the program again. However, I still want to change my queue because of the evidence that it's what causes some scripts to behave differently if I close and open the program again. |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Wed Sep 03, 2008 12:41 am |
LOL, yeah, something in the queue code definitely makes things weird. I have no problems with #SEND, but when I make everything queue I get weird stuff like this, where a trigger triggers twice off the "You finish humming" line even though it is not set to trigger more than once off the same line, and even though there is only one trigger with that pattern:
Code: |
0.0061 | a Test |You finish humming a quiet lament.
0.0003 | f Test | Pattern: You finish humming [^\n]*\.$
0.0009 | c Test | [31] Test Trigger : start : Pattern "You finish humming [^\n]*\.$" : queue exp skill ...
0.0009 | k Test | [31] Var "rtqueue" changed from "" to "exp skill vocals"
0.0003 | d Test | [31] Test Trigger : wait -7867 ms
0.0009 | a Test |
0.0002 | f Test | Pattern: You finish humming [^\n]*\.$
0.0009 | c Test | [32] Test Trigger : start : Pattern "You finish humming [^\n]*\.$" : queue exp skill ...
0.0007 | d Test | [32] Test Trigger : wait -7864 ms
0.0024 | a Test ]>
0.7557 | e Test | [31] Test Trigger : resumed
0.0002 | e Test | [32] Test Trigger : resumed
0.0152 | e Test | [32] Test Trigger : resumed
0.0001 | e Test | [31] Test Trigger : resumed
0.0007 | a Test |> exp skill vocals
0.0005 | j Test >exp skill vocals
0.0012 | a Test |exp skill vocals
0.0005 | j Test >exp skill vocals
0.0003 | d Test | [32] Test Trigger : terminated
0.0011 | d Test | [31] Test Trigger : terminated
0.1348 | a Test |
0.0007 | a Test |Showing Vocals experience:
0.0285 | a Test |
0.0006 | a Test | SKILL: Rank/Percent towards next rank/Amount learning
0.0005 | a Test | Vocals: 85 80.70% mind lock
0.0002 | f Test | Pattern: Vocals:\s+\d+\s+\d+\.\d+%\s+(?:dazed|mind lock)
0.0010 | c Test | [33] Test Trigger : start : Pattern "vocmind1" : queue stop hum #WAIT 120000 queue ex...
0.0303 | k Test | [33] Var "rtqueue" changed from "" to "stop hum"
0.0004 | d Test | [33] Test Trigger : wait -7867 ms
0.0007 | a Test |
0.0005 | a Test |Time Development Points: 21 Favors: 7 Deaths: 0
0.0005 | a Test |Overall state of mind: fluid
0.0004 | a Test |EXP HELP for more information
0.0011 | a Test ]>
0.2945 | a Test |>
0.0005 | a Test |Showing Vocals experience:
0.0004 | a Test |
0.0004 | a Test | SKILL: Rank/Percent towards next rank/Amount learning
0.0004 | a Test | Vocals: 85 80.70% mind lock
0.0001 | f Test | Pattern: Vocals:\s+\d+\s+\d+\.\d+%\s+(?:dazed|mind lock)
0.0009 | c Test | [34] Test Trigger : start : Pattern "vocmind1" : queue stop hum #WAIT 120000 queue ex...
0.0009 | d Test | [34] Test Trigger : wait -7862 ms
0.0006 | a Test |
0.0004 | a Test |Time Development Points: 21 Favors: 7 Deaths: 0
0.0004 | a Test |Overall state of mind: fluid
0.0004 | a Test |EXP HELP for more information
0.0011 | a Test ]>
0.4559 | e Test | [33] Test Trigger : resumed
0.0155 | e Test | [33] Test Trigger : resumed
0.0010 | a Test |> stop hum
0.0004 | j Test >stop hum
0.2309 | a Test |
0.0004 | a Test |In the name of love?
0.0283 | a Test ]>
0.0767 | e Test | [34] Test Trigger : resumed
0.0137 | e Test | [34] Test Trigger : resumed
0.0305 | a Test |>
|
It would have queued the same action the second time if #ADDITEM worked the same as %additem. |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Sep 03, 2008 9:26 am |
I will say it again, you have 2 triggers that are working off the 'slightest difficulty' message. The reason you are getting
weird results from time to time is completely a function of the order in which the mud has sent messages. I suppose I
could rewrite those for you as well. It would probably be helpful for me to do that so you have a better example of how to
use the new queue as well.
In any case here is the code for a new queueing system.
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="QueueSystem" copy="yes">
<func name="Queue" copy="yes">
<value><![CDATA[#LOCAL $RES
#SWITCH ($Action)
("D") {
$Com=%item(@PendingCommands,1)
#IF (%dbkeys($Com)=$Command) {
#SECTION PD {
#DELNITEM PendingCommands 1
#IF (@PendingCommands="") {
#IF (%threadname("QueueExecutorS")) {#SIGNAL RTPending 1}
}
}
} {
$Com=%item(@PendingCommands,2)
#IF (%dbkeys($Com)=$Command) {
#SECTION PD {
PendingCommands=""
#IF (%threadname("QueueExecutorS")) {#SIGNAL RTPending 1}
}
} {
#SAY {Command $Command was not currently pending}
}
}
}
("C") {
$Count=1
#SECTION QD {
$Max=%numitems(@QueueData)
#WHILE ($Count<=$Max) {
#IF (%dbkeys(%item(@QueueData,$Count))=$Command) {
#DELNITEM QueueData $Count
$RES=%concat("Command ",$Count," canceled")
$Count=$Max
}
$Count=($Count+1)
}
}
}
("CA") {
#SECTION QD {
$QD=%subregex(@QueueData,%concat("(?:\A|\|)",$Command,"=[^|]*(?=\||\z)"),"(?(^)(?INSTANCE)�)")
$RES=%concat(%word($QD,1,"�")," entries canceled")
QueueData=%word($QD,2,"�")
}
}
("CL") {
#SECTION QD {
$Count=%numitems(@QueueData)
#WHILE ($Count) {
#IF (%dbkeys(%item(@QueueData,$Count))=$Command) {
#DELNITEM QueueData $Count
$RES=%concat("Command ",$Count," canceled")
$Count=1
}
$Count=($Count-1)
}
}
}
("RESET") {
#STOP QueueExecutorS
#STOP QueueExecutor
#RESET QueueSystem
#THREAD {QE} {QueueExecutor}
} {
#SECTION QD {
#IF (@QueueData) {
QueueData=%concat(@QueueData,"|",$Command,"=",$RT)
} {
QueueData=%concat($Command,"=",$RT)
}
}
#IF ((%threadname("QueueExecutor")="")&&(%threadname("QueueExecutorS")="")) {
#THREAD {QE} {QueueExecutor}
}
$RES="command added"
}
#RESUME QueueExecutor
#RESUME QueueExecutor
#RETURN $RES]]></value>
<arglist>$Command, $RT, $Action</arglist>
</func>
<var name="QueueData" type="StringList" usedef="true" copy="yes"/>
<var name="PendingCommands" type="StringList" usedef="true" copy="yes"/>
<alias name="QueueExecutor" copy="yes">
<value>#IF (%threadname("QueueExecutor")) {#EXIT}
#IF (%threadname("QueueExecutorS")) {#EXIT}
#WAIT
#CALL %threadname(,"QueueExecutor")
#LOCAL $Command
#WHILE (1) {
#IF (@QueueData) {
#IF (%numitems(@PendingCommands)<2) {
#SECTION QD {$Command=%pop(QueueData)}
#SECTION PD {
#IF (@PendingCommands) {
PendingCommands=%concat(@PendingCommands,"|",$Command)
} {
PendingCommands=$Command
}
}
#SEND {%dbkeys($Command)}
#IF (%dbvalues($Command)) {
#SIGNAL RTPending 0
#CALL %threadname(,"QueueExecutorS")
#WAITSIGNAL RTPending
#CALL %threadname(,"QueueExecutor")
}
} {
#SUSPEND QueueExecutor
}
} {
#SUSPEND QueueExecutor
}
#IF (@RoundTime) {
#WAIT (@RoundTime*1000)
#SECTION RT {RoundTime=0}
}
}</value>
</alias>
<var name="RoundTime" type="Integer" usedef="true" copy="yes">
<value>0</value>
<default>0</default>
</var>
<trigger priority="70" copy="yes">
<pattern>Roundtime(?:\:)?\s+(\d(?:\d)*)</pattern>
<value>#SECTION RT {
RoundTime=%1
}
#SIGNAL RTPending 1</value>
</trigger>
</class>
</cmud> |
It uses a truly multi-threaded design, so rather then causing an alias or trigger to wait a single thread handles the waiting.
That thread also suspends itself when it has nothing to do to conserve CPU. You should be able to use this without removing your old queue.
Just make sure that you adjust an entire class of scripts to work with the new queue at anyone time.
The usage is done through the Queue function in the formats
@Queue("command") -- Adds command
@Queue("command",1) -- Adds command and flags it as expecting a round time
@Queue("command",,"D") -- Informs the worker thread that command was completed
@Queue("command",,"C") -- Removes the first occurence of command from the queue
@Queue("command",,"CL") -- Removes the last occurence of command from the queue
@Queue("command pattern",,"CA") -- Removes all commands that match the pattern from the queue
@Queue(,,"RESET") -- Clears the entire queue buffers, and reloads the worker thread
You can use this function with #CALL or as part of any evaluated expression, for example:
#CALL @Queue("A")
#SHOW @Queue("C",,"CL")
$QA=@Queue("B",,"D")
Now to explain how the round time part works. It has a round time trigger built in. That trigger will advance the worker thread
when it is expecting a round time. Using @Queue to tell it that the command is done will cancel the expectation of a round time.
Since you essentially have to tell it when each command is done with a trigger that receives the appropiate message, but you
don't want to indicate the command is done when a round time message might still come in you have to use a second state on
those triggers. For example:
#TRIGGER {you juggle you ball} {do some stuff since we know the command is done}
#COND {} {#CALL @Queue("juggle balls",,"D")} {Wait|Param=100}
The second state there just puts a small delay to allow the round time message to come in before telling the worker thread that
the command was completed. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums
Last edited by Vijilante on Wed Sep 03, 2008 7:16 pm; edited 1 time in total |
|
|
 |
Nattie Apprentice
Joined: 24 Jul 2008 Posts: 109
|
Posted: Wed Sep 03, 2008 4:14 pm |
Thank you! I can't get that to paste or import, yet, though. It gives me this error:
File: . Line: 95 Col: 36 Error: Invalid XML name: '2'
(The line is #IF (%numitems(@PendingCommands)<2) ) |
|
|
 |
|
|
|
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
|
|