Demos_

MinecraftLua_FlowerCmd

Jan 21st, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. -- CmdFlower
  2.  
  3. -- Basic Behaviour
  4. -- ================
  5.  
  6. -- Wait for turtle ack
  7. -- do redstone activation
  8. -- rewait
  9.  
  10. -- modem on the right of the computer
  11.  
  12. rednetHostname = "cmdFlower"
  13. rednet.open("right")
  14. rednetProtocol = "flower"
  15. rednetTimeout = 40 -- sec
  16. rednet.host(rednetProtocol,rednetHostname)
  17.  
  18. redstone.setOutput("back",false)
  19. redstone.setOutput("left",true)
  20.  
  21. function RedstoneTrick()
  22.     redstone.setOutput("back",true)
  23.     os.sleep(0.5)
  24.     redstone.setOutput("left",false)
  25.     os.sleep(0.5)
  26.     redstone.setOutput("left",true)
  27.     os.sleep(0.5)
  28.     redstone.setOutput("back",false)
  29. end
  30.  
  31. while true do
  32.     id,msg,p,d = rednet.receive(rednetProtocol)
  33.     if msg then
  34.         RedstoneTrick()
  35.     end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment