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 


its possible to freeze address value in script?

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

Joined: 10 Aug 2011
Posts: 6

PostPosted: Wed Jun 26, 2013 2:39 pm    Post subject: its possible to freeze address value in script? Reply with quote

Hello everyone,
i want to ask you how can i change address value if address is frozen? (manually)
maybe is possible somehow to make something like this:

unfreeze address
writeInteger(address,new-value)
freeze address again


may can anyone help me? i am new in lua coding..[/list]
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Jun 26, 2013 2:47 pm    Post subject: Reply with quote

If you change a frozen value in the addresslist, the new frozen value will be what you set it to, but it has to go through the addresslist to take effect (otherwise as you stated: unfreeze, writeInteger, freeze)

something like this:
Code:

getAddressList().getMemoryRecordByDescription("Your record").Value=100

replace "Your record" with the recordname of the address in your list (and 100 with the new value.)

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

Joined: 10 Aug 2011
Posts: 6

PostPosted: Wed Jun 26, 2013 3:14 pm    Post subject: Reply with quote

Dark Byte wrote:
If you change a frozen value in the addresslist, the new frozen value will be what you set it to, but it has to go through the addresslist to take effect (otherwise as you stated: unfreeze, writeInteger, freeze)

something like this:
Code:

getAddressList().getMemoryRecordByDescription("Your record").Value=100

replace "Your record" with the recordname of the address in your list (and 100 with the new value.)



Sorry, i didnt understand.. you mean i have to write name in descripton to this address(address must be in the list), and this command will change value if address is freezed? sorry about my english, but i really need to get it working.. :/ maybe its not too hard to take screen shot with working example? thank you
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Jun 26, 2013 3:29 pm    Post subject: Reply with quote

Since you say the address is frozen, that means the address is in the list
So, use that address entry to set the value



your record.png
 Description:
 Filesize:  19.82 KB
 Viewed:  22771 Time(s)

your record.png



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

Joined: 10 Aug 2011
Posts: 6

PostPosted: Wed Jun 26, 2013 3:32 pm    Post subject: Reply with quote

Thank you!
Back to top
View user's profile Send private message
Loeffel
How do I cheat?
Reputation: 0

Joined: 24 Dec 2014
Posts: 6

PostPosted: Sat Dec 27, 2014 11:31 am    Post subject: Reply with quote

I can't access the addresslist at all.

I tried it in a function and also in the lua engine window directly. It always says, that the addresslist is nil

Command:
getAddresslist().getMemoryRecordByDescription("No description").Value=100
or
getAddresslist().getMemoryRecordByDescription("Health_selected_unit").Value=100

returns always:
getAddresslist().getMemoryRecordByDescription("No description").Value=100

Error:[string "getAddresslist().getMemoryRecordByDescripti..."]:1: attempt to call global 'getAddresslist' (a nil value)
Script Error


I can only set the value manually.

_________________
Yours

Loeffel
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Dec 27, 2014 12:16 pm    Post subject: Reply with quote

it's case sensitive (l isn't the same as L)
_________________
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
Loeffel
How do I cheat?
Reputation: 0

Joined: 24 Dec 2014
Posts: 6

PostPosted: Sat Dec 27, 2014 4:50 pm    Post subject: Reply with quote

Now it works, now I have just the problem left, that I can't connect the Lua-Function to a hotkey.
I tried different ways, but none works.

_________________
Yours

Loeffel
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Dec 27, 2014 5:14 pm    Post subject: Reply with quote

createHotkey(function, keys, ...)
_________________
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
Loeffel
How do I cheat?
Reputation: 0

Joined: 24 Dec 2014
Posts: 6

PostPosted: Sat Dec 27, 2014 5:45 pm    Post subject: Reply with quote

Yes, I checked the writing several times, but F12 isn't triggering the function. F12 isn't used in the game, if it would do a difference.

I would add the script to the other scripts, but not with this error.

_________________
Yours

Loeffel
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Dec 27, 2014 5:55 pm    Post subject: Reply with quote

do you give the proper virtual keycode for f12? (VK_F12 or 123)

e.g:
Code:

createHotkey(functionname, VK_F12)

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

Joined: 24 Dec 2014
Posts: 6

PostPosted: Sat Dec 27, 2014 8:13 pm    Post subject: Reply with quote

I used VK_F12

There was something left from another way.


Unfortunately, now my function heal is returning again. Nil Errors.
When I copy it to the Lua Script window and execute it there I got an Object error

This is the CT-File

[edit]Sorry uploaded the wrong Version.[/edit]



BattleWorldsKronos +2_V1_2.CT
 Description:

Download
 Filename:  BattleWorldsKronos +2_V1_2.CT
 Filesize:  10 KB
 Downloaded:  830 Time(s)


_________________
Yours

Loeffel
Back to top
View user's profile Send private message
Loeffel
How do I cheat?
Reputation: 0

Joined: 24 Dec 2014
Posts: 6

PostPosted: Mon Dec 29, 2014 6:39 pm    Post subject: Reply with quote

I found it.

I wrote:
Code:
createHotkey(Heal(),VK_12)

instead of:
Code:
createHotkey(Heal,VK_12)



Now I only Need to find a way to Play a Sound when a cheat is activated/deactivated.

_________________
Yours

Loeffel
Back to top
View user's profile Send private message
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