Computercraft and miningmachine code

  • FTB will be shutting down this forum by the end of July. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Recer75

New Member
Jul 29, 2019
11
0
0
Hi i am new to computercraft and i need some help white the code.
I want to start the machine whit a wireless redstone signal and stop it when its off.
I don't want to have to restart the program every time i stop the signal but i have been unsuccessful in every attempt to make this happen.

This is a scematic created whit world-edit
http://www.mediafire.com/?6qa66ea96uu0i2m

Code:
y = 0
if redstone.getInput ("top",true) then
  y = 0
end
if redstone.getInput ("top",false) then
  y = x + 10
end
repeat
  redstone.setOutput ("back",true)
  sleep (0,8)
  redstone.setOutput ("back",false)
  redstone.setOutput ("right",true)
  sleep (1.0)
  redstone.setOutput ("right",false)
  sleep (1.0)
  redstone.setOutput ("bottom",true)
  sleep (1.0)
  redstone.setOutput ("bottom",false)
until y == 10

I would appreciate any help and tips that can make this work. :)