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 )
- print ( "RUN CraftOS/rom/programs/>" )
- input = read ()
- end
- resetScreen()
- -- Commands
- local cmd1 = "battleship"
- local cmd2 = "chillis"
- local cmd3 = "changeInventory"
- local cmd4 = "help"
- local help = "?"
- local cmd5 =
- local cmd6 =
- local cmd7 =
- local cmd8 =
- local cmd9 =
- local cmd10 =
- local cmd11 =
- local cmd12 =
- local cmd13 =
- local cmd14 =
- local cmd15 =
- local cmd16 =
- local cmd17 =
- local cmds = { "battleship", "chillis", "changeInventory", "help"}
- -- Command functions
- -- 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
- local event, key = os.pullEvent ( "key" )
- textutils.slowPrint ( "Press E when done loading/unloading...", 30 )
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement