Posted 25 June 2016 - 08:11 PM
I'm making an elevator using railcraft with two carts. For now I'm working on the call button: a computer decides which elevator should be called; for now it check to see if a cart is idle and then calls that cart(If someone was to be using another elevator, it would not be called)
My setup:
http://imgur.com/vVZVymd
Calling an elevator works, the problem is that the reason there are two elevators and not one is so that multiple could be used at once: if someone was to call an elevator while one is running, it cannot be called until the other one is finished. I suppose I would need the same function to be called again while it's already running so the left elevator can operate at the same time.
Here is the code for the computer controlling when an elevator is called:
http://pastebin.com/AK0fwvE4
I am fairly new to LUA and computercraft but I understand basic programming concepts.
As you can probably guess, the right elevator will only ever get called while the left stays put. I am alright with this unless the right is currently in use.
I've been researching: would coroutines help me?
My setup:
http://imgur.com/vVZVymd
Calling an elevator works, the problem is that the reason there are two elevators and not one is so that multiple could be used at once: if someone was to call an elevator while one is running, it cannot be called until the other one is finished. I suppose I would need the same function to be called again while it's already running so the left elevator can operate at the same time.
Here is the code for the computer controlling when an elevator is called:
http://pastebin.com/AK0fwvE4
I am fairly new to LUA and computercraft but I understand basic programming concepts.
As you can probably guess, the right elevator will only ever get called while the left stays put. I am alright with this unless the right is currently in use.
I've been researching: would coroutines help me?