Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Jul 30, 2008 9:29 pm   

Why does this work as an alias, but it randomly aborts as an event?
 
I did a clean install to see if this got rid of my problem with events randomly aborting, but no dice.

Here is the text of both the event and alias.

Code:
#EXECUTE {queue stop hum}

#IF (%1=="") {#VAR ./universal/generic_scripts/vocals/vocset 0

#T+ VocTriggers

#IF (@vocdiff<1) {#VAR vocdiff 1}

#WHILE (@vocset==0) {
  #VAR vocplay %db(@playdifficulty,@vocdiff)
  #EXECUTE {queue hum @vocplay}
  #WAITFOR {^You *hum*$}
  #EXECUTE {queue stop play}
  #WAITFOR {^You stop playing your song.$}
}

#VAR vocplay %db(@playdifficulty,@vocdiff)

#T- VocTriggers
#VAR ./universal/generic_scripts/vocals/vocset 0

#T+ VocMind
#EXECUTE {queue exp skill vocals}
}

#IF (%1=="end") {#T- VocMind; #T- VocTriggers}



The alias is named zvocals. I named the event qwigybo to be sure the name doesn't conflict with anything. They are both in the class universal/generic_scripts/vocals.

Quick summary: the basic idea is that if I type just zvocals or #RAISE qwigybo it should execute the #IF (%1==""). If I type zvocals end or #RAISE qwigybo end it should do the #IF (%1=="end") and just disable those two classes.

This works for the alias. The event, however, randomly aborts if I type #RAISE qwigybo. #THREAD shows only a single thread running -- the one that always has to be running.

Where does the event abort? Well, it's (seemingly) random.

First test: It entered the loop, did the hum @vocplay, did the #WAITFOR {^You *hum*$}, did the stop hum and the #WAITFOR {^You stop playing your song.$}. Then it hum @vocplay again. Then it spontaneously aborted just before or just after the #WAITFOR {^You *hum*$}, because it never did send the stop hum command.

#THREAD showed it was not running. #RAISE qwigybo end correctly turned off the triggers.


Second test: It entered the loop, did the hum @vocplay... and nothing else.

#THREAD showed it was not running. #RAISE qwigybo end correctly turned off the triggers.


Third test: The same as the first test, except it follows up with more crazy. It entered the loop, did the hum @vocplay, did the #WAITFOR {^You *hum*$}, did the stop hum and the #WAITFOR {^You stop playing your song.$}. Then it hum @vocplay again. Then it spontaneously aborted just before or just after the #WAITFOR {^You *hum*$}, because it never did send the stop hum command.

But then I get this back from CMUD, echo-style:

Code:
ERROR: Operator binaryint requires two arguments
ERROR: Operator binaryint requires two arguments
ERROR: Operator binaryint requires two arguments
ERROR: argument still on stack:


#THREAD showed it was not running. #RAISE qwigybo end correctly turned off the triggers.

Like I said, I get no such errors when I run the zvocals alias, and it is character-per-character exactly the same. It seems that for the event, the problem lies somewhere in the first #IF. I have no clue what the error means but hopefully it's helpful.

Am I trying to do something in an event that I simply cannot do in an event? I've read the event documentation over a handful of times and didn't see anything, but maybe I still missed something or maybe there's something not in the documentation. Thanks for any help!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Jul 31, 2008 2:09 am   
 
Is "queue" and alias, or a mud command? If it is a MUD command you should use #SEND instead of #EXECUTE. If it is an alias we will need the contents of that alias for testing.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Thu Jul 31, 2008 2:13 am   
 
It's an alias that keeps a queue of commands to send to the MUD because actions have times associated with them:

queue alias:
Code:
#VARIABLE rtqueue {%additem(%-1, @rtqueue)}
#IF ((%item(@rtqueue, 2))=="") {#EXECUTE emptyqueue}


Do events handle the execution of aliases differently?
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Tue Aug 05, 2008 6:42 am   
 
Still have no clue what's causing this... hoping the error messages might provide some sort of hint to someone who knows more than me. Not being able to use events has been a hassle. :(
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Wed Aug 06, 2008 8:43 am   
 
While I can't help you with your problem directly, I want to say several things:
1) There were some problems with #RAISE command, fixed somewhere in May. Maybe not all of them...
2) I've noticed that you have several different issues with your settings (not working gauges, events...) Have you tried export all of your settings to XML and create a new session? May be this will help? One time back it helped me in a very similar situation.
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Aug 06, 2008 9:51 am   
 
Arde wrote:
While I can't help you with your problem directly, I want to say several things:
1) There were some problems with #RAISE command, fixed somewhere in May. Maybe not all of them...
2) I've noticed that you have several different issues with your settings (not working gauges, events...) Have you tried export all of your settings to XML and create a new session? May be this will help? One time back it helped me in a very similar situation.


:D

1) That's good to know that maybe that's it. I don't mind bugs so much as I know they're bugs... what drives me crazy is not knowing if something is a bug, or if I've screwed something up, haha. I'm pretty eager for any crumbs as far as that's concerned, so thank you!

2) EXPORT TO XML. That's the sort of thing I've been looking for, so I can try a new session without losing my stuff, but I had no idea where to start! You're very right, I've been wondering if I have something weird going on with my session because of all this stuff that isn't working. I've been thinking that maybe I borked something when I was still learning the basics and accidentally making stuff error, and maybe it messed something up somewhere. I'm in Linux atm but when I log over I'm definitely going to give that a shot. Thank you so much!
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Aug 06, 2008 10:45 am   
 
Quote:
I'm in Linux atm but when I log over I'm definitely going to give that a shot. Thank you so much!

Should be able to get CMUD working in Crossover on Linux. At least it worked fine on Ubuntu when I tried it on 2.18.
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Aug 06, 2008 10:59 am   
 
Seriously? Whoa, great! I will mess with that as well.

You guys are awesome.
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Aug 06, 2008 12:02 pm   
 
Oh, now this is really weird...

I exported to XML. I moved my old session file to another folder, entirely away from CMUD, as a backup. I opened CMUD and deleted the session from my list. Then I recreated it. Then I imported from XML.

Now, before I get to the *really* weird thing, here are a few things that were different than they had been when I imported them. First, I normally have two windows, side by side, above my main session window. One is "top" relative to the main window, and the other is "right" relative to that window. When I imported, that second window was still set to "right" but nothing was in the relative column, so it was just taking up the entire right side. I fixed that real quick and moved on. The second weird thing is two of my buttons on my bottom toolbar had their positions switched. I changed the priority of the second one to come before the first one and moved on.

However, I'm curious... is this just the XML importing/exporting being a little buggy, or is it a sign that my previous session was messed up in some way -- because the buttons had been (apparently) displaying contrary to their priority settings, for example? Or when you import from XML, does it give new priorities?

Anyway, here's the really weird thing. I went and typed in an alias that worked fine before and now it completely froze the program. Happens every time. I wouldn't have figured out *why* if I didn't have a status bar showing me what's in the "command queue" I showed up above (the "queue" alias; the status bar is #SHOW @rtqueue). The alias I typed in happened to start with the very alias I started this thread with, so it's easier for me to explain to you guys what happened.

Basically, when I type in the alias now, it just *spams* the crap out of CMUD on that WHILE loop. It went through and spammed "hum march" and "stop hum" pseudo-infinitely, I guess, and as best I can tell that's what's locking up the program. This means it completely disregarded the #WAITFOR commands.

Does anyone have any idea what this means, or why it's doing that now, or... anything at all about any of this? I'm just more confused than when I started. Exporting and importing seems to have made things far worse.

It's not a huge deal since I can just restore my old session folder, but I'm completely stumped and I just. Cannot. Understand. Why. I keep getting all these weird errors and bugs with CMUD. Any advice, any at all, would be helpful. I don't know what to do anymore. I ran memtest twice, even though I'm not having problems with other programs, because the errors are so weird and random that it seemed RAM could be causing it. No errors at all, though. I uninstalled and reinstalled CMUD twice, no change. I'm running Windows XP if it matters. :-/ At the end of the month I'm going to be using a different computer and I'm curious if I'd have the same problems on it, but my trial will run out before then. I'm really waffling back and forth on whether I should buy the full version since I can't seem to get it to work. On the one hand, it seems like it should be fixable because other people seem to run it fine, and if I could get it to work it does everything I could possibly ask for... but on the other hand, if I can't get it to work reliably, there's no point. To be clear, it's not a knock on the program itself, it just seems like there's some weird issue, maybe with this specific computer or something, that I can't identify. I don't want to use any other client, though. :(
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Aug 06, 2008 12:39 pm   
 
Nattie wrote:
However, I'm curious... is this just the XML importing/exporting being a little buggy, or is it a sign that my previous session was messed up in some way -- because the buttons had been (apparently) displaying contrary to their priority settings, for example? Or when you import from XML, does it give new priorities?


Well, I can answer the last question at least: it does give new priorities. In my old session (which I've since restored) the priority for the button that came before the other was set fine. I'm not sure how CMUD handles exporting to XML, but it seems weird to me that, in doing so, it would decide to make the previously higher priority button lower priority. Also, everything else was in the right order. Is it supposed to do that? Or did it do that because this computer seems to hate CMUD? :-/
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Wed Aug 06, 2008 1:23 pm   
 
Nattie wrote:
Does anyone have any idea what this means, or why it's doing that now, or... anything at all about any of this? I'm just more confused than when I started. Exporting and importing seems to have made things far worse.


There are 4 possible answers:
1) Your scripts have errors in them (remember your ERROR messages? There definitely should be a reason for CMUD to show them.)
2) Guess you've switched over several CMUD versions with the same .pkg file? Sometimes package file tends to accumulate errors from previous versions, which may interfere with your current settings. Recreating your package from the xml file makes it cleaner, but this, in turn, may expose old problems in your script logic.
3) The XML import is broken in 2.35. There is a thread on this issue nearby, btw.
4) There is a not fixed yet bug in CMUD.

Windows layout is not stored in the xml, so arranging windows manually is normal.

Are you really need buttons placement based on their priority? May be it will be easy for you set their coordinates in the PE? Xml export/import handles coordinates excellent, especially after Zugg has made several bugfixes.

#Commands are not allowed in status bar, dunno how you managed to get them working previously.
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Aug 06, 2008 1:40 pm   
 
I'm completely open to my scripts having errors in them. It's just that when I post stuff, like the first post here, no one points out that I've done something wrong, and I (obviously) don't see it. It seems to be fine. :-/ I don't get, for example, what would make CMUD skip #WAITFOR commands. Maybe having some weird trigger somewhere would lead to a domino of strange errors? I dunno what else to think. For what it's worth, I've been getting weird errors from the moment I installed CMUD. Maybe one of the very first triggers I made is to blame? Maybe there's some character I should have escaped but didn't, and it works on the surface but not in actuality? I'm really stumped as to what, though. Escaping with tildes seemed to freak things out, so I went and changed any trigger patterns that were at all complicated to REGEX, but that only made things a little more stable, and only in regards to those specific triggers...

It's good to know the XML import is broken and it's not just me. Phew, thank you!

My bad about the #command in the status bar. I hadn't looked at it since the program had just crashed, but you're right, all I have there is "@rtqueue" and it shows up correctly. No #SHOW.
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Aug 06, 2008 1:44 pm   
 
Looking at the very first triggers I made, is there anything wrong with these patterns?

, "*"$
chants*:*$
sings*:*$
whispers, "
you, "

For example, even with the $, might those asterisks mess things up? Or do quote marks need an escape and I didn't know? Or do colons? All I have assigned to those triggers is highlight commands, and they highlight lines correctly, but maybe there's more going on beneath the surface. My other early triggers are very basic, no special characters aside from ^ and $.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Aug 06, 2008 4:39 pm   
 
In order to tell whether your code has bugs, we really would need to see the code.

One way to figure out where you may have a problem is to turn off all of your triggers, then turn them on one by one until you start to see problems. Other than that, I don't have enough information.
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Aug 06, 2008 4:40 pm   
 
You mean like, all of it? Because I posted the alias above, and the other alias it references. (Not trying to be snarky, just clarifying.)
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Wed Aug 06, 2008 6:18 pm   
 
Any of the wait commands can cause issues as they spawn new threads and then you have to be certain you know what you are doing and you're not going to try to set the same variable in different threads which can become easy if you have a couple of aliases setting the variable one of which also contains a wait command.

Ultimately if you want us to find out where something is going wrong then you need to provide everything that is related to what you are trying to achieve. So all the aliases, triggers, variables etc and really the easiest way of doing that is to export it all via xml and paste it here. We should then be able recreate what you have and see what is going wrong. Sample output would help for us to test the settings.
_________________
Taz :)
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Thu Aug 07, 2008 1:40 am   
 
Ah... well, I know that I have only the one thread dealing with the vocset variable, for example, above. None of my other scripts have anything to do with it. But I get what you mean.

I still think something is crazy with my computer and CMUD, but FWIW here's all the things related to this particular event.

Here is the commandqueue_handler class. Since actions in the game take time, and no other actions can be completed during that time, this queues them up and sends one ever time the is no more wait time. Nearly every command I want to send to the game must go through this class. If something is wrong here, it could very well explain why so much stuff is messed up.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="commandqueue_handler">
    <alias name="queue">
      <value>#VARIABLE rtqueue {%additem(%-1, @rtqueue)}
#IF ((%item(@rtqueue, 2))=="") {#EXECUTE emptyqueue}</value>
    </alias>
    <alias name="emptyqueue">
      <value>#WAIT 500
#WAIT @t*1000
#EXECUTE %item(@rtqueue, 1)
#VARIABLE rtqueue {%delitem(%item(@rtqueue, 1), @rtqueue)}
#IF (@rtqueue!="") {#EXECUTE emptyqueue}</value>
    </alias>
    <var name="rtqueue" type="StringList"/>
    <stat name="InTheQueue" priority="33470">
      <value>     In the queue: @rtqueue</value>
    </stat>
  </class>
</cmud>


This is the vocals class. Includes the alias above and everything related to it.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="vocals">
    <alias name="zvocals">
      <value>#EXECUTE {queue stop hum}

#IF (%1=="") {#VAR ./universal/generic_scripts/vocals/vocset 0

#T+ VocTriggers

#IF (@vocdiff<1) {#VAR vocdiff 1}

#WHILE (@vocset==0) {
  #VAR vocplay %db(@playdifficulty,@vocdiff)
  #EXECUTE {queue hum @vocplay}
  #WAITFOR {^You *hum*$}
  #EXECUTE {queue stop play}
  #WAITFOR {^You stop playing your song.$}
}

#VAR vocplay %db(@playdifficulty,@vocdiff)

#T- VocTriggers
#VAR ./universal/generic_scripts/vocals/vocset 0

#T+ VocMind
#EXECUTE {queue exp skill vocals}
}

#IF (%1=="end") {#T- VocMind; #T- VocTriggers}</value>
      <notes>First, it stops my humming, no matter what.

If it does not receive a variable, it tests to see the maximum difficulty I can play.  Then it sets that to vocplay, checks my vocal mindstate, and if I'm not dazed or mind locked, it hums the appropriate difficulty.  Whenever I finish humming, it tests again.  If I am dazed or mind locked it stops my  humming, waits two minutes, and checks my exp again.  If my exp is not dazed or mind locked, I will hum again.

If it receives the variable "end," it disables all the triggers associated with it, thereby making sure I do not hum anymore.</notes>
    </alias>
    <var name="vocdiff">8</var>
    <var name="vocplay">march</var>
    <class name="VocTriggers" enabled="false">
      <trigger name="vocmessage3" priority="30360">
        <pattern>^You begin to hum %w %w %w.</pattern>
        <value>#ADD vocdiff 1</value>
      </trigger>
      <trigger name="vocmessage1" priority="30370">
        <pattern>your heart swelling in pride at your hard-earned skill.$</pattern>
        <value>#ADD vocdiff 1</value>
      </trigger>
      <trigger name="vocmessage2" priority="30380">
        <pattern>your skill in your craft</pattern>
        <value>#ADD vocdiff 1</value>
      </trigger>
      <trigger name="vocmessage6" priority="30390">
        <pattern>^You*with only the slightest hint of difficulty.$</pattern>
        <value>#ADD vocdiff 1</value>
      </trigger>
      <trigger name="vocmessage4" priority="30400">
        <pattern>^You fumble slightly as you begin</pattern>
        <value>#ADD vocdiff -1;#ADD vocset 1</value>
      </trigger>
      <trigger name="vocmessage5" priority="30410">
        <pattern>^You struggle to begin</pattern>
        <value>#ADD vocdiff -1</value>
      </trigger>
    </class>
    <class name="VocMind" enabled="false">
      <trigger name="vocmind1" priority="30450" regex="true">
        <pattern>Vocals:\s+\d+\s+\d+\.\d+%\s+(?:dazed|mind lock)</pattern>
        <value>#EXECUTE {queue stop hum}
#WAIT 120000
#EXECUTE {queue exp skill vocals}</value>
      </trigger>
      <trigger name="vocmind2" priority="30480" regex="true">
        <pattern>Vocals:\s+\d+\s+\d+\.\d+%\s+(?:clear|learning|thoughtful|pondering|concentrating|muddled|perplex|bewilder|very)</pattern>
        <value>#EXECUTE {queue hum @vocplay}</value>
      </trigger>
      <trigger priority="30550">
        <pattern>^You finish humming</pattern>
        <value>#EXECUTE {queue exp skill vocals}</value>
      </trigger>
    </class>
    <var name="vocset">0</var>
    <var name="playdifficulty" type="Record">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>


That should cover everything, I think.

Sample output... I reset vocdiff to 0 and vocplay to "" so you can see the strings the alias encounters as it determines what I ought to be humming. Basically, to learn the vocals skill, I need to be humming whatever is "the slightest hint of difficulty" when I hum it. As I get better in the skill, types of songs that used to be slightly difficult to hum because easy, so the script always checks that I don't have a harder "slightest hint of difficulty" song that I am capable of doing.

I can't run it as an event to do this, as I noted above.

All this is only the script running. I didn't type in any commands.

Code:
> stop hum

In the name of love?
> hum scales

You effortlessly begin to hum some quiet scales, your heart swelling in pride at your hard-earned skill.
> stop play

You stop playing your song.
> hum arpeggio

You effortlessly begin to hum some quiet arpeggios, your heart swelling in pride at your hard-earned skill.
> stop play

You stop playing your song.
> hum ditty

You effortlessly begin to hum a quiet ditty, your heart swelling in pride at your hard-earned skill.
> stop play

You stop playing your song.
> hum folk

You begin to hum a quiet folk song, your skill in your craft showcased in every note.
> stop play

You stop playing your song.
> hum ballad

You begin to hum a quiet ballad.
> stop play

You stop playing your song.
> hum waltz

You begin to hum a quiet waltz.
> stop play

You stop playing your song.
> hum lullaby

You begin to hum a quiet lullaby with only the slightest hint of difficulty.
> stop play

You stop playing your song.
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.
> stop play

You stop playing your song.
> hum jig

You fumble slightly as you begin to hum a spritely jig.
> stop play

You stop playing your song.
> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 30.82% clear       

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: clear
EXP HELP for more information
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.
>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You finish humming a quiet march.

> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 30.82% pondering   

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: clear
EXP HELP for more information
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.
>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You finish humming a quiet march.

> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 31.66% muddled     

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: clear
EXP HELP for more information
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.
>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You finish humming a quiet march.

> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 33.57% very muddled

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: clear
EXP HELP for more information
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.
>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You finish humming a quiet march.

> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 33.57% perplexed   

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: clear
EXP HELP for more information
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.
>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You finish humming a quiet march.

> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 36.42% bewildering 

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: clear
EXP HELP for more information
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.
>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You finish humming a quiet march.

> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 39.98% bewildering 

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: fluid
EXP HELP for more information
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.
>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You continue to hum a quiet march with only the slightest hint of difficulty.

>
You continue to hum your song.

>
You finish humming a quiet march.

> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 39.98% mind lock   

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: fluid
EXP HELP for more information
> stop hum

In the name of love?

> exp skill vocals

Showing Vocals experience:

          SKILL: Rank/Percent towards next rank/Amount learning
          Vocals:     61 43.54% bewildering 

Time Development Points: 9  Favors: 7  Deaths: 0
Overall state of mind: clear
EXP HELP for more information
> hum march

You begin to hum a quiet march with only the slightest hint of difficulty.



And so on. At the end there, after I hit mind lock, it waited for 2 minutes and sent the exp skill vocals command again.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Aug 12, 2008 5:08 pm   
 
Btw, you don't need to use #EXECUTE all of the time to execute aliases. You only need to use #EXECUTE when you have a variable or expression that contains the command you want to execute.

For example, if your alias is called "emptyqueue" then you don't need to do:

#EXECUTE emptyqueue

Just doing

emptyqueue

works just fine. The only time you need to use #EXECUTE is if the command is stored in a variable, like:
Code:
#VAR Command "emptyqueue"
#EXECUTE @Command

The #EXECUTE command treats it's arguments as strings and then compiles them at *runtime*. So this is much slower. Also, the #EXECUTE is compiled by the main thread, so if you are running a script in a thread, it has to synchronize with the main user interface thread before it can continue, which also makes it slow.

Anyway, try getting rid of your un-needed #EXECUTE commands to see if that helps at all. For example:
Code:
queue hum @vocplay
#WAITFOR {^You *hum*$}
queue stop play
#WAITFOR {^You stop playing your song.$}

and also use the #THREAD command to see if you have multiple threads in the background that are all waiting for something.
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Tue Aug 12, 2008 5:10 pm   
 
Ohhh, thank you! I will give that a shot!
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Tue Aug 12, 2008 5:30 pm   
 
Nattie... If I remember it right, when I ran your script on my machine last week, after your "emptyqueue" alias CMUD show 3 threads are running. Is this what you think CMUD should do? Check your threading logic once again, may be this will help you.
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Tue Aug 12, 2008 5:52 pm   
 
Alright, I changed this to not have #EXECUTEs, so now it is:

Code:
queue stop hum

#IF (%1=="") {#VAR ./universal/generic_scripts/vocals/vocset 0

#T+ VocTriggers

#IF (@vocdiff<1) {#VAR vocdiff 1}

#WHILE (@vocset==0) {
  #VAR vocplay %db(@playdifficulty,@vocdiff)
  queue hum @vocplay
  #WAITFOR {^You *hum*$}
  queue stop play
  #WAITFOR {^You stop playing your song.$}
}

#VAR vocplay %db(@playdifficulty,@vocdiff)

#T- VocTriggers
#VAR ./universal/generic_scripts/vocals/vocset 0

#T+ VocMind
queue exp skill vocals
}

#IF (%1=="end") {#T- VocMind; #T- VocTriggers}


Still works great as an alias. Got a pop-up error within seconds of trying it as an event. This is what the session window says. (Note: "In the name of love?" is what the game says if I say to stop doing something that I'm not doing, so it's just its response to "stop hum.")

Code:
> stop hum
ERROR: argument still on stack: 


In the name of love?
>
Please rephrase that command.
> hum jig

You begin to hum a spritely jig with only the slightest hint of difficulty.
ERROR: argument still on stack: 1
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Tue Aug 12, 2008 5:55 pm   
 
Arde wrote:
Nattie... If I remember it right, when I ran your script on my machine last week, after your "emptyqueue" alias CMUD show 3 threads are running. Is this what you think CMUD should do? Check your threading logic once again, may be this will help you.


That's strange. Are you sure you're remembering right? I just tried running it: there's the thread for emptyqueue running for the second it takes that to do its business, and then there's only the one omnipresent thread running. That's how it should work, and that's how it works for me...
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Aug 12, 2008 7:28 pm   
 
I'm not getting your "argument still on stack error" here, so maybe I'm not testing it correctly. Here is what I did:

1) Run CMUD and close the Session window. Open Settings Editor
2) Copy the full "vocals" class in the post above. Paste it into NotePad and change the < character to a & lt ; (without the spaces).
3) Copy the edited Notepad text and then right-click on the Tree view in the settings editor and select Paste.
4) Copy the full "commandqueue_handler" class in the post above. Right-click on the tree and select Paste
5) Find the "zvocals" alias and then copy/paste your new code (without the #execute) into the alias and click Save Changes.
6) Select New/Event and enter "zevent" as the name. Then paste the same code into the event and click Save Changes.

OK, now on the command line, if I type:

zvocals

then it displays:

stop hum
hum march

with a small delay between them. If I type:

#RAISE zevent

then it also displays the same text with the same small delay. So I don't get any error from this.

My guess is that some other script is running that I am not able to test because I'm not connected to your MUD. Try running the Script Debugger window and see what script is running right before the "argument still on stack" error is shown.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net