View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Thu Jan 12, 2017 9:40 am Post subject: Getting variables from text file |
|
|
Hi there,
Code: | function checkIt()
tr_check = UDF1.CELabel1.Caption
if tr_check == "Changeable" then
f = io.open("TrainerStuffs.txt", "r")
else
f = io.open("TrainerFixed.txt", "r")
end
-- local f = io.open(file, "rb")
if f ~= nil then
// ....get variables from opened file
cekT = f:read("*line")
UDF1.CELabel1.Caption = cekT
else
showMessage("Can't find data file. Trainer properties set to last saved")
return
end
if cekT == "Changeable" then
UDF1.CEButton1.Enabled = true
else
UDF1.CEButton1.Enabled = false
end
end
checkIt() |
Why the function always open "TrainerStuffs.txt" even CELabel1.Caption has change to not equal "Changeable" ?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Thu Jan 12, 2017 10:15 am Post subject: |
|
|
add a print(tr_check) and confirm it's not 'Changeable'
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Thu Jan 12, 2017 2:41 pm Post subject: |
|
|
Thanks DB,
Sorry for stupid question. I miss one point, UDF1.CELabel1.Caption has set to "Changeable" as default on form designer, to make CEButton1.Enabled = true or false, of course need to check stored variable for CELabel1.Caption called from text file, Changeable or Fixed.
I am on my work for that
Regards
|
|
Back to top |
|
|
|