Advertisement
DoddyLeSel

GrueMitaineServeurPrincipal

Feb 22nd, 2025 (edited)
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | Gaming | 0 0
  1. rednet.open("top")
  2. rednet.host("grue2", "grue_dono2")
  3.  
  4. STATION = peripheral.wrap("right")
  5. CLUTCH = {peripheral.wrap("redstone_relay_9"), "right"}
  6. GEARSHIFT = {peripheral.wrap("redstone_relay_9"), "front"}
  7. GANTRY = {peripheral.wrap("redstone_relay_9"), "left"}
  8.  
  9. while true do
  10.     id, message, protocol = rednet.receive("grue2")
  11.    
  12.     if message == "assemble" then
  13.         STATION.assemble()
  14.         print("Assemble")
  15.     end
  16.    
  17.     if message == "disassemble" then
  18.         STATION.disassemble()
  19.         print("Disassemble")
  20.     end        
  21.    
  22.     if message == "clutch0" then
  23.         CLUTCH[1].setOutput(CLUTCH[2], false)
  24.     end
  25.    
  26.     if message == "clutch1" then
  27.         CLUTCH[1].setOutput(CLUTCH[2], true)
  28.     end
  29.    
  30.     if message == "gearshift0" then
  31.         GEARSHIFT[1].setOutput(GEARSHIFT[2], false)
  32.     end
  33.    
  34.     if message == "gearshift1" then
  35.         GEARSHIFT[1].setOutput(GEARSHIFT[2], true)
  36.     end
  37.    
  38.     if message == "gantry0" then
  39.         GANTRY[1].setOutput(GANTRY[2], false)
  40.     end
  41.    
  42.     if message == "gantry1" then
  43.         GANTRY[1].setOutput(GANTRY[2], true)
  44.     end    
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement