Chaos_Cash

drill.lua

Oct 26th, 2025 (edited)
1,128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. local rs_output = {}
  2. rs_output.__index = rs_output
  3. local other_id = 1
  4. rednet.open("back")
  5.  
  6. function rs_output:new(side)
  7.     local object_table = {side = side}
  8.     setmetatable(object_table, self)
  9.     return object_table
  10. end
  11.  
  12.  
  13.  
  14. function rs_output:enable()
  15. print(self.side, "enable")
  16.     rs.setOutput(self.side ,true)
  17. end
  18.  
  19.  
  20.  
  21. function rs_output:disable()
  22. print(self.side, "disable")
  23.     rs.setOutput(self.side ,false)
  24. end
  25.  
  26.  
  27.  
  28. function rs_output:get_input()
  29.     return rs.getInput(self.side)
  30. end
  31.  
  32.  
  33.  
  34.  
  35. local gearshift = rs_output:new("right")
  36. local sticker = rs_output:new("top")
  37.  
  38. rednet.send(other_id)
  39. repeat
  40. until rednet.receive() == other_id
  41. sleep(1)
  42. sticker:enable()
  43. sleep(0.2)
  44. sticker:disable()
  45. gearshift:enable()
  46. repeat
  47. until rednet.receive() == other_id
  48. gearshift:disable()
  49. sleep(0.1)
  50. rednet.send(other_id)
Advertisement
Add Comment
Please, Sign In to add comment