Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednetSide = "back"
- startPC = 4
- starting = false
- resultat = {0, 0, 0, 0}
- direction = {"bottom", "right", "top", "left"}
- rednet.open(rednetSide)
- function addLight(l, s)
- resultat[s] = resultat[s] + l
- end
- function removeLight(l, s)
- resultat[s] = resultat[s] - l
- end
- function clearLight(s)
- resultat[s] = 0
- end
- function clearAllLight()
- for i = 1, 4 do
- clearLight(i)
- end
- end
- function activeLight(s)
- resultat[s] = 65535
- end
- function activeAllLight()
- for i = 1, 4 do
- activeLight(i)
- end
- end
- function refresh()
- for i = 1, 4 do
- rs.setBundledOutput(direction[i], resultat[i])
- end
- end
- function defilement()
- for i = 1, 4 do
- mx = 15
- if i == 4 then
- mx = 1
- end
- for j = 0, mx do
- nombre = 2^mx
- addLight(nombre, i)
- refresh()
- sleep(0.3)
- clearLight(i)
- end
- end
- end
- function allMove(mt)
- for i = 1, mt do
- defilement()
- end
- end
- while starting == false do
- local id, msg, d = rednet.receive()
- if id ~= nil and msg ~= nil then
- if id == startPC and msg == "lancement" then
- starting = true
- end
- end
- sleep(0.1)
- end
- while starting == true do
- local id, msg, d = rednet.receive(0.1)
- if id ~= nil and msg ~= nil then
- if id == startPC and msg == "arret" then
- starting = false
- end
- end
- rndFunc = math.random(1, 3)
- if rndFunc == 1 then
- elseif rndFunc == 2 then
- elseif rndFunc == 3 then
- else
- end
- sleep(0.1)
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement