[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  A few trigger errors I can't seem to figure out.
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

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

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Venator   (2 posts)  [Biography] bio
Date Mon 16 Mar 2015 11:06 PM (UTC)
Message
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
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #1 on Tue 17 Mar 2015 04:34 AM (UTC)
Message
Can we get some actual mud output to work with? Maybe some code blocks with indentation for easier reading as well?

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Venator   (2 posts)  [Biography] bio
Date Reply #2 on Wed 18 Mar 2015 06:55 PM (UTC)
Message
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!
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #3 on Wed 18 Mar 2015 08:04 PM (UTC)
Message
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.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 18 Mar 2015 09:40 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,926 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]