Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local coinCount = 0 --coins inserted
- function tenTimer() --starts 10 min timer and then turns rs on right side for 1 sec then turns rs off
- rs.setOutput("top", true)
- sleep(5)
- rs.setOutput("top", false)
- os.startTimer(600)
- rs.setOutput("right", true)
- sleep(1)
- rs.setOutput("right", false)
- end
- function twentyTimer() --starts 20 min timer and then turns rs on right side for 1 sec then turns rs off
- rs.setOutput("top", true)
- sleep(5)
- rs.setOutput("top", false)
- os.startTimer(1200)
- rs.setOutput("right", true)
- sleep(1)
- rs.setOutput("right", false)
- end
- function thirtyTimer() --starts 30 min timer and then turns rs on right side for 1 sec then turns rs off
- rs.setOutput("top", true)
- sleep(5)
- rs.setOutput("top", false)
- os.startTimer(1800)
- rs.setOutput("right", true)
- sleep(1)
- rs.setOutput("right", false)
- end
- local ten = 1
- local twenty = 2
- local thirty = 3
- print("How Much Time Would You Like To Buy?")
- print("1 Gold Coin = 10 Minutes.")
- print("You May ONLY Buy Up To 30 Minutes.")
- print("Enter Number Of Gold Coins:")
- write("$")
- goldCoins = read() -- i want it to ask the user to input gold coins, quanitity of 1-3
- while true do
- local event, p1 = os.pullEvent()
- if event == "redstone" then --if redstone pulse
- coinCount = coinCount + 1 --then add 1 to coinCount
- if goldCoins == coinCount and coinCount == ten then --if coinCount, coins they inserted, is equal to goldCoins, how many they said, then start 10 minute timer
- tenTimer()
- elseif goldCoins == coinCount and coinCount == twenty then --if coinCount, coins they inserted, is equal to goldCoins, how many they said, then start 20 minute timer, This is where my code seems to error "" bios:14: [string "startup"]:50: '=' expected ""
- twentyTimer()
- elseif goldCoins == coinCount and coinCount == thirty then --if coinCount, coins they inserted, is equal to goldCoins, how many they said, then start 30 minute timer
- thirtyTimer()
- else --if nothing is true then break
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement