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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Grinnz
Newbie


Joined: 12 Jan 2004
Posts: 4

PostPosted: Mon Jan 12, 2004 3:14 am   

Refusal to create a variable...
 
I have been using this excellent program for a long time now, as well as the CPPI graphical plugin (shows numbers graphically for hit points and such). At some point, however, the third and fourth values (mn and mnm) taken from the mud's prompt and put in the CPPI stopped updating, and that has never worked correctly since. I eventually figured out that the trigger was not in fact creating or updating the appropriate variables for these values any more, for some reason. Here is the prompt:

<1579/1579hp 156/156mn 940/940mv 69780608xpn 182483g align:evil -1000 opp:<none> Grinnzock:100% you:100%>

and the trigger:

<&{hp}/&{hpm}hp &{mn}/&{mnm}mn &{mv}/&{mvm}mv &{xpn}xpn &{g}g align:&{al} &{aln} opp:&{opp} &{leader}:&{ldr} you:&{you}>

It is not creating a variable, or if I create it, updating it for the mn and mnm values. I tried changing them to ma and mam (in case there was something special about the variable names...) but with no success. I am using zMUD v6.66 Beta, I attempted to revert to the backed up v6.62, but still had the problem, and so returned to the beta version. Any ideas?

The trigger fires when it is supposed to, as the hp and hpm variables update perfectly. also, it is not a problem with the CPPI, for it is correctly displaying the current variable values. however, the mn and mnm variables remain at whatever value i put in there, currently 37 and 30...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jan 12, 2004 10:15 am   
 
It's extremely unlikely that the trigger works correctly for the first pair of numbers and not for the second pair. Far more likely is that this trigger isn't firing at all and you have another trigger (or the Prefs prompt setting) which updates the first set of variables.

The &VarName pattern is the equivalent of *. There are several special characters which it doesn't match, including %. These characters must therefore be explicitly included in the pattern. Since this interferes with the ability to include these characters in the variables created with the &VarName pattern, I suggest using a standard pattern and creating the variables in the Value (commands) section of the trigger.

Recommended:
Pattern: (%d)/(%d)hp (%d)/(%d)mn (%d)/(%d)mv (%d)xpn (%d)g align:(%w) (%n) opp:(~<*~>) (%w):(%d~%) you:(%d~%)
Value: #VAR hp {%1};#VAR hpm {%2};#VAR mn {%3};#VAR mnm {%4};#VAR mv {%5};#VAR mvm {%6};#VAR xpn {%7};#VAR g {%8};#VAR al {%9};#VAR aln {%10};#VAR opp {%11};#VAR leader {%12};#VAR ldr {%13};#VAR you {%14}
Reply with quote
Grinnz
Newbie


Joined: 12 Jan 2004
Posts: 4

PostPosted: Mon Jan 12, 2004 11:29 pm   
 
yes, i would have tried that...however, the opp value switches between <none> and ###% depending on whether i am fighting anyone, and this poses a problem with defining the characters that appear there. I suppose I could create two separate triggers, one with each possibility for the opp value.

Ten minutes later...
I've tried making those triggers, and the one that should fire when i am not in a battle is firing correctly. Unfortunately, I am having the same problem. It is matching the hp and hpm values to their variables, but then it misses the mn and mnm variables and matches those values to the mv and mvm variables. It then matches the actual mv and mvm values to xpn and g, and since al and aln are different types of variables, it matches the xpn and g values to opp and leader... and the next two values are words, so it assigns nothing to the numerical ldr and you values. It comes out with this:
Prompt: <1579/1579hp 156/156mn 940/940mv 67088512xpn 322483g align:evil -1000 opp:<none> Grinnzock:100% you:100%>
Variable: hp 1579
Variable: hpm 1579
Variable: mn
Variable: mnm
Variable: mv 156
Variable: mvm 156
Variable: xpn 940
Variable: g 940
Variable: al
Variable: aln
Variable: opp 67088512
Variable: leader 322483
Variable: ldr
Variable: you
I am using the trigger you provided, without the {} around the %1 %2 etc. as I entered it directly into the user-friendly trigger box and it didn't work at all with those there. I know the trigger is firing, as the variables that do show up update fine, and they do not when i remove this trigger. The problem seems to be in the mn and mnm variables, then; it is assigning the values that should go there, instead to the mv and mvm variables. is there some innate variable or something i should know about that is interfering with this?

note: this is the same thing that was happening while using the &VarName feature.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jan 13, 2004 12:38 am   
 
quote:
I am using the trigger you provided, without the {} around the %1 %2 etc.

It's your script, so you can certainly make any changes you want, but it's usually unwise to mess with the syntax unless you know why it's being used. I tested it with that exact syntax before posting it in the first place, so I know that that syntax works. I don't know the exact changes you made, but clearly they don't work.
quote:
as I entered it directly into the user-friendly trigger box and it didn't work at all with those there

I just copied my trigger into the "user-friendly trigger box" (I assume you meant the one reached by clicking the Triggers button), putting the section I labeled Pattern: into the box labeled Pattern: and the section I labeled Value: into the box labeled Value, and clicking the Save button. No problems. (I later tried making a trigger with the Help menu's Command Wizard, pasting Pattern: into the Pattern box and Value: into the Command box. This also worked, creating a trigger identical to the one made in the editor.)

I then copied the sample prompt from your first post and pasted that into my command line. I turned Parsing off, using the computer icon next to the command line, (since there are numerous special characters in the prompt) and then hit Enter. After turning Parsing back on, I checked the variables.

Variable: hp 1579
Variable: hpm 1579
Variable: mn 156
Variable: mnm 156
Variable: mv 940
Variable: mvm 940
Variable: xpn 69780608
Variable: g 182483
Variable: al evil
Variable: aln -1000
Variable: opp none
Variable: leader Grinnzock
Variable: ldr 100%
Variable: you 100%


Looks right to me. My guess is that when you changed the trigger you made some mistakes.

Second trigger, for combat purposes:
Pattern: (%d)/(%d)hp (%d)/(%d)mn (%d)/(%d)mv (%d)xpn (%d)g align:(%w) (%n) opp:(%d~%) (%w):(%d~%) you:(%d~%)
Value: #VAR hp {%1};#VAR hpm {%2};#VAR mn {%3};#VAR mnm {%4};#VAR mv {%5};#VAR mvm {%6};#VAR xpn {%7};#VAR g {%8};#VAR al {%9};#VAR aln {%10};#VAR opp {%11};#VAR leader {%12};#VAR ldr {%13};#VAR you {%14}

EDIT: Trimmed the sarcasm a bit.
Reply with quote
Grinnz
Newbie


Joined: 12 Jan 2004
Posts: 4

PostPosted: Tue Jan 13, 2004 10:49 pm   
 
Sorry if I'm missing something, but I tried that exact trigger, with the {}, and it stores the {} into the variables instead of any value...the trigger is still firing, though, I don't remember why it wouldn't earlier; I had just removed the {} because it stored some variables that way, at least. I didn't make any other changes.
[(%d)/(%d)hp (%d)/(%d)mn (%d)/(%d)mv (%d)xpn (%d)g align:(%w) (%n) opp:(~<*~>) (%w):(%d~%) you:(%d~%)-> #VAR hp {}
#VAR hpm {}
#VAR mn {}
#VAR mnm {}
#VAR mv {}
#VAR mvm {}
#VAR xpn {}
#VAR g {}
#VAR al {}
#VAR aln {}
#VAR opp {}
#VAR leader {}
#VAR ldr {}
#VAR you {}]
this is using the exact trigger in your first reply. The second trigger returns the same results, while battling. Perhaps I have a setting wrong or something..
note now the trigger is assigning an empty value to the variables...

I found out that I had something in the Prompt settings, but took that out; perhaps that was what was assigning values incorrectly before, and the trigger is not working, as you had said...but if it works for you, it should work for me..

I also tried entering it through the command line, that returned the same empty variables; and using the initial trigger using the &VarName syntax, which also did not work. For some reason, it is not assigning any values to the variables.
Reply with quote
Vodoc
Apprentice


Joined: 11 Apr 2003
Posts: 119
Location: Sweden

PostPosted: Tue Jan 13, 2004 11:51 pm   
 
no, you left out the %*

#VAR hp {%1}
#VAR hpm {%2}
#VAR mn {%3}
#VAR mnm {%4}
#VAR mv {%5}
#VAR mvm {%6}
#VAR xpn {%7}
#VAR g {%8}
#VAR al {%9}
#VAR aln {%10}
#VAR opp {%11}
#VAR leader {%12}
#VAR ldr {%13}
#VAR you {%14}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jan 14, 2004 2:54 am   
 
I don't know why you are having so much difficulty with this. I deliberately made this as easy as possible, by splitting the trigger into two parts and labeling each part with the box it goes into in the Settings Editor. All you have to do is use your mouse to highlight each section, copy it to the clipboard, and then paste it into the corresponding box of a new trigger in the Settings Editor.

As Vodoc points out, the #VAR commands in your trigger are missing the %1, %2, etc.

You will probably also need to check the Prompt box on the trigger's Options tab, but that doesn't have anything to do with the problem you're having.
Reply with quote
Grinnz
Newbie


Joined: 12 Jan 2004
Posts: 4

PostPosted: Fri Jan 16, 2004 9:17 pm   
 
I'm not stupid, I did not leave out the %#s, they are in the trigger. However I pasted what showed up as the trigger response when the trigger fired, what it put into the variables. The trigger looks like you told me in every message, it should work fine, I understand. I deleted everything in the Prompt box, as I said. It is simply not getting the numbers/words from the prompt and putting them into the variables.
Pattern:
(%d)/(%d)hp (%d)/(%d)mn (%d)/(%d)mv (%d)xpn (%d)g align:(%w) (%n) opp:(~<*~>) (%w):(%d~%) you:(%d~%)

Value:
#VAR hp {%1}
#VAR hpm {%2}
#VAR mn {%3}
#VAR mnm {%4}
#VAR mv {%5}
#VAR mvm {%6}
#VAR xpn {%7}
#VAR g {%8}
#VAR al {%9}
#VAR aln {%10}
#VAR opp {%11}
#VAR leader {%12}
#VAR ldr {%13}
#VAR you {%14}

Prompt:
<1579/1579hp 156/156mn 940/940mv 17301888xpn 62470g align:evil -991 opp:<none> Grinnzock:100% you:100%>

Trigger response:
[(%d)/(%d)hp (%d)/(%d)mn (%d)/(%d)mv (%d)xpn (%d)g align:(%w) (%n) opp:(~<*~>) (%w):(%d~%) you:(%d~%)-> #VAR hp {}
#VAR hpm {}
#VAR mn {}
#VAR mnm {}
#VAR mv {}
#VAR mvm {}
#VAR xpn {}
#VAR g {}
#VAR al {}
#VAR aln {}
#VAR opp {}
#VAR leader {}
#VAR ldr {}
#VAR you {}]

Yes, I copied and pasted, etc etc etc.

EDIT:prompt typo
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Fri Jan 16, 2004 10:09 pm   
 
Try inputting it via the command line, then change it to a prompt trigger or whatnot via opening it up in Trigger window and changing its type:

#trigger {(%d)/(%d)hp (%d)/(%d)mn (%d)/(%d)mv (%d)xpn (%d)g align:(%w) (%n) opp:(~<*~>) (%w):(%d~%) you:(%d~%)} {#VAR hp {%1};#VAR hpm {%2};#VAR mn {%3};#VAR mnm {%4};#VAR mv {%5};#VAR mvm {%6};#VAR xpn {%7};#VAR g {%8};#VAR al {%9};#VAR aln {%10};#VAR opp {%11};#VAR leader {%12};#VAR ldr {%13};#VAR you {%14}}

If it still doesn't doesn't work, try debugging it. Delete the trigger, and replace with:

#trigger {(%d)/(%d)hp (%d)/(%d)mn (%d)/(%d)mv (%d)xpn (%d)g align:(%w) (%n) opp:(~<*~>) (%w):(%d~%) you:(%d~%)} {#ECHO %1;#ECHO %2;#ECHO %3;#ECHO %4;#ECHO %5;#ECHO %6;#ECHO %7;#ECHO %8;#ECHO %9;#ECHO %10;#ECHO %11;#ECHO %12;#ECHO %13;#ECHO %14}

If it echoes blanks, then you must've changed some setting in zMud, and it isn't setting %1-%14. Check to see if % is the special character for parameters, would be the first to check.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jan 16, 2004 11:50 pm   
 
Okay, I'm sorry. I misunderstood your post and I'm pretty much at a loss. Please don't feel insulted by any of this. I'm sure you aren't stupid. However, I've tested all of these triggers multiple times and they all work correctly for me. This includes duplicating all the copy/paste operations I've suggested.

The square brackets, [ and ], are from the Show Triggers preference. This should normally be disabled. This is not "the trigger response", it's a debugging aid which shows when a trigger fires, shows the trigger's pattern before the ->, and shows the output of the trigger (which is the actual "trigger response") after the ->.

Show Triggers indicates that you have the right pattern but aren't getting the values you should. If you are using the default Parameter character (%) then you should get #VAR hp {1579} as the first line of the trigger response. If you have disabled or altered the Parameter character, then you should get #VAR hp {%1}. There is no way I can think of for you to get #VAR hp {} unless you did omit the %# from the #VAR commands in the trigger.

You may have made some other changes to Prefs. If so, you'll need to either change these back to the defaults (and possibly change your current scripts) or make the necessary changes to any scripts you get from here. All scripts suggested on this forum, unless otherwise specified, assume default preferences. This is particularly true of Special Character and Script Parser prefs.

EDIT: Wow. Danlo's response hadn't been posted when I started working on this reply. In case you think anyone is taking this lightly, that means I've spent almost two hours on just this response.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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