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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Fri Sep 24, 2010 9:40 am   

[3.29a] Command Input triggers BUG
 
I came across this trying to work up a bug report for a larger problem of multi-state triggers with some states being command input triggers getting "hung between states" but it's hard to get something reproducible if I can't make a command input trigger in the untitled session. I don't see anything in the help files saying Command input triggers only work online. Am I wrong to assume I should be able to test them off line?


To reproduce:

1. Create the following trigger in an untitled session.
Code:
<trigger type="Command Input" priority="10" id="1">
  <pattern>test</pattern>
  <value>#beep</value>
</trigger>

2. Save and exit package editor
3. Type test on the command line.
4. The following message is displayed when I do this.
ERROR: Trigger "test" fired but did not compile

Here is the debugger text
Code:
0.0006 | c  untitled |  [1] untitled Comline : start :
0.0011 | l  untitled |    Trigger "test" compiled (Pattern) : test
0.0005 | f  untitled |    Command Input: test
0.0008 | l  untitled |    Trigger "test" compiled (Pattern) : test
0.0009 | l  untitled |    Trigger "test" compiled (Normal) : #beep
0.0004 | a  untitled |ERROR: Trigger "test" fired but did not compile
0.0005 | h  untitled |<ESC>[1SERROR: Trigger "test" fired but did not compile<ESC>[0m
0.0011 | a  untitled |test
0.0004 | h  untitled |<ESC>[2Stest<ESC>[0m
0.0009 | d  untitled |  [1] untitled Comline : stopped
0.0000 |
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2307

PostPosted: Fri Sep 24, 2010 12:33 pm   
 
[edited]
Your command input trigger is clearly firing, showing that you _can_ run command input triggers in offline mode. The error you are getting is a compile error, which means that your code has a bug in it. But that's weird, because I don't see any reason why that code should not compile.

On your other problem--not all types of triggers work as trigger states. I suspect that command input triggers are not intended to work as trigger states.
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Fri Sep 24, 2010 12:56 pm   
 
I was going by the #oninput help file which states:
Code:
Instead of matching the pattern against lines received from the MUD, command input triggers test their pattern against commands you enter on the command line.

No where in there does it mention having to actually be connected to the MUD which is why I posted. If it's a case of simply needing to be connected to a server, it might be helpful to add that into the #oninput help file as they are being updated if it hasn't been done already.

As for the command input trigger type not being supported by multi state triggers I guess that's possible since it's not one of the types listed in the help file, but since it does partially work the first time the trigger fires when you first open a session I was gonna try to test it out a bit more.

edit:
you edited as I was posting lol

Don't see how my code could be flawed. That's the only trigger I made in the untitled session to test. It's hard to get a bug in between typing test on the trigger pattern line, selecting command input for the trigger type and typing #beep in the script text box then saving.

I just realized though if you make the trigger and type test it will do nothing till you open the script debugger window at which time it will start showing the error in the main session window. I also tested with #print, #echo and #show instead of #beep and it still gives the same error.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Sep 24, 2010 1:45 pm   
 
You may have some sort of extraneous character in your trigger. It's also possible that your default scripting languagne isn't zScript. However I just tested the trigger and it works fine.

As for multi-state oninput triggers, while they do work ( I just did a quick test ), I'm having trouble imagining a scenario where you'll need that.
_________________
Asati di tempari!
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Fri Sep 24, 2010 2:33 pm   
 
Like I said it's a simple trigger nothing out of the ordinary. Here's a shot showing my settings.... I just did a reinstall and still getting the errors even with a regular pattern trigger. I'll re download the installer and see if maybe something got corrupted somehow in the download.

Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Sep 24, 2010 2:37 pm   
 
It's possible something in your settings might be corrupted if it works for others and not you. :-/
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Fri Sep 24, 2010 4:07 pm   
 
Fresh install seems to have fixed the offline trigger error. Guess something went haywire when I installed the upgrade.

On a side note what file contains the data that populates your session list when you load CMUD? Is it in the main folder or the settings folder that has all the actual packages in it?


Last edited by Fizgar on Fri Sep 24, 2010 4:13 pm; edited 1 time in total
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Sep 24, 2010 4:12 pm   
 
The file SESSIONS.DB populates the session list. A related file SESSIONKEYS.DB stores any passwords in encrypted format.

Your screenshot above shows that the trigger was a "Pattern" type instead of a "Command Input" type. I also could not reproduce any error in the #BEEP trigger, but maybe you accidentally changed your command character to something other than the # character.
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Fri Sep 24, 2010 4:20 pm   
 
Thanks. Yeah, the screen shot was of a second trigger I created in a new session to see if maybe it was just a certain type of trigger causing the error.

Edit:
It also wasn't a case of the command character getting changed because I could #beep on the command line and the beep would sound. I'm guessing something got corrupted when I upgraded from 3.27 to 3.29a or it was a by product of the multi state trigger I had command inputs as sub states in that started the mess they were the only things I did "new" last night.
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Fri Sep 24, 2010 5:00 pm   
 
Tech wrote:
As for multi-state oninput triggers, while they do work ( I just did a quick test ), I'm having trouble imagining a scenario where you'll need that.


The mud this multi-state was for has some poorly coded menus that you can't exit out of without loosing resources. This trigger was for the purpose of going through a set of "mock" menus. This would store all choices in variables which I could then use in a script to make exactly what I wanted the first time I called up the menus in game. Also my menus would have an option to quit at anytime setting the state back to 0. At the time I was thinking one multi state would be the easiest/cleanest way to do that. I'll mess around with it a little more when I get some free time and see if it throws things out of wack again.

an example: I type create, that fires the first state of the trigger with #noinput followed by a menu I echo to my screen with 10 items that are numbered 1-10.

Second state pattern: ^(%d) (command input also). Typing 1 would cause this state to fire starting with #noinput then setting a variable to something then echoing another menu.

Rinse and repeat a time or two more and then all the variables would be populated for use in the script that would actually create the mock item for real with no waste.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri Sep 24, 2010 5:37 pm   
 
Why not just use an alias and then just use #prompt or var = %prompt("","Enter the value:") to do that?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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