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

Posted by Neoshain on Sun 28 Jul 2013 09:29 PM — 3 posts, 14,584 views.

#0
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...
USA Global Moderator #1
Quote:
Elseif
#2
Wow. I knew it was something that simple. Gosh. Thank you!

One capitalized "e" ruined the entire plugin.