Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- variable declarations
- location = {"Dav","Orrnos","Dani","Mange","Helnrei/Bagger","Slew/Akeroh","City","FantaCWriteR Subway","FantaCWriter Tower","Xerxus","Sriseru","Ke6lgr/","Talon","Callak"}
- freqloc = {"red","magenta","pink","brown","orange","yellow","lime","green","gray","light blue","cyan","blue","purple","light gray"}
- colorcode = {16384,4,64,4096,2,16,32,8192,128,8,512,2048,1024,256}
- x = 0
- north = false
- east = false
- returneast = false
- west = false
- returnwest = false
- -- user prompting...note 14 is changed for number of locations
- term.clear() -- Clears the screen
- term.setCursorPos(1,1) -- Fixes the cursor position
- print("Hello. Please choose a destination by number:")
- repeat
- x=x+1
- print (x..": "..location[x])
- until x == 14
- -- user input
- input = 0
- repeat
- input = tonumber(io.read())
- if (input <= 0) then
- print("Please choose by number.")
- elseif (input >x) then
- print("Please choose by number.")
- elseif (input == nil) then
- print("Please choose by number.")
- end
- until (input <= x) and (input >0)
- -- assigning frequencies
- color = freqloc[input]
- freq = 1042 + input
- if freq >= 1043 and freq <= 1047 then north = true
- end
- if freq >= 1056 and freq <= 1058 then east = true
- end
- if freq > 1052 then west = true
- end
- -- send pulses
- -- shell.run("redpulse","back",color,1,0.5)
- rs.setBundledOutput("back",colorcode[input])
- sleep(1)
- rs.setBundledOutput("back",0)
- if east then shell.run("redpulse","left",1,0.5)
- end
- if west then shell.run("redpulse","right",1,0.5)
- end
- if north or west then shell.run("redpulse","top",1,0.5)
- end
- print("Please proceed to cart launch and enjoy your journey.")
- -- check for east-west passage
- -- if east or west then
- -- if east then while not returneast do
- -- probe = shell.run("redprobe")
- -- if (probe == "back = 1 (white)") then returneast = true
- -- end
- -- end
- -- elseif west then while not returnwest do
- -- probe = shell.run("redprobe")
- -- if (probe == "back = 32768 (black)") then returnwest = true
- -- end
- -- end
- -- end
- -- end
Advertisement
Add Comment
Please, Sign In to add comment