This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
subaru_k's profile picture

Elevator code

Started by subaru_k, 17 May 2013 - 02:38 AM
subaru_k #1
Posted 17 May 2013 - 04:38 AM
Title: Elevator code

Lets start by saying im new to lua coding, there may be many things i've done wrong in my code but i've tried my best. The problem i have is that when i run my program, it actually doesn't for reasons unknown to me. Please if you have time and are willing to help me (a noob) to find what i did wrong it will be very appreciated.

Code http://pastebin.com/K2mAGJF2
LordIkol #2
Posted 17 May 2013 - 09:47 AM
just had a quick look but the reason that its not working is that you not tell him to do sth.

you defined all the functions but you are not executing them

simply add



while true do
main()
sleep(1)
end

at the end of your code and it will do sth.

and in line 40 it should be


print("Please Enter A Valid Floor Number") -- you had Print with capital P

Line 20 should be this


elseif input == "quit" then -- you had quit without " "

Greets
Loki
subaru_k #3
Posted 17 May 2013 - 10:27 AM
Thank you very much for your help :)/>

+kudos