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 


Unwanted display of edit oxe

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Sun Apr 14, 2019 4:38 pm    Post subject: Unwanted display of edit oxe Reply with quote

I have 4 edit boxes that I want to display enemy hp.
Code:
   self.tde = createTimer(nil);
   self.tde.Interval = 2000;
   self.tde.onTimer = DisplayEdits;
   self.tde.Enabled = false;

The timer is enabled once another function is run
Then
Code:
   function DisplayEdits()
   local AL = getAddressList();
   if tonumber(battlebyteaddress.Value) == 32 then
   self.enemy1hp.Caption = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(AL, "Enemy #1 Cur Hp"))
   self.enemy2hp.Caption = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(AL, "Enemy #2 Cur Hp"))
   self.enemy3hp.Caption = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(AL, "Enemy #3 Cur Hp"))
   self.enemy4hp.Caption = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(AL, "Enemy #4 Cur Hp"))
   else
   self.enemy1hp.Caption = " "
   self.enemy2hp.Caption = " "
   self.enemy3hp.Caption = " "
   self.enemy4hp.Caption = " "
   end;--if tonumber(battlebyteaddress.Value) == 32 then
   end--function DisplayEdits


The problem values are displayed even when the If statement is NOT true.

Any help would be appreciated.
Back to top
View user's profile Send private message Yahoo Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Apr 14, 2019 11:31 pm    Post subject: Reply with quote

first, editBox not use 'Caption', use 'Text'. So, it should CEEdit.Text.
in your case are 'enemy1hp.Caption' should be 'enemy1hp.Text'..etc


Code:
tde = createTimer(nil);
tde.Interval = 2000;
tde.onTimer = DisplayEdits;
tde.Enabled =  true ---false;


function DisplayEdits()
 local local al = AddressList or getAddressList()
 local hp_1 = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(AL, "Enemy #1 Cur Hp"))
 local hp_2 = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(AL, "Enemy #2 Cur Hp"))
 local hp_3 = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(AL, "Enemy #2 Cur Hp"))
 local hp_4 = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(AL, "Enemy #2 Cur Hp"))
 local mr1 = battlebyteaddress.Value
 local x = ""

if mr1 == 32 then
 tde.Enabled = false
 enemy1hp.Text = toString(hp_1)
 enemy2hp.Text = toString(hp_2)
 enemy3hp.Text = toString(hp_3)
 enemy4hp.Text = toString(hp_4)
else
 enemy1hp.Text = x
 enemy2hp.Text = x
 enemy3hp.Text = x
 enemy4hp.Text = x
 end
end

_________________
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: 577

PostPosted: Mon Apr 15, 2019 3:20 pm    Post subject: Reply with quote

Thanks
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
Page 1 of 1

 
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