Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Can't figure out where the error is. :-(

Can't figure out where the error is. :-(

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


Posted by Neoshain   (38 posts)  Bio
Date Sun 28 Jul 2013 09:29 PM (UTC)
Message
Alright, so I've been working on this MASSIVE plug-in to provide to the other players in my mud. It's going to be insane. I've already got over 60 aliases and about 150 triggers. I'm almost done with the whole thing.

One of the things I'm trying to do, (and I had it mostly worked out at one point) is a location tracker miniwindow.

I want the window to display two Constants:
"Location Tracker" as a title
"System" as one of the names of the locations.

These two have been very easy to do obviously, as they don't change. Even getting the Variable of what system (star systems) you are in is easy, because when you fly somewhere, there is a special space prompt that is given repeatedly. Easy-peasy Lemon Squeezy.

Now, I had it so if you were on a Capital Ship, directly under "System: [System]" was "Capital Ship: [ShipName]". But if the variable ShipName was "None" then instead it said "Planet: [Planet|None]"


Everything worked wonderfully.

As I continued to work on the rest of the plug-in, I realized there was a third type of place to be... Shipyards. So I tried to add a "Shipyard: [Shipyard]" into the equation, and now I get the following error code:

Quote:

Compile error
Plugin: Massive_LotS_Plugin (called from world: Star Wars: Legacy of the Sith)
Immediate execution
[string "Trigger: "]:49: '=' expected near 'ShipName'


I've searched for a spot that has ShipName without an "=" but can only find it in the spot where it doesn't need one... I think. Here is the trigger that is failing. (the variable itself is being set by other triggers, and they are working correctly. I keep checking them, to make sure they change properly)


<trigger
   enabled="y"
   group="LocationTracker"
   match="\-Hp\:(.*?)\/(.*?)\&gt;\-Cr\:(.*?)\&gt;\-\&gt;"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>win = "LocWin_" .. GetPluginID ()
WindowCreate (win, 0, 0, 300, 80, miniwin.pos_top_right, 0, ColourNameToRGB("gray"))  -- create window
WindowShow (win,  true)  -- show it 
WindowGradient (win, 0, 0, 300, 80, 
                ColourNameToRGB ("blue"), 
                ColourNameToRGB ("darkblue"), 
                miniwin.gradient_vertical)  -- top to bottom

WindowRectOp (win, miniwin.rect_draw_edge, 0, 0, 300, 80, 
              miniwin.rect_edge_raised, 
              miniwin.rect_edge_at_all)  -- raised, not filled

WindowFont (win, "heading", "Times New Roman", 16, true, false, false, false)
WindowFont (win, "normal", "Times New Roman",  14, false, false, false, false)
WindowFont(win, "bold", "Times New Roman", 14, true, false, false, false)

WindowText (win, "heading", "Location Tracker",
            85, 5, 0, 0,  -- rectangle
            ColourNameToRGB ("pink"), 
            false) -- not Unicode

WindowText (win, "normal", "System: ",
            42, 35, 0, 0,  -- rectangle
            ColourNameToRGB ("white"), 
            false) -- not Unicode

WindowText (win, "bold", System,
            120, 35, 0, 0,  -- rectangle
            ColourNameToRGB ("yellow"), 
            false) -- not Unicode

<!-- To change from Shipyard to Planet to Capital Ship -->

if ShipName == "None" and Shipyard == "None" then
WindowText (win, "normal", "Planet: ",
            52, 55, 0, 0,  -- rectangle
            ColourNameToRGB ("white"), 
            false) -- not Unicode

WindowText (win, "bold", Planet,
            120, 55, 0, 0,  -- rectangle
            ColourNameToRGB ("yellow"), 
            false) -- not Unicode


elseif Planet == "None" and Shipyard == "None" then
WindowText (win, "normal", "Capital Ship: ",
            5, 55, 0, 0,  -- rectangle
            ColourNameToRGB ("white"), 
            false) -- not Unicode

WindowText (win, "bold", Shipname,
            120, 55, 0, 0,  -- rectangle
            ColourNameToRGB ("yellow"), 
            false) -- not Unicode


Elseif ShipName == "None" and Planet == "None" then
WindowText (win, "normal", "Shipyard: ",
            20, 55, 0, 0,  -- rectangle
            ColourNameToRGB ("white"), 
            false) -- not Unicode

WindowText (win, "bold", Shipyard,
            120, 55, 0, 0,  -- rectangle
            ColourNameToRGB ("yellow"), 
            false) -- not Unicode


end -- if

 
</send>
  </trigger>



I'm stumped. I'm not sure if I used "and" correctly...
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #1 on Sun 28 Jul 2013 09:38 PM (UTC)
Message
Quote:
Elseif

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Neoshain   (38 posts)  Bio
Date Reply #2 on Sun 28 Jul 2013 09:57 PM (UTC)
Message
Wow. I knew it was something that simple. Gosh. Thank you!

One capitalized "e" ruined the entire plugin.
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.


14,013 views.

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

Go to topic:           Search the forum


[Go to top] top

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