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 


CE Hotkeys

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
lamafao
Expert Cheater
Reputation: 1

Joined: 17 Apr 2013
Posts: 130

PostPosted: Sun Jul 14, 2013 6:56 am    Post subject: CE Hotkeys Reply with quote

I was just wondering if there is a way to make a hotkey, that would go thru and change some of my hex values?

Lets say i had 1 address and 5 random values like
1.AA AA AA
2.BB BB BB
3.CC CC CC
4.DD DD DD
5.EE EE EE

And every time i pushed a button it would change to 1. then 2. then 3, and so on?

Right now i am using normal CE hotkeys, but i need 5 buttons to change 5 values, would be nice if there was a way to do that with 1 button.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Jul 14, 2013 7:32 am    Post subject: Reply with quote

execute this lua script: (you can add it to the lua script in the table and launch it automatically each time the table is loaded)
Code:

selector=0
values={}
values[0]="aa aa aa"
values[1]="bb bb bb"
values[2]="cc cc cc"
values[3]="dd dd dd"
values[4]="ee ee ee"
function getNextValue()
  local v=values[selector]
  selector=(selector + 1) % 5
  return v
end


then add a hotkey to the entry that when executed sets the value to
Code:

[getNextValue()]

_________________
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
lamafao
Expert Cheater
Reputation: 1

Joined: 17 Apr 2013
Posts: 130

PostPosted: Sun Jul 14, 2013 7:54 am    Post subject: Reply with quote

Dark Byte wrote:
execute this lua script: (you can add it to the lua script in the table and launch it automatically each time the table is loaded)
Code:

selector=0
values={}
values[0]="aa aa aa"
values[1]="bb bb bb"
values[2]="cc cc cc"
values[3]="dd dd dd"
values[4]="ee ee ee"
function getNextValue()
  local v=values[selector]
  selector=(selector + 1) % 5
  return v
end


then add a hotkey to the entry that when executed sets the value to
Code:

[getNextValue()]



Am i doing it right?
ctrl+alt+L > paste your script > set my hotkey to change the value to [getNextValue()]

When i press my hotkey nothing happens.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Jul 14, 2013 8:14 am    Post subject: Reply with quote

hmm, this doesn't seem to work properly with array of byte types

I think you'll have to go with the createHotkey method then and use writeBytes to set the values (more complex)

e.g: This adds a CTRL+F1 hotkey that sets the values
Code:

selector=0
values={}
values[0]="aa aa aa"
values[1]="bb bb bb"
values[2]="cc cc cc"
values[3]="dd dd dd"
values[4]="ee ee ee"
function SetNextValue()
  getAddressList().getMemoryRecordByDescription('something').value=values[selector]
  selector=(selector + 1) % 5
  return v
end

createHotkey(SetNextValue, VK_CONTROL, VK_F1)


replace something with the description of your cheat entry

_________________
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
lamafao
Expert Cheater
Reputation: 1

Joined: 17 Apr 2013
Posts: 130

PostPosted: Sun Jul 14, 2013 9:00 am    Post subject: Reply with quote

Dark Byte wrote:
hmm, this doesn't seem to work properly with array of byte types

I think you'll have to go with the createHotkey method then and use writeBytes to set the values (more complex)

e.g: This adds a CTRL+F1 hotkey that sets the values
Code:

selector=0
values={}
values[0]="aa aa aa"
values[1]="bb bb bb"
values[2]="cc cc cc"
values[3]="dd dd dd"
values[4]="ee ee ee"
function SetNextValue()
  getAddressList().getMemoryRecordByDescription('something').value=values[selector]
  selector=(selector + 1) % 5
  return v
end

createHotkey(SetNextValue, VK_CONTROL, VK_F1)


replace something with the description of your cheat entry


It works, thank you so much!
I don't need to change anything to add more addresses right?(except the values[x]"x" ofcourse)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Jul 14, 2013 9:29 am    Post subject: Reply with quote

the values and selector may need unique names if the other addresses need other values.
but if they need the same value, this'll work

_________________
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
lamafao
Expert Cheater
Reputation: 1

Joined: 17 Apr 2013
Posts: 130

PostPosted: Sun Jul 14, 2013 10:09 am    Post subject: Reply with quote

Dark Byte wrote:
the values and selector may need unique names if the other addresses need other values.
but if they need the same value, this'll work



function SetNextValue()
getAddressList().getMemoryRecordByDescription('Pilnas').value=values[selector]
selector=(selector + 1) % 5
return v
end

function SetBackValue()
getAddressList().getMemoryRecordByDescription('Pilnas').value=values[selector]
selector=(selector - 1) % 5
return v
end

createHotkey(SetNextValue, VK_NUMPAD1)
createHotkey(SetBackValue, VK_NUMPAD2)

Last question, would this work to go back and forth between addresses?

Also, How do i remove the hotkeys created by the script?

right now i got ctrl+f1(yours) num1 and num2 changing the values:S

EDIT: I think i figured everything out by myself, thanks again!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Jul 15, 2013 6:18 am    Post subject: Reply with quote

for those wondering:
createHotkey() returns a GenericHotkey class object
you can call the destroy() method to remove it.

e.g:
Code:

globalhk1=createHotkey(SetNextValue, VK_CONTROL, VK_F1)


and when done with it:
Code:

globalhk1.destroy()

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