Posted 29 July 2013 - 06:54 PM
Hey Guys.
Having another problem with my script. I am encouting the error when you loop too many functions together. This has happend in every code within the project I have sorted them all out but this one. If you can help me with this I would appricate it a lot. The main problem is that I need to work how it work how it does now simply because two of the functions serve as a checking to see if the Peripheral is pulling the right information. (Chat Box)
Code:
function main()
a, b, c = os.pullEvent("chat")
if b == "MayContainVennom" or b == "Omnibare" or b == "DuckDastardly" or b == "reeceurnot" then
stepTwo()
else
main()
end
end
function stepTwo()
if string.find(c,"!add") ~= nil then
cb.say("What do you want adding "..b.."?")
stepThree()
else
main()
end
end
function stepThree()
d, e, f = os.pullEvent("chat")
l = fs.open("disk/Tasks", "a")
if e == b then
l.writeLine("- "..f)
l.close()
main()
else
stepThree()
end
end
main()
Having another problem with my script. I am encouting the error when you loop too many functions together. This has happend in every code within the project I have sorted them all out but this one. If you can help me with this I would appricate it a lot. The main problem is that I need to work how it work how it does now simply because two of the functions serve as a checking to see if the Peripheral is pulling the right information. (Chat Box)
Code:
Spoiler
cb = peripheral.wrap("top")function main()
a, b, c = os.pullEvent("chat")
if b == "MayContainVennom" or b == "Omnibare" or b == "DuckDastardly" or b == "reeceurnot" then
stepTwo()
else
main()
end
end
function stepTwo()
if string.find(c,"!add") ~= nil then
cb.say("What do you want adding "..b.."?")
stepThree()
else
main()
end
end
function stepThree()
d, e, f = os.pullEvent("chat")
l = fs.open("disk/Tasks", "a")
if e == b then
l.writeLine("- "..f)
l.close()
main()
else
stepThree()
end
end
main()