Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("WilsonIntro")
- function newline()
- x, y = term.getCursorPos()
- z = y + 1
- term.setCursorPos(1, z)
- end
- function send()
- sh.send("SmartHelmet", tostring(input))
- end
- function wilson()
- term.write("Wilson: ")
- local ev, param1, param2 = os.pullEvent("key")
- if param1 == keys.e then
- newline()
- print("Exiting WilsonBot Program . . .")
- sleep(0.5)
- os.reboot()
- elseif param1 == keys.p then
- os.pullEvent("char")
- newline()
- term.write("Program: ")
- input = read()
- tostring(input)
- --send()
- shell.run(input)
- elseif param1 == keys.c then
- shell.run("clear")
- elseif param1 == keys.r then
- shell.run("WilsonIntro")
- elseif param1 == keys.h then
- newline()
- shell.run("help")
- elseif param1 == keys.q then
- newline()
- print("1. Back to WilsonBot")
- print("2. Chat")
- loop = true
- while loop == true do
- term.write("Program: ")
- local ev, param1, param2 = os.pullEvent("key")
- if param1 == keys.e then
- newline()
- print("Exiting WilsonBot Program . . .")
- sleep(0.5)
- os.reboot()
- elseif param1 == keys.c then
- shell.run("clear")
- loop = false
- elseif param1 == keys.h then
- newline()
- print("1. Back to WilsonBot")
- print("2. Chat")
- elseif param1 == 2 then
- newline()
- loop = false
- elseif param1 == 3 then
- shell.run("chat")
- else
- print("Unrecognized Command Or Program. Hit 'h' For Help")
- end
- end
- else
- print("Unrecognized Command. Hit 'h' If You Need Help")
- end
- end
- print("Do You Have A Smart Helmet Connected?")
- term.write("Y/N: ")
- input = read()
- --send()
- if input == "y" or input == "Y" or input == "Yes" or input == "yes" then
- term.write("Which Side?: ")
- input = read()
- tostring(input)
- sh = peripheral.wrap(input)
- print("Connected!")
- sh.send("SmartHelmet", "Connected!")
- elseif input == "n" or input == "N" or input == "no" or input == "No" then
- print("Ok! Skipping SmartHelm Connect")
- else
- print("Im Sorry, I Dont Understand. Please Enter 'Y' Or 'N'")
- end
- while true do
- wilson()
- end
Advertisement
Add Comment
Please, Sign In to add comment