Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hasMon = false;
- if peripheral.isPresent("top") then
- hasMon = true;
- mon = peripheral.wrap("top");
- print("Monitor was found!");
- mon.clear();
- end
- function printm(str)
- if type(str) ~= "string" then return end
- print(str);
- mon.write(str);
- end
- function add()
- printm("adding");
- end
- function remove()
- printm("removing");
- end
- function start()
- while true do
- printm("What would you like to do?");
- printm(" - Type \"add\" to add an item");
- printm(" - Type \"remove\" to add an item");
- printm(" - Type \"quit\" to save and quit");
- ans = read();
- if type(ans) == "string" then
- if ans == "add" then add();
- if ans == "remove" then remove();
- if ans == "quit" then
- printm("Goodbye!");
- os.shutdown();
- end
- end
- end
- end
- start();
Advertisement
Add Comment
Please, Sign In to add comment