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 ➜ General ➜ Scripting: Lua: If/else cases and how to use it

Scripting: Lua: If/else cases and how to use it

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


Posted by Arnumor   (11 posts)  Bio
Date Wed 04 Feb 2009 07:28 PM (UTC)
Message
I play an engineer in a mud called Legends of the Jedi. My character build ships, and each ship has 4 components to build on, with several attempts needed to complete each. The ship frames look like this, ones a couple components have been finished:

This looks like the frame for a Delta-Class JV-7 Escort Shuttle
This ship belongs to you.
Components till completion:
Hull: 1500
Circuits: 950
Weapons: 0
Engines: 0

The problem is, when I made a normal trigger that functions via the component displays that show 0 left, it loops, seeing the same '(Component): 0' over and over.

I need to know how to use an ifcheck function to check the engines for completion, and if they're done, then the weapons, and so forth. I'd prefer to have it all in one trigger, if possible.

The command used in-game to build these is 'buildship (ship name, delta in this case) (ship component on frame) (ship part item, which shares the component name on the frame)'

My variables that store which ships and parts to currently work on are as follows:

'Ship' For the shipname.
'ShipPart' For the component on the frame.
'Part' For the part item.

I really only need to change the ShipPart and Part contents, since the ships are all the same model.

I've been trying to figure out a way to go full-auto building ships for a long time, so any help would be appreciated. Keep in mind, I'm a bit of am amateur, so the simplest way of putting it is probably best.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 05 Feb 2009 02:33 AM (UTC)
Message
See: http://www.gammon.com.au/forum/bbshowpost.php?id=8754

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


9,207 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.