View previous topic :: View next topic |
Author |
Message |
mikey1993 Newbie cheater Reputation: 0
Joined: 20 Jul 2017 Posts: 22
|
Posted: Sat Nov 04, 2017 4:24 pm Post subject: Need some Advice |
|
|
I have a problem that I'm not sure how to tackle. My mathematics isn't the best so this issue might be basic as hell but here goes.
I'm trying to write an Auto Targeting Script. Depending on what NPC I've clicked on the values of the addresses change.
I have 4 addresses that all need to be a specific number each ranging from 0 - 255.
So for example NPC 1 :
Address A = 123
Address B = 9
Address C = 33
Address D = 87
But these values change depending on what NPC I have targeted.
I really just want any NPC to get targeted but without having to click them
but to achieve that I'd have to write out every possible combination of those 4 numbers and it would change the value of every possible until the perfect combination was found. Would take me a thousand years to write it out.
I hope I've explained myself well enough.
|
|
Back to top |
|
|
mikey1993 Newbie cheater Reputation: 0
Joined: 20 Jul 2017 Posts: 22
|
Posted: Sun Nov 05, 2017 7:42 am Post subject: |
|
|
If I change Address D to an Array of Bytes 4 lengths. I get the same effect.
Is there a way to search every possible array of bytes until a value is found.
The Default value is 255 255 255 255. If a perfect match isn't made then they all reset to 255 immediately. Unless a perfect number is entered that then it'll stay. So if I wrote a script that searched every possible combination until it was no longer 255 then that would be perfect. Does anyone here know a way to do that. Would appreciate any hints.
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4299
|
Posted: Sun Nov 05, 2017 12:02 pm Post subject: |
|
|
That isn't a good idea. You'd be better off hooking code that is run when you click on an enemy and getting the ID that way.
Here's some Lua code if you want to try it anyways. Just make sure you save your work in CE before you execute it.
Code: | function isPerfectMatch(t)
-- check t here
return false
end
function get_gud()
local t = {0,0,0,0}
while not isPerfectMatch(t) do
local i = 1
while t[i] == 0xff do
t[i] = 0
i = i + 1
end
if i > #t then return nil end -- no matches found
t[i] = t[i]+1
end
return t
end
local t = get_gud()
-- do something with t here |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mikey1993 Newbie cheater Reputation: 0
Joined: 20 Jul 2017 Posts: 22
|
Posted: Tue Nov 07, 2017 1:42 am Post subject: |
|
|
Thank you for the reply Parkour. I was just thinking what a dill I am. It's highly possible that these random values aren't even assigned until I target the mobs before hand which would mean what I was attempting wouldn't work in the first place.
So far I've gotten away with achieving all my ideas by changing values of addresses and writing some handy but basic LUA scripts. Opening a game menu can usually be achieved by changing a value or making your character attack. I've searched and searched but cant find any value I could alter to make my character target something. I don't really know a lot about AA and calling functions etc. I have tried playing with it though. I can Break and Trace and whatnot. I've tried the method of creating a thread to call a function but game closes immediately.
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4299
|
Posted: Tue Nov 07, 2017 10:55 am Post subject: |
|
|
So you want to target an enemy?
You could try using ultimap and calling a function, but without knowledge of assembly, you'd be hard pressed to do that correctly.
If multiple enemies can be selected at once, there might be an isSelected flag in the enemy's data structure. If not, there could be a pointer to the currently selected enemy somewhere in memory. Try searching for changed/unchanged values in different ways and figure it out.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
mikey1993 Newbie cheater Reputation: 0
Joined: 20 Jul 2017 Posts: 22
|
Posted: Wed Nov 15, 2017 10:06 pm Post subject: |
|
|
Parkour. I've not had much luck. If I could get doKeyPress to work all this would be so very easy.
This game doesn't allow virtual key presses. I've tried AutoHotKey and AutoIt. I want to be able to perform a keypress while the window is minimized.
As you know targeting something can be achieved by pressing a key. You wouldn't happen to know any other avenues I could explore in regards to this. The game is Direct X if that has any significance. I'd really appreciate the help.
|
|
Back to top |
|
|
|