Posted 27 June 2013 - 12:55 PM
I wrote a score checking program based on redstone input, but when I run it says "204" after around one cycle of the program running.
code:
code:
local i=75
local lava="s"
local r="off"
local red="off"
local own="s"
local off=false
local back
local right
function rcheck()
right=redstone.getInput("right")
back=redstone.getInput("back")
if back==true then
r="on"
own="n"
elseif back==false then
r="off"
own="s"
elseif right==true then
off=true
end
end
function own()
rcheck()
if r~=red and own=="n" then
rednet.broadcast("lava(n)")
red=r
sleep(30)
own()
elseif r~=red and own=="s" then
rednet.broadcast("lava(s)")
red=r
sleep(3)
elseif off==true then
for i=1, 75, 1 do
rednet.broadcast("lava(o)")
sleep(1)
end
else
sleep(1)
own()
end
end
while true do
own()
end