Advertisement
Volaik

battlebud.lua

Oct 6th, 2023
1,149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require "fuel"
  2.  
  3. modem = peripheral.find("modem")
  4. ID = os.getComputerID()
  5. print("Buddy ID: "..ID)
  6.  
  7. rednet.open("left")
  8.  
  9. function relocate(n)
  10.     for i = 1,n,1 do
  11.     turtle.forward()
  12.     end
  13. end
  14.  
  15. while true do
  16.     event, sender, message, protocol = os.pullEvent("rednet_message")
  17.     if message == "con" then
  18.     print("connected")
  19.     elseif message == "relocate" then
  20.     print("we are moving")
  21.     turtle.turnLeft()
  22.     relocate(64)
  23.     turtle.turnRight()
  24.     refuel()
  25.     end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement