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 


Mouse key bind and toggle
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
mxswat
How do I cheat?
Reputation: 0

Joined: 09 Dec 2015
Posts: 4

PostPosted: Wed Dec 09, 2015 9:57 am    Post subject: Mouse key bind and toggle Reply with quote

Hi guys im making a trainer but usually I use the "generate generic trainer" of CE
But i found 2 problems i didnt found notthing on the forum just a few info but not very helpfull.

I need 2 thing use the "MOUSE 4" or 5 button as hotkey.
and the hotkey on second click will change again the value i only foud this "cheatengine.org/forum/viewtopic.php?t=545393&sid=0242c61f681f084a757fa6df1b22f395" but i dont know how do it.
Can some one help me?
I'll release my trainer here if I can solve this problem Smile
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Wed Dec 09, 2015 11:28 am    Post subject: Reply with quote

I don't know anything about the generic trainer generator, but why not make your own? It's not terribly difficult to learn the basics of Lua and some of the functions CE provides to you:
http://forum.cheatengine.org/viewtopic.php?p=5576412

Unfortunately I don't think it provides support for other mouse buttons besides left click and right click.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Dec 09, 2015 1:34 pm    Post subject: Reply with quote

You may be better off assigning a key combination to those extra mouse buttons. That way, you can have your trainer work as desired and still be able to accommodate people that do not have those extra buttons on their mouse.
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Thu Dec 10, 2015 1:28 pm    Post subject: Reply with quote

If you want to assign a hotkey to mouse button 4/5, open your .ct file with notepad, scroll down to the part that says:
Code:
<Keys>
  <Key>SomeNumber</Key>
</Keys>
for the cheat you want to edit, and replace SomeNumber by 5 for mouse button 4, or 6 for mouse button 5 (mouse buttons 6+ aren't supported afaik).
For those wondering where those 5/6 come from, VK_XBUTTON1=5, VK_XBUTTON2=6.


As for toggling between 2 values you need an auto assembler script or a lua script. If you don't need to freeze, auto assembler may be simpler, it would be something like:
Code:
[enable]
address:
dd #value1

[disable]
address:
dd #value2
Use:
"db #value" for a single byte
"dw #value" for a 2 byte value
"dd #value" to write a 4 byte value
"dq #value" for an 8 byte value
"dd (float)value" for a float
"dq (double)value" for a double
"Go #Figure" for any custom type
(Keep the "#" when it's present).

As for the address part, if the address of your cheat is in the game.exe+1234 format, simply replace address with that.
If you have a pointer displayed as:
Code:
10
8
4
game+exe+1234
in CE, then address will be: [[[game.exe+1234]+4]+8]+10 .
Then just assign a hotkey to that script, done.

(off topic remark: tables are generally preferred over trainers)

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
mxswat
How do I cheat?
Reputation: 0

Joined: 09 Dec 2015
Posts: 4

PostPosted: Thu Dec 10, 2015 2:48 pm    Post subject: Thanks Reply with quote

Thanks for the help guys, but I have a question why tables are generally preferred over trainers?
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Thu Dec 10, 2015 3:21 pm    Post subject: Reply with quote

1 - Much smaller.

2 - You can see exactly what it's doing easily.

3 - You can modify and update tables as needed normally.

I make trainers rarely, and only as an alternative to tables for places outside the forums (and even then I put a link to the table).

_________________
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Thu Dec 10, 2015 3:30 pm    Post subject: Reply with quote

Tables:
-can be edited, so other people can update them when you're done with the game, they can also learn from your work, add more options... or repost them under their name (ripping, harshly punished here).
-->This also means player can change the hotkeys.
-are smaller since .exe trainers include a nearly full copy of cheat engine as well as some extra cosmetic bloat (background image, chiptune, etc...).
-can be posted (attached) here.
-require less work to make.

Trainers:
-in .exe form (ie: not .cetrainer) cannot be posted here, but you can link to them.
-in .exe form, do not require the user to install cheat engine.
-in .exe form, create THREE processes each time you launch them.
-protect your work against theft/ripping by script kiddies, but not against any decent hacker.
-may or may not contain adware/spyware/trojan, who knows? (There ARE a couple hackers these days that are suspected to ship crap with their trainers.)
-have a fancier interface.
-You may also run into requests like "Please change the hotkey to ... because ... is already mapped to ... in Raz3r Pro1337 KonfiguraTHOR XP+".

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
mxswat
How do I cheat?
Reputation: 0

Joined: 09 Dec 2015
Posts: 4

PostPosted: Tue Dec 15, 2015 2:04 am    Post subject: Reply with quote

Okay thanks but i can add a key bind to a table value?
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Tue Dec 15, 2015 4:44 am    Post subject: Reply with quote

Yes.
(hint: right click)

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 15, 2015 7:19 am    Post subject: Reply with quote

Gniarf wrote:
Yes.
(hint: right click)
-Can you explain more, please? Very Happy Razz
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Tue Dec 15, 2015 8:39 am    Post subject: This post has 1 review(s) Reply with quote

Right click on a record in the table.
Select "Set hotkeys".
Bam.

Alternatively, you could use Lua to do more complicated things, but you'll have to know Lua if you want to do it yourself.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Tue Dec 15, 2015 9:01 am    Post subject: Reply with quote

@++METHOS: I'm not really sure myself, but apparently it would mean "an additional quantity" or "to a greater extent". Or at least that's what I've heard.
If you want to dig deeper on the subject, I think a good place to start your investigation would be this popular rumor site. Half of it might be bullshit but there is probably some truth in it, all you have to do to sort which is which.

(Pffftttchh xD)

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 15, 2015 9:55 am    Post subject: Reply with quote

You took it to the limit, Gniarf. You almost lost me. I'm not sure ParkourPenguin has a sense of humor. Very Happy (only kidding)
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Tue Dec 15, 2015 1:01 pm    Post subject: Reply with quote

@++METHOS: It was either this or one of the google image results for "not sure if trolling".
If I didn't know you I would have reacted like ParkourPenguin. You know the questions we can get on those forums... (-_-)

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
mxswat
How do I cheat?
Reputation: 0

Joined: 09 Dec 2015
Posts: 4

PostPosted: Wed Dec 16, 2015 3:12 pm    Post subject: Reply with quote

[quote="Gniarf"]Yes.
(hint: right click)[/quote]
Sorry but mouse4 and 5 still not work
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
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