Posted 05 October 2018 - 01:53 PM
I'm doing a OS Startup animation, but because a part of it is simply a repeated animating, I'm using a function to call it easier. The thing is that, when I call that function, i don't know why, in the middle of the function, the code end without giving me any error code.
Here the code:
The problem is probably situated around…
Thanks for help and feel free to use my code while trying to debug it (He isn't done because I stopped working on the main part when I wanted to use that function)
Here the code:
function loadAnimation(state)
posTemp = term.getCursorPos()
term.setCursorPos(26,13)
term.setBackgroundColor(colors.blue)
if (state == 0) then
write("+")
end
if (state == 1) then
write("x")
end
term.setCursorPos(posTemp)
term.setBackgroundColor(colors.white)
sleep(1)
end
term.setBackgroundColor(colors.blue)
term.setCursorBlink(false)
term.setTextColor(colors.white)
term.clear()
term.setCursorPos(19,5)
textutils.slowPrint("MeuleuhOS v1.0")
write("Initializing OS...")
loadAnimation(0)
term.setCursorPos(10,10)
term.setBackgroundColor(colors.white)
write("|")
term.setCursorPos(positionTemporaire)
sleep(5)
write("||||||||||||||||||||||||||||||||")
term.setBackgroundColor(colors.blue)
term.setCursorPos(15,15)
write(" OS Initialized ")
sleep(5)
The problem is probably situated around…
function loadAnimation(state)
posTemp = term.getCursorPos()
term.setCursorPos(26,13)
term.setBackgroundColor(colors.blue)
if (state == 0) then
write("+")
end
if (state == 1) then
write("x")
end
term.setCursorPos(posTemp) --Here
term.setBackgroundColor(colors.white) --or here
sleep(1) --or here because the sleep doesn't occur either
end
Thanks for help and feel free to use my code while trying to debug it (He isn't done because I stopped working on the main part when I wanted to use that function)