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 


Reading/writing Text Boxes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
empirebattles
How do I cheat?
Reputation: 0

Joined: 13 May 2009
Posts: 7

PostPosted: Sun Sep 16, 2012 5:34 pm    Post subject: Reading/writing Text Boxes Reply with quote

I'm still playin around with cheat engine's trainer maker.
Right now, i've gotten buttons, check boxes, etc etc to work correctly.
However, for some reason, edit boxes (input) is not playing nice.
I know that they are not Cheat Components (therefor i cannot use things like cheatcomponent_getEditValue).
If my understanding is correct, i have to use control_getCaption in order to retrieve the contents of the edit box.

However, all of my attempts at this are failing.

Right now, i have an input box (TCEEdit), that i have named TEST. (In the objects inspector, it is shown as TEST: TCEEdit)

I also have a button, that has a function when it is clicked, that is supposed to get the boxes contents, and simply return them in a message (just confirming the data was gotten correctly).
Code:

mf=getMainForm()
d_mess=control_getCaption(component_findComponentByName(mf,TEST))
showMessage(d_mess)


When i have that code, and i press the button, it gives me an Access violation.


A few things i'm shaky on:
First, is the getMainForm()... I know i'm supposed to use a component in component_findComponentByName, but i'm not sure the parent/component of my input box :/
If i dont even put a component in the arguments, it doesn't produce the desired results(blank).

I can upload my basic trainer if needed... but i'm thinking this is easy, and my brain has decided to trick me.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Sep 16, 2012 6:18 pm    Post subject: Reply with quote

Component names are accessed by using Formname_Componentname

So if your TEST object is on a form named UDF1, then you'd access it by UDF1_TEST

so: control_getCaption(UDF1_TEST)

gatMainForm() should not be used unless you wish to access a control on the main ce window

_________________
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
empirebattles
How do I cheat?
Reputation: 0

Joined: 13 May 2009
Posts: 7

PostPosted: Sun Sep 16, 2012 6:44 pm    Post subject: Reply with quote

Ah... i was wondering how to find out what the name of the form was. I took a guess, and took the name that was next to the "Form Designer"... and it worked!
Sometimes the simplest things misdirect my thoughts Sad
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sat Sep 22, 2012 4:12 pm    Post subject: Reply with quote

Is it possible to do memscan from what is written in CEEdit?
I don't really know how to do it, I have read the main.lua, but still didn't found anything useful to do so.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Sep 22, 2012 5:20 pm    Post subject: Reply with quote

yes, get the caption of the CEEdit and memscan for that
_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Sep 23, 2012 8:48 am    Post subject: Reply with quote

So I wrote this
Code:
input1 = control_getCaption( UDF1_CEEdit1 );
mems = createMemScan(true)
fl = createFoundList(ms)

function CEButton1Click(sender)
   memscan_firstScan(mems , soExactValue, vtDword, rtRounded, input1, nil, 0, 0x2fffffff, "+X-C-W", fsmAligned, "4", false, false, false, false)

   memscan_waitTillDone(mems)
    foundlist_initialize(fl)
    showMessage("Scan is complete")
   control_setVisible(UDF1_CEButton2, true)
   control_setVisible(UDF1_CEEdit2, true)
end

But I get Access violation.
Can you help me out?
And also, how do I make the memscan results be changed with X value? (sorry I never used it before and googling it didn't help me)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Sep 23, 2012 10:26 am    Post subject: Reply with quote

createMemScan takes as parameter a progressbar object or nothing. so instead of (true) do ()

and instead of using input1 in firstScan use control_getCaption( UDF1_CEEdit1 )

_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Sep 23, 2012 12:38 pm    Post subject: Reply with quote

Alright I don't get errors when press excute,
so I ineserted this one
Code:
mems = createMemScan()
fl = createFoundList(mems)

function CEButton1Click(sender)
   memscan_firstScan(mems , soExactValue, vtDword, rtRounded, control_getCaption(UDF1_CEEdit1 ), nil, 0, 0x2fffffff, "+X-C-W", fsmAligned, "4", false, false, false, false)

   memscan_waitTillDone(mems)
    foundlist_initialize(fl)
    showMessage("Scan is complete")
   control_setVisible(UDF1_CEButton2, true)
   control_setVisible(UDF1_CEEdit2, true)
end

But when I enter for example 25 in the box, I get this

Code:
Error:Failure determining what 805306367 means

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Sep 23, 2012 1:43 pm    Post subject: Reply with quote

Instead of 0x2fffffff try "2fffffff"

And instead of nil for second input do ""

(Is this ce 6.2?)

_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Sep 23, 2012 3:58 pm    Post subject: Reply with quote

says
Code:
[string "mems = createMemScan()..."]:5: malformed number near '2fffffff'

When entering the
Code:
mems = createMemScan()
fl = createFoundList(mems)

function CEButton1Click(sender)
   memscan_firstScan(mems , soExactValue, vtDword, rtRounded, control_getCaption(UDF1_CEEdit1 ), "", 0, 2fffffff, "+X-C-W", fsmAligned, "4", false, false, false, false)

   memscan_waitTillDone(mems)
    foundlist_initialize(fl)
    showMessage("Scan is complete")
   control_setVisible(UDF1_CEButton2, true)
   control_setVisible(UDF1_CEEdit2, true)
end

I tried 0x2ffff again, but gives same error again.
And yes I use CE 6.2

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Sep 23, 2012 4:06 pm    Post subject: Reply with quote

no, not 2fffffff but "2fffffff" (with the quotes)
_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Sep 23, 2012 4:09 pm    Post subject: Reply with quote

Worked!, showd the message.
But now how do I do change the value of the adresses?.
Next scan I believe is like the same as first scan...

P.S
And I donated you 5$ (sorry I don't make alot.. DSmile

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Sep 23, 2012 4:50 pm    Post subject: Reply with quote

You can use foundlist_getCount and foundlist_getAddress to walk through the addresslist (0=first item)

you can then use writeInteger/writeFloat/writeDouble/writeBytes with that address to change 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
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