Advertisement
tima_gt

tde-redstone 3.2

Dec 25th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. os.loadAPI("clickAPI")
  2. os.loadAPI("advPrint")
  3. term.setBackgroundColor(colors.white)
  4. term.setTextColor(colors.gray)
  5. term.clear()
  6. button_1 = paintutils.loadImage("tde-r")
  7. on = false
  8. while true do
  9. paintutils.drawImage(button_1, 1, 1)
  10. term.setTextColor(colors.red)
  11. term.setBackgroundColor(colors.white)
  12. advPrint.tout(1, "X                    Redstone 3.0")
  13. local event, button, X, Y = os.pullEventRaw()
  14.   if event == "mouse_click" then
  15. if (X>=3 and Y>=3 and X<=13 and Y<=17) and (on == false) then
  16. on = true
  17. redstone.setOutput("back", true)
  18. elseif (X>=3 and Y>=3 and X<=13 and Y<=17) and (on == true) then
  19. on = false
  20. redstone.setOutput("back", false)
  21. elseif X == 1 and Y == 1 then
  22. break
  23. end
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement