Guest User

password

a guest
Jul 17th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.89 KB | None | 0 0
  1. m = peripheral.wrap("right")
  2. term.redirect(m)
  3.  
  4. bg={path="/bg",xpos=1,ypos=1}
  5.  
  6. function backGround()
  7. term.setBackgroundColor(colors.black)
  8.   term.clear()
  9.   term.setCursorPos(bg["xpos"], bg["ypos"])
  10.   img = paintutils.loadImage(bg["path"])
  11.   paintutils.drawImage(img, bg["xpos"], bg["ypos"])
  12. end
  13.  
  14. function numbers()
  15.   term.setTextColor(colors.white)
  16.   term.setCursorPos(1, 2)
  17.   term.write("1")
  18.   term.setCursorPos(2, 2)
  19.   term.write("2")
  20.   term.setCursorPos(3, 2)
  21.   term.write("3")
  22.   term.setCursorPos(1, 3)
  23.   term.write("4")
  24.   term.setCursorPos(2, 3)
  25.   term.write("5")
  26.   term.setCursorPos(3, 3)
  27.   term.write("6")
  28.   term.setCursorPos(1, 4)
  29.   term.write("7")
  30.   term.setCursorPos(2, 4)
  31.   term.write("8")
  32.   term.setCursorPos(3, 4)
  33.   term.write("9")
  34.   term.setCursorPos(2, 5)
  35.   term.write("0")
  36. end
  37.  
  38. backGround()
  39. numbers()
  40.  
  41. local inp = 1
  42. local count = 0
  43.  
  44. while true do
  45.   local event,right,x,y = os.pullEvent()
  46.   if event == "monitor_touch" then
  47.     count = count+1
  48.     if x == 1 and y == 2 then
  49.       inp = inp*2
  50.     end
  51.     if x == 2 and y == 2 then
  52.       inp = inp*3
  53.     end
  54.     if x == 3 and y == 2 then
  55.       inp = inp*4
  56.     end
  57.     if x == 1 and y == 3 then
  58.       inp = inp*5
  59.     end
  60.     if x == 2 and y == 3 then
  61.       inp = inp*6
  62.     end
  63.     if x == 3 and y == 3 then
  64.       inp = inp*7
  65.     end
  66.     if x == 1 and y == 4 then
  67.       inp = inp*8
  68.     end
  69.     if x == 2 and y == 4 then
  70.       inp = inp*9
  71.     end
  72.     if x == 3 and y == 4 then
  73.       inp = inp*10
  74.     end
  75.     if x == 2 and y == 5 then
  76.       inp = inp*1
  77.     end
  78.     if inp == 72 then
  79.     term.setBackgroundColor(colors.green)
  80.     redstone.setOutput("top",true)
  81.     sleep(5)
  82.     redstone.setOutput("top", true)
  83.     inp = 1
  84.     count = 0
  85.     end
  86.     if count == 4 then
  87.     inp = 1
  88.     count = 0
  89.     term.setBackgroundColor(colors.red)
  90.     sleep(0.5)
  91.     end
  92.   end
  93. end
  94.  
  95.  
  96.  term.restore()
Advertisement
Add Comment
Please, Sign In to add comment