Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Torje's user (user1)
- function resetScreen()
- term.clear ()
- term.setCursorPos ( 1,1 )
- end
- function keyBoard()
- print ( "RUN> ")
- local input = read()
- end
- resetScreen()
- keyBoard()
- -- Commands
- -- New commands variable thanks to Direwolf20! <3
- local cmds = { "battleship", "chillis", "changeInventory", "help"}
- -- Command functions
- function checkCMD()
- -- Command 1: Battleship host/join
- if input == (cmds[1]) then
- input2 = read ()
- if input2 == "host" then
- shell.run ( "fg battleship host" )
- end
- if input2 == "join" then
- shell.run ( "fg battleship join" )
- end
- if ( input2 ~= "host" ) and ( input2 ~= "join" ) then
- term.setTextColor ( colors.red )
- print ( "Invalid parameters" )
- sleep(1.5)
- shell.run ( "test" )
- end
- end
- -- Command 2: Chilli shower
- if input == (cmds[2]) then
- textutils.slowPrint ( "Chilli shower activated!", 30)
- rs.setOutput ( "back", true )
- sleep(1.5)
- rs.setOutput ( "back", false )
- shell.run ( "test" )
- end
- -- Change inventory between places!
- if input == (cmds[3]) then
- rednet.open ( "left" )
- while true do
- term.clear ()
- term.setCursorPos ( 1, 1 )
- term.write ( "Inventory: " )
- command = read ()
- rednet.broadcast ( command )
- while true do
- textutils.slowPrint ( "Press E when done loading/unloading...", 30 )
- local event, key = os.pullEvent ( "key" )
- if key == keys.e then
- rednet.broadcast ( "stop" )
- break
- end
- end
- end
- end
- -- Help program
- if input == (cmds[4]) or "?" then
- textutils.slowPrint ( "Command list: " )
- for i = 1, 4 do
- textutils.slowPrint ( cmds[i] )
- end
- end
- if input ~= (cmds[i]) then
- textutils.slowPrint ( "Unrecognized command...", 35 )
- end
- keyBoard()
- end -- Function ends here
- checkCMD()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement