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 


cheatcomponent setEditvalue problem.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Apr 12, 2012 4:35 am    Post subject: cheatcomponent setEditvalue problem. Reply with quote

cheatcomponent_setEditValue(CETrainer_CEEdit1, "555")// this do not work

cheatcomponent_setEditValue(CEEdit1, "555") // this gives access violation error.

I want to write 555 to the editbox.

_________________
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Thu Apr 12, 2012 6:34 am    Post subject: Reply with quote

From looking by the name :CEEdit, I'll assume that this isn't a TCheat object but actually just an editbox

An editbox has the following inheritance: WinControl->Control->Component->Object

This means that any of these class methods can be used on this object (so not cheatcomponent functions)

In your case, you'd want to use control_setCaption

Code:

control_setCaption(CETrainer_CEEdit1, "555")


alternatively, you could use the "Text" property using the setProperty method
Code:

setProperty(CETrainer_CEEdit1,"Text","555")

_________________
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
View user's profile Send private message MSN Messenger
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Apr 12, 2012 8:03 am    Post subject: Reply with quote

It is a Tcheat object.

I just draw it using the trainer interface. But I cannot retrieve values or write anything to it.



editbox.png
 Description:
 Filesize:  84.62 KB
 Viewed:  27316 Time(s)

editbox.png



_________________
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Thu Apr 12, 2012 8:21 am    Post subject: Reply with quote

No, it's not a tcheat component, it's a TCEEdit component (CEEdit1: TCEEdit in the object inspector)

Just use control_setCaption or setProperty to access it.

_________________
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
View user's profile Send private message MSN Messenger
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Apr 12, 2012 10:17 am    Post subject: Reply with quote

function onPostHotkey1(Hotkey)
--Executed after the "toggle*" cheat got executed
local memrec=memoryrecordhotkey_getOwner(Hotkey)
local isActive=memoryrecord_isActive(memrec) --get the state after the hotkey got triggered
cheatcomponent_setActive(CETrainer_CHEAT1, isActive)
if isActive then
--control_setCaption(CETrainer_CEEdit1, memoryrecord_getValue(memoryrec))
memoryrecord_setValue(memoryrec, tonumber(control_getCaption(CETrainer_CEEdit1) ))
end

if gBeepOnAction then
beep()
end
end

I want to add this lines. But the problem is that the code is generated when I press generate trainer. What should I do?


I tried the following steps:
1) Generate trainer for ct instead of exe
2) Edit lua script and save
Till now good but when I retry to create generate trainer for. It chew away non-Tcheat component.

_________________
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Thu Apr 12, 2012 10:55 am    Post subject: Reply with quote

Everything in the 'CHEATPANEL' object and in the script between --TRAINERGENERATORSTART-- and --TRAINERGENERATORSTOP-- will get erased and rebuild when you start the trainer generator

Once all the cheats are in rightclick the generate trainer button and choose the option to just generate the script

Now close the trainergenerator and never ever look at it again

go to table->cetrainer->edit
change the gui as you see fit
edit the script into whatever you feel like

click the save table button and save it as a .cetrainer or .exe (I also recommend saving as a .ct if you wish to make edits later)


also, memoryrecord_setValue prefers a string as value, but it should be able to work with numbers as well

_________________
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
View user's profile Send private message MSN Messenger
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Apr 12, 2012 12:16 pm    Post subject: Launch Error Reply with quote

I am using Beta 5+.
I tried to run the generated exe and got this error. Does exe files also requires ce to be installed?

I added this line:
supportCheatEngine(CETrainer, true, 468, 60, 2, '', '', 0)
It is showing only a blank white window with no ads?



fail cheat engine.png
 Description:
 Filesize:  13.86 KB
 Viewed:  27249 Time(s)

fail cheat engine.png



_________________
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Thu Apr 12, 2012 1:51 pm    Post subject: Reply with quote

Don't create tiny trainers, ce 6.2 needs to be fully installed for those (.cetrainer file extension registered and pointing to 6.2 for one)

as for the ads, it should show some text saying :this trainer was made with cheat engine which I can change depending on events (like releases etc...)
if you don't have internet explorer installed, it won't work though

try: supportCheatEngine(CETrainer, true, 468, 60)

_________________
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
View user's profile Send private message MSN Messenger
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Apr 12, 2012 9:40 pm    Post subject: Reply with quote

ct is working fine but when I create an EXE file cheats stop working?
_________________
Back to top
View user's profile Send private message Send e-mail
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Apr 13, 2012 4:31 am    Post subject: Reply with quote

Hmm, maybe attach your CT file here.

(you can slightly edit it if you want)

_________________
Back to top
View user's profile Send private message MSN Messenger
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Fri Apr 13, 2012 4:34 am    Post subject: Reply with quote

here it is. And what do you mean by edit?


TheIsland2.CT
 Description:

Download
 Filename:  TheIsland2.CT
 Filesize:  208.7 KB
 Downloaded:  1257 Time(s)


_________________
Back to top
View user's profile Send private message Send e-mail
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Apr 13, 2012 4:45 am    Post subject: Reply with quote

"And what do you mean by edit?"
Just cut parts that don't cause problems (by trial and hit/error).
Smaller code, faster analyzing.

_________________
Back to top
View user's profile Send private message MSN Messenger
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Fri Apr 13, 2012 4:46 am    Post subject: Reply with quote

The codes are too small. Please have a look to it.
_________________
Back to top
View user's profile Send private message Send e-mail
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Apr 13, 2012 4:55 am    Post subject: Reply with quote

I meant, if none of cheats working, you could delete "God Mode". That way we analyze rest of code (smaller code).


Edit:
OK, try save your trainer EXE file with different name
TheIsland2.exe - bad
TrainerTheIsland2.exe - good

_________________


Last edited by mgr.inz.Player on Fri Apr 13, 2012 4:58 am; edited 2 times in total
Back to top
View user's profile Send private message MSN Messenger
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Fri Apr 13, 2012 4:57 am    Post subject: Reply with quote

What is wrong with my name?
Is it has something to with ce?

_________________
Back to top
View user's profile Send private message Send e-mail
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 1, 2  Next
Page 1 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