Advertisement
Guest User

Miner

a guest
Feb 13th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. rednet.open("right")
  2. local func
  3. local tArgs = {...}
  4.  
  5.  
  6. function place()
  7.    turtle.select(1)
  8.    turtle.place()
  9.    turtle.down()
  10.    turtle.select(2)
  11.    turtle.place()
  12. end
  13.  
  14. function remove()
  15.    turtle.select(2)
  16.    turtle.dig()
  17.    turtle.up()
  18.    turtle.select(1)
  19.    turtle.dig()
  20. end
  21.  
  22.  
  23. function cycle()
  24.    place()
  25.    sleep(25)
  26.    while turtle.getItemCount(1) > 0 do
  27.       cleanup()
  28.       sleep(2)
  29.    end
  30.    remove()
  31.    turtle.forward()
  32. end
  33.  
  34. function checkIn(fromID)
  35.    rednet.send(fromID, tArgs[1])
  36. end
  37.  
  38. function chunkLoad()
  39.    turtle.select(1)
  40.    turtle.digUp()
  41.    turtle.forward()
  42.    turtle.placeUp()
  43. end
  44.  
  45. while true do
  46.    local id,msg,dist = rednet.receive()
  47.    func = loadstring(msg.."(...)")
  48.    setfenv(func, getfenv())
  49.    func(id)
  50.    rednet.send(id,"Done")
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement