Link cheatengine to a macro?

12/26/2008 03:50 bobbyaube#1
I dont know much about gamehacking, all i want to do is to make a simple macro that react to what a npc say.

I already found a text adress from the client (with cheat engine).

What i would like to do is, link the adress value to an action.

Ex:

If adress 019DBDBA = aaa Then move mouse to xxx-yyy and click.
If adress 019DBDBA = bbb Then move mouse to xxx-yyy and click.

Any idea on how i could do that, or programs i could use?
12/26/2008 04:54 tao4229#2
Depends.
If your macro has support for Write/ReadProcess memory, you can just use those functions.

If you're writing it in a programming language, most of them can import the .dll and just use that, but I'm unsure about languages like AutoIt or AHK.
12/26/2008 05:09 bobbyaube#3
Quote:
Originally Posted by tao4229 View Post
Depends.
If your macro has support for Write/ReadProcess memory, you can just use those functions.

If you're writing it in a programming language, most of them can import the .dll and just use that, but I'm unsure about languages like AutoIt or AHK.
do you know a macro that can do that? because i dont know any programming language. But im willing to learn :)
12/26/2008 07:45 Origonal#4
@bobbyaube, i would be happy to help you implement a C# program that will work similar to what i think you want. I dont know how to get it to move to specific Conquer coords but i would be able to get it to move to a screen location and then click. Do you have any experience with programing languages at all? If you know the basics then feel free to add me on msn and ill help ya.
12/26/2008 08:03 bobbyaube#5
no i never tried any programming language. There is no need to make the character move.

All i want is the bot to react to what the npc says.
Its about Coach Lin quest (in phoenix castle).
First you click on the npc

Then you start the bot, it check what the npc said, then click at (xxx,yyy).

Then the npc gives one of the 4 possible question, the bot read the question (with the memory adress), and click on one of the four possible places.

and start over untill the npc say you dont have the item needed.
12/26/2008 08:10 Origonal#6
its probably best you learn to use a learner programing language first then, like kpl(phrogram) , that will teach you the basic syntax and get you used to a programing language. just feeding you code probably wouldnt help you much, especially if you dont yet understand the easy things.

[Only registered and activated users can see links. Click Here To Register...]
12/26/2008 16:54 IAmHawtness#7
You could use AutoIt to make your macro. You can use this code for inspiration:
Code:
[B]#include <NomadMemory.au3>[/B]

While $paused3 = 0
	$pos2 = MouseGetPos()
	$sleep = 350
	$Mem_Answer1 = 0x01E0EFCC ;the memory address for the first answer
	$Mem_Answer2 = 0x01E0F104
	$Mem_Answer3 = 0x01E0F23C
	$Mem_Answer4 = 0x01E0F374
	$Process1 = WinGetProcess("[Conquer2.0]")

	MouseClick ("left", $pos2[0], $pos2[1], 1, 1)
	sleep ($sleep)
	
		$Mem_Open = _MemoryOpen($Process1) 
	$Mem_Read1 = _MemoryRead($Mem_Answer1, $Mem_Open, "char[16]") 
	If $Mem_Read1 = "Of course." Then
	TogglePause()
Else

sleep($sleep)
	MouseClick ("left", 443, 222, 1, 5)
	Sleep($sleep)
	
			$Mem_Read1 = _MemoryRead($Mem_Answer1, $Mem_Open, "char[16]")
			sleep(5)
			$Mem_Read2 = _MemoryRead($Mem_Answer2, $Mem_Open, "char[16]")
			sleep(5)
			$Mem_Read3 = _MemoryRead($Mem_Answer3, $Mem_Open, "char[16]")
			sleep(5)
			$Mem_Read4 = _MemoryRead($Mem_Answer4, $Mem_Open, "char[16]")
			sleep(5)
			
		If $Mem_Read1 = "Level 40" Or $Mem_Read1 = "20" Or $Mem_Read1 = "Boxer" Then
				
			MouseClick ("left", 407, 226, 1, 10)
			
		ElseIf $Mem_Read2 = "Level 40" Or $Mem_Read2 = "20" Or $Mem_Read2 = "Boxer" Then
			
			MouseClick ("left", 667, 223, 1, 10)
			
		ElseIf $Mem_Read3 = "Level 40" Or $Mem_Read3 = "20" Then
			
			MouseClick ("left", 410, 246, 1, 10)
			
		ElseIf $Mem_Read4 = "Level 40" Or $Mem_Read4 = "20" Or $Mem_Read4 = "Boxer" Then
			
			MouseClick ("left", 674, 243, 1, 10)
			
		EndIf
		EndIf
		
sleep($sleep)
MouseClick ("left", 422, 222, 1, 10)
MouseMove ($pos2[0], $pos2[1], 10)
_MemoryClose($Mem_Open)

WEnd
The memory addresses wont work on your client, of course, you'll have to find them yourself, and the MouseClick coordinates probably wont work on your pc either.

What this code does is:
It clicks where your mouse is (you have to place it on the NPC guy in Phoenix Castle yourself), then it clicks on the "Let's go" answer (or whatever it is, I kinda forgot) and then it check the values of the choices you get and clicks the correct one.
12/26/2008 18:35 bobbyaube#8
Quote:
Originally Posted by IAmHawtness View Post
You could use AutoIt to make your macro. You can use this code for inspiration:
Code:
[B]#include <NomadMemory.au3>[/B]

While $paused3 = 0
	$pos2 = MouseGetPos()
	$sleep = 350
	$Mem_Answer1 = 0x01E0EFCC ;the memory address for the first answer
	$Mem_Answer2 = 0x01E0F104
	$Mem_Answer3 = 0x01E0F23C
	$Mem_Answer4 = 0x01E0F374
	$Process1 = WinGetProcess("[Conquer2.0]")

	MouseClick ("left", $pos2[0], $pos2[1], 1, 1)
	sleep ($sleep)
	
		$Mem_Open = _MemoryOpen($Process1) 
	$Mem_Read1 = _MemoryRead($Mem_Answer1, $Mem_Open, "char[16]") 
	If $Mem_Read1 = "Of course." Then
	TogglePause()
Else

sleep($sleep)
	MouseClick ("left", 443, 222, 1, 5)
	Sleep($sleep)
	
			$Mem_Read1 = _MemoryRead($Mem_Answer1, $Mem_Open, "char[16]")
			sleep(5)
			$Mem_Read2 = _MemoryRead($Mem_Answer2, $Mem_Open, "char[16]")
			sleep(5)
			$Mem_Read3 = _MemoryRead($Mem_Answer3, $Mem_Open, "char[16]")
			sleep(5)
			$Mem_Read4 = _MemoryRead($Mem_Answer4, $Mem_Open, "char[16]")
			sleep(5)
			
		If $Mem_Read1 = "Level 40" Or $Mem_Read1 = "20" Or $Mem_Read1 = "Boxer" Then
				
			MouseClick ("left", 407, 226, 1, 10)
			
		ElseIf $Mem_Read2 = "Level 40" Or $Mem_Read2 = "20" Or $Mem_Read2 = "Boxer" Then
			
			MouseClick ("left", 667, 223, 1, 10)
			
		ElseIf $Mem_Read3 = "Level 40" Or $Mem_Read3 = "20" Then
			
			MouseClick ("left", 410, 246, 1, 10)
			
		ElseIf $Mem_Read4 = "Level 40" Or $Mem_Read4 = "20" Or $Mem_Read4 = "Boxer" Then
			
			MouseClick ("left", 674, 243, 1, 10)
			
		EndIf
		EndIf
		
sleep($sleep)
MouseClick ("left", 422, 222, 1, 10)
MouseMove ($pos2[0], $pos2[1], 10)
_MemoryClose($Mem_Open)

WEnd
The memory addresses wont work on your client, of course, you'll have to find them yourself, and the MouseClick coordinates probably wont work on your pc either.

What this code does is:
It clicks where your mouse is (you have to place it on the NPC guy in Phoenix Castle yourself), then it clicks on the "Let's go" answer (or whatever it is, I kinda forgot) and then it check the values of the choices you get and clicks the correct one.
wow ty, i was trying to learn autoit by myself x.x

I already got nomadmemory. Thanks alot!! :handsdown:
12/30/2008 00:25 Hiyoal#9
If you ever need any help with AutoIt, feel free to ask me. Ive written mostly every one of my bots in AutoIt and im quite fluent in the scripting language :p

Also, for some more learning on AutoIt, read my guides:
Part 1: [Only registered and activated users can see links. Click Here To Register...]
Part 2: [Only registered and activated users can see links. Click Here To Register...]

Also try UPSMan's guide on AutoIt memory:
[Only registered and activated users can see links. Click Here To Register...]

Hiyoal :D
12/30/2008 08:29 stitches35#10
@Hiyoal...
Ummm I've checked all of the links and i haven't figured out how to find the coordinates to where your mouse should click to answer the questions, and also how do we find the memory addresses? Sorry if I'm asking too difficult a question. :(
Thanks,
S35


P.S.----I'm really new at this so if you can put it in Layman's terms that would be great XD
12/30/2008 10:04 Hiyoal#11
To find the coordinates on screen is not a matter of memory. You will have to make your own algorithms for that.

Finding memory addresses is a CheatEngine basic. Look at the tutorial given in the CheatEngine Installer Package named Tutorial.exe.

Memory Reading is easy. Look at UPSMan's Guide and look at how it is structured.
Btw, you need NomadMemory.au3.

Quote:
Originally Posted by Hiyoal
#include <NomadMemory.au3>
$pid=ProcessExists("Conquer.exe")
If $pid=-1 Then
Msgbox(0,"Error","No Conquer Process Exists")
Else
$access=_MemoryOpen($pid)
$read=_MemoryRead(Address_From_CheatEngine,$access )
msgbox(0,"ReadMemory",$read)
Exit
EndIf
Hiyoal
12/30/2008 19:41 Origonal#12
MouseGetPos() function in AutoIt returns a array, first value being the X position and 2nd being the Y position. The easy way to do this is to write a seperate program that displays the mouse position to find the coords your looking for on your screen and then youll be able to click on a position of the screen rather than coords on conquer.

code for position finder program(syntax probably wrong, dont know autoit well):

Code:
While 1
 $pos = MouseGetPos()
 GUICtrlSetData($lblTextX, $pos[0])
 GUICtrlSetData($lblTextY,$pos[1])
Wend
that way youll constantly get a update of where your mouse is.
12/30/2008 23:33 Hiyoal#13
Fixed your syntax.

Let me remind you though, that you would have to record these mouse positions manually, because memory does not interlink with mouse clicks. You would have to define the:

If something happens in memory then
Click to this Position (Set by YOU)
Endif

Also, If you would like to get cursor positions on the conquer2.0 client rather than the whole screen (useful if people move the Conquer Window) use:

Opt("MouseCoordMode",2)

Hope that helps a bit
Hiyoal
12/31/2008 01:21 IAmHawtness#14
Why the semi-colon after MouseGetPos() ? :o
12/31/2008 01:43 Hiyoal#15
O lol, didnt see that one :p
Editted again xD

Hiyoal :D