Guest User

test

a guest
Sep 7th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local term = require("term")
  2. function printSomething()
  3.  
  4.   print("what up?")
  5.   os.sleep(1) --to see that the io.read get skipped
  6.   local i = io.read()
  7. end
  8. while(true) do
  9.   term.clear()
  10.   print("enter a number")
  11.   print("1: do something")
  12.   print("2: do somethingelse")
  13.   local select = io.read("*n")
  14.   if select == 1 then printSomething() end
  15.   if select == 2 then printSomething() end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment