Posted 21 July 2016 - 12:49 PM
Hello everyone,
I started learning ComputerCraft 2 days ago and I wanted to do a shooting range.
I have 13 targets with 1 computer behind every targets with this program:
So when the program is launched the target get up and when the target is hit it stop the program.
But I want that 1 computer randomly chose 1 of the 13 computer, launch the program, wait until the programs is close(when a target is hit) and chose another random computer ect… until 10 targets are been hitten then show how much time we took to take down the 10 target and close himself.
This has been 2 days and I can't figure how to do it so if someone could help me :)/>
I'm playing on the Ftb infinity Evolved modpack on a private server.
(I apologize for all of my grammar mistakes because english isn't my native language ^^)
I started learning ComputerCraft 2 days ago and I wanted to do a shooting range.
I have 13 targets with 1 computer behind every targets with this program:
redstone.setOutput("back",true)
while true do
sleep(0.1)
if redstone.getInput("left",true) then
redstone.setOutput("back",false)
return
end
end
So when the program is launched the target get up and when the target is hit it stop the program.
But I want that 1 computer randomly chose 1 of the 13 computer, launch the program, wait until the programs is close(when a target is hit) and chose another random computer ect… until 10 targets are been hitten then show how much time we took to take down the 10 target and close himself.
This has been 2 days and I can't figure how to do it so if someone could help me :)/>
I'm playing on the Ftb infinity Evolved modpack on a private server.
(I apologize for all of my grammar mistakes because english isn't my native language ^^)