Posted 01 June 2016 - 02:12 PM
So I have a E-Mail GUI. Each mail is 2 lines so I want it so that when you click on eihter of these lines it opens the same email. My problem is that it always opens the first mail. I get the Y line in a seperate function and is returned as "linePos" and openMail is the number of the mail that should be opened. Now as you can see I am printing them both on at the bottom and the outcome is: linePos as is should be (1-20) but openMail is always 1
Heres the code:
Heres the code:
while true do
returnButton()
nextButton()
openMail = nil
if linePos == 2 then
sendMail()
elseif linePos == 3 or 4 then
openMail = 1
elseif linePos == 5 or 6 then
openMail = 2
elseif linePos == 7 or 8 then
openMail = 3
elseif linePos == 9 or 10 then
openMail = 4
elseif linePos == 11 or 12 then
openMail = 5
elseif linePos == 13 or 14 then
openMail = 6
elseif linePos == 15 or 16 then
openMail = 7
elseif linePos == 17 or 18 then
openMail = 8
elseif pressedButton == 7 then
pressedButton = nil
interface()
return
else openMail = nil
end
term.setCursorPos(1,16)
print(linePos)
print(openMail)
sleep(1)
OpenMail()
end
Edited on 01 June 2016 - 12:27 PM