Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function terminal()
- local cmd
- write("Lavapump-MCU>")
- cmd = read()
- return cmd
- end
- function process()
- while true do
- local ccmdipt = terminal()
- local command = {}
- local loop = 1
- for cmd in string.gmatch(ccmdipt, "%a+") do
- local command[loop] = cmd
- loop = loop + 1
- end
- if command[1] == "cmd1" then
- --do stuff
- write("cmd1")
- elseif command[1] == "cmd2" then
- --do stuff
- else
- print("Unknow command type help <command> for help")
- end
- end
- end
- process()
Advertisement
Add Comment
Please, Sign In to add comment