Guest User

command

a guest
Mar 5th, 2014
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. rednet.open("back")
  2. os.loadAPI("button")
  3. local turtleID = 0
  4. local m = peripheral.wrap("top")
  5.  
  6. function fillTable()
  7.  button.clearTable()
  8.  m.clear()
  9.  button.setTable("Recharge", recharge, "", 8, 42, 16,18)
  10.  button.screen()
  11. end
  12.  
  13. function recharge()
  14.  button.flash("Recharge")
  15.  rednet.send(turtleID, "place")
  16.  local id, msg, dist = rednet.receive()
  17.  write("Done!")
  18. end
  19.  
  20. function getClick()
  21.    local event,side,x,y = os.pullEvent()
  22.    if event=="monitor_touch" then
  23.      if button.checkxy(x,y) then
  24.         print("button")
  25.         end
  26.     end
  27. end
  28.  
  29. fillTable()
  30. while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment