Advertisement
Guest User

battlebud.lua

a guest
Oct 6th, 2023
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  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.  
  16. while true do
  17.     event, sender, message, protocol = os.pullEvent("rednet_message")
  18.     if message == "con" then
  19.     print("connected")
  20.     elseif message == "relocate" then
  21.     print("we are moving")
  22.     turtle.turnLeft()
  23.     relocate(64)
  24.     turtle.turnRight()
  25.     refuel()
  26.     end
  27. end
  28.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement