Posted 04 March 2014 - 12:35 AM
I have worked continuously on a program that I'm making, but I've run into an issue.
I know that it's probably a stupid question;however, I want to make the program save and then display text a certain amount of times (based on how many times I've clicked a button) and then display it in an "Activity Log" type thing. I've already gotten a working screen that displays text x amount of times based on variable going ,but whenever I return to the home of the program (To clear up any confusion, it is in the same program. This is not the entire program due to how messy and large the full one is), it clears the log. Is there a way to keep it so it can display the exact thing, or more, later? (I'll show how I've gotten it to print text based on how many times it's been clicked below)
Variables,(I have defined them!):
And here is my code for counting how many times I've clicked to do the above(NOTE: There are Ends but I didn't put them because they are found much, MUCH later):
So does anyone have any suggestions as to what I could do to write text to a log x amount of times, but not get deleted from log every time I return to the home screen of my program?
I know that it's probably a stupid question;however, I want to make the program save and then display text a certain amount of times (based on how many times I've clicked a button) and then display it in an "Activity Log" type thing. I've already gotten a working screen that displays text x amount of times based on variable going ,but whenever I return to the home of the program (To clear up any confusion, it is in the same program. This is not the entire program due to how messy and large the full one is), it clears the log. Is there a way to keep it so it can display the exact thing, or more, later? (I'll show how I've gotten it to print text based on how many times it's been clicked below)
function displayLog()
term.setCursorPos(1,3)
term.setBackgroundColor(colors.gray)
term.setTextColor(colors.black)
if logUpArrow > 0 then
while logUpArrow > 0 do
print("turtle.forward()")
logUpArrow = logUpArrow - 1
end
end
end
Variables,(I have defined them!):
logUpArrow = 0
--Nothing else necessary for this that I have
And here is my code for counting how many times I've clicked to do the above(NOTE: There are Ends but I didn't put them because they are found much, MUCH later):
function osScreen()
drawDesktop()
while logOpen == false do
local event, button, X, Y = os.pullEventRaw()
if event == "mouse_click" then
if X >=2 and X <=8 and Y==1 and button ==1 then
drawMenu1()
slc = 1
else
drawDesktop()
if X >= 21 and X <= 29 and Y >= 2 and Y <= 6 and button ==1 then
logUpArrow = logUpArrow + 1
bground = paintutils.loadImage("upArrowClick.nfp")
paintutils.drawImage(bground,1,1)
term.setCursorPos(32,2)
term.setBackgroundColor(colors.green)
print("turtle.forward()")
sleep(1)
bground = paintutils.loadImage("arrows.nfp")
paintutils.drawImage(bground,1,1)
So does anyone have any suggestions as to what I could do to write text to a log x amount of times, but not get deleted from log every time I return to the home screen of my program?
Edited on 04 March 2014 - 05:37 PM