Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Button click
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
TheyCallMeTim13
Wiki Contributor
Reputation: 51

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Feb 26, 2022 12:07 pm    Post subject: Reply with quote

The error is somewhere else, since "expvalue = tonumber(CheatPanel.CEEdit1.Text)" didn't throw an error the problem is somewhere else in your code.
_________________
Back to top
View user's profile Send private message Visit poster's website
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Sat Feb 26, 2022 12:35 pm    Post subject: Reply with quote

TheyCallMeTim13 wrote:
The error is somewhere else, since "expvalue = tonumber(CheatPanel.CEEdit1.Text)" didn't throw an error the problem is somewhere else in your code.


You know that's one reason I opened the thread, but where?
I have been experimenting.
Code:

print("Before first function");
function FormShow(sender)
print("After first function");
--form_show(CheatPanel);
--
t = createTimer(nil, true);
timer_onTimer(t, MaxHP)
timer_setInterval(t, 500)--checks every 500 milliseconds
timer_setEnabled(t, false)
print("God Mode is not enabled");

With form_show(CheatPanel); within the first function the CheatPanel doesn't show, but when I put that line outside the first function Cheat panel shows up. In both cases "God Mode is not enabled" isn't printed. The Before first function is the only print output. In that case it seems like the "whole" code isn't run, but why?
Back to top
View user's profile Send private message Yahoo Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sat Feb 26, 2022 8:13 pm    Post subject: Reply with quote

Quote:
....You know that's one reason I opened the thread, but where?


Tracing Lua fault :

https://forum.cheatengine.org/viewtopic.php?p=5490226#5490226

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Sun Feb 27, 2022 7:25 am    Post subject: Reply with quote

Nice but no instructions on how to get the code to read and digest my code.

ETA: As posted in the linked thread, the code creates a button on the debug window. After pushing it, the code seems to be in an undefined loop and outputs no useful information to me. Nice try to help. Thanks
Back to top
View user's profile Send private message Yahoo Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun Feb 27, 2022 8:17 pm    Post subject: Reply with quote

Back to the first topic. I think you need declare or state the variables first.
i.e :

Code:
local expvalue, value
local txt = 10  -- simulated edit box value

function CEButton1Click()
         if tonumber(txt) ~= nil then
            value = tonumber(txt);
            print(value)
         end
            expvalue = value;
            print("The experience entered " .. tostring(expvalue));
end

CEButton1Click()

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Mon Feb 28, 2022 8:26 am    Post subject: Reply with quote

Corroder wrote:
Back to the first topic. I think you need declare or state the variables first.
i.e :

Code:
local expvalue, value
local txt = 10  -- simulated edit box value

function CEButton1Click()
         if tonumber(txt) ~= nil then
            value = tonumber(txt);
            print(value)
         end
            expvalue = value;
            print("The experience entered " .. tostring(expvalue));
end

CEButton1Click()


That is a new one for me. I know you need to place a function prior to any call to/for that function. DB 101.
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites