Advertisement
AnonymusHochgenuss

chunkworker

Jul 15th, 2021 (edited)
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. rednet.open("right")
  2. shell.run("updater")
  3. function check()
  4.  id, text = rednet.receive(4)
  5. end
  6. function checkup()
  7.  text = false
  8.  while not text do
  9.   check()
  10.  end
  11. end
  12. function locate()
  13.  x, y, z = gps.locate()
  14. end
  15. while true do
  16.  while true do
  17.   checkup()
  18.   if text == "chunkloader" then
  19.    print("sending answere")
  20.    rednet.send(id,"available")
  21.    print("setting id1")
  22.    id1=id
  23.    text=false
  24.    t=0
  25.    print("starting loop")
  26.    while t < 1 do
  27.     print("checking up")
  28.     checkup()
  29.     if id == id1 then
  30.      print("id correct")
  31.      if text == "goto" then
  32.       t=1
  33.      end
  34.     end
  35.    end
  36.    print("chunkloader requested")
  37.    checkup()
  38.    while not id == id1 do
  39.     checkup()
  40.    end
  41.    x1=tonumber(text)
  42.    checkup()
  43.    while not id == id1 do
  44.     checkup()
  45.    end
  46.    y1=tonumber(text)
  47.    checkup()
  48.    while not id == id1 do
  49.     checkup()
  50.    end
  51.    z1=tonumber(text)
  52.    print("goto "..x1..", "..y1..", "..z1)
  53.    shell.run("goto "..x1.." "..y1.." "..z1)
  54.    rednet.send(id1,"ready")
  55.   end
  56.   text = false
  57.  end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement