A few trigger errors I can't seem to figure out.

Posted by Venator on Mon 16 Mar 2015 11:06 PM — 5 posts, 22,975 views.

#0
Using a trigger to set up variables from my multi line prompt. I plan to create I miniwindow to organize and display this information. I created 3 separate triggers to successfully gag the prompt, and the first trigger with my HP/SP/EP works well.
My second and third triggers I get the following errors.

Compile error
World: Icesus
Immediate execution
[string "Trigger: Prompt_2"]:7: unexpected symbol near '='
Compile error
World: Icesus
Immediate execution
[string "Trigger: Prompt_3"]:4: malformed number near '1st'


I can't seem to figure out what is unexpected in prompt 2, and in prompt 3 it seems that the 1st/2nd included in the hour is messing it up.

Will include my 3 triggers below:
prompt_1
<HP: */* (* / *) SP: */* (*/*) EP: */* (*/*)>

to script
HP_Percent = %1
HPMax_Percent = %2
HP = %3
HPMax = %4

SP_Percent = %5
SPMax_Percent = %6
SP = %7
sPMax = %8

EP_Percent = %9
EPMax_Percent = %10
EP = %12
EPMax = %13

prompt_2
<Exp: * (Tnl: * (*) Tna: * (*)>

Exp = %1

Exp_Tnl = %2

Exp_Tnl_Percent = %3

Exp_Tna = %4

Exp_Tna_Percent = %5

Prompt_3
<Cash: * DF: * * Hour:( * )Status: (*) Reinctax: *>

Cash = %1
DF = %2
Light_Cycle = %3
Hour = %4
Status = %5
Reinc_Tax = %6

Any help would be greatly appreciated! :)

Thanks in advance
USA #1
Can we get some actual mud output to work with? Maybe some code blocks with indentation for easier reading as well?
#2
These are the 3 lines in my prompt I am trying to get data from:

<HP: 100/100 (981 / 981) SP: 100/100 (467/467) EP: 99/100 (1347/1355)>
<Exp: 430426 (Tnl: 1109977 (27%) Tna: -214688 (27%)>
<Cash: 965 DF: 46931 day Hour:( Afternoon (2nd) )Status: () Reinctax: none>

The triggers in my first post, named prompt_1, prompt_2 and prompt_3 should be picking up this data to store it. I haven't even set it up to execute yet, I just wanted to figure out why it wasn't extracting the data first, before I commenced to creating the miniwindow.

Not sure if that clarified what you were asking? The code blocks were simply setting variables as the varying wildcards, so not sure how to indent it any better? I am a beginner at this in case that isn't obvious. :D
And thanks for the quick reply!
USA #3
Asking for code blocks was a half awake sleep deprived attempt at asking for copies of the actual triggers from MC with preserved formatting so we can see what's going on more easily. The actual prompt does help though, the malformed number error doesn't make any sense without seeing the formatting.

At first glance though, there's some serious refinement to be done with your data capture because you're using greedy variables. By that I mean the first * in <HP: */* (* / *) SP: */* (*/*) EP: */* (*/*)> is capturing eveything else on that prompt line and trying to assign it to %1, the 2nd * is capturing everything beyond its placement to assign to %2 etc etc etc. Even if the variables are assigning properly, you aren't going to get the results you expect with those triggers.
Australia Forum Administrator #4
Quote:

The triggers in my first post, named prompt_1, prompt_2 and prompt_3 ...


We mean like this:

Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.