Advertisement
Guest User

Rainbow2

a guest
May 25th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local wool
  2.  
  3. rednet.open("left") --enable modem on the left side of the PC
  4. id,message = rednet.receive() --wait until a mesage is received
  5.  
  6. if message == "WHOA! Double Rainbow!" then
  7.  rednet.send(id,"Beginning rainbow harvest.") -- send a message to only the PC with ID
  8.  
  9.  while true do
  10.   event, id, message = os.pullEvent()
  11.  
  12.   if event == "rednet_message" then
  13.          if message == "Rest at ease." then
  14.             print("Stopping harvest.")     
  15.                rednet.broadcast("Taking a break.") -- Send to all PCs in range         
  16.                break
  17.              else
  18.               sheer()
  19.           end
  20.   end
  21.  end
  22. end
  23.  
  24. rednet.close("left") -- disable modem on the left side of the PC
  25.  
  26.  
  27. local function sheer()
  28.    turtle.select(1)
  29.    turtle.place()
  30.    turtle.turnRight()
  31.    turtle.place()
  32.    turtle.turnRight()
  33.    turtle.place()
  34.    turtle.turnRight()
  35.    turtle.place()
  36.    turtle.turnRight()
  37.    turtle.select(2)
  38.    wool = turtle.getItemCount()
  39.    turtle.dropUp()
  40.    rednet.send(id,"Harvested" ..wool.. "wool.")
  41.    os.sleep(15)
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement