|
You last visited: Today at 13:13
Advertisement
AutoIt Tutor!
Discussion on AutoIt Tutor! within the CO2 Programming forum part of the Conquer Online 2 category.
10/20/2008, 08:08
|
#1
|
elite*gold: 0
Join Date: Feb 2006
Posts: 209
Received Thanks: 455
|
AutoIt Tutor!
I've noticed that the demand for bots are great and there are some bots on this forum that works great... Although I wanted to help my fellow ePvPers to learn to code in AutoIt which is a language that I know very well... I've made numerous programs in AutoIt for all games that I've play(ed). All the macros have helped me ALOT with my playing experience. I do have my own bot that does all that I want and some more  I've also released a bot but I wont be doing that anymore since it's way too much time consuming atm.
Anyway if you have a question about AutoIt. Just ask it here... perhaps you even want a complete funcion? I will do my best to answer your questions and help you with functions.
Here are some functions that I've made and feel like releasing.
Random Move Function:
You call functions with just the name of them
RandomMove() - Moves your character to a random location in your screen. (Jumps there)
Code:
Func RandomMove()
$Rand1 = Random($size[0] / 2 - 230, $size[0] / 2 + 230)
$Rand2 = Random($size[1] / 2 - 230, $size[1] / 2 + 230)
Send("{CTRLDOWN}")
MouseClick("left",$Rand1, $Rand2,1,0)
Send("{CTRLUP}")
WaitFunc()
EndFunc
WaitFunc() - This will get your coords and check if you're standing still... If you are standing still then it will end the function else it will continue to run... (You need this first for it to work.)
Code:
Global $xad = "0x0057B64C", $yad = "0x0057B648"
Global $Conquer_Handle = WinGetHandle("[Co")
Global $Process = WinGetProcess($Conquer_Handle)
Global $DllInfo1 = _MemoryOpen($Process)
Code:
Func WaitFunc()
Do
$xcoord = _MemoryRead($xad, $DllInfo1, "int")
$ycoord = _MemoryRead($yad, $DllInfo1, "int")
Sleepers(300, 600)
$xcoord1 = _MemoryRead($xad, $DllInfo1, "int")
$ycoord1 = _MemoryRead($yad, $DllInfo1, "int")
Until $xcoord = $xcoord1 and $ycoord = $ycoord1
EndFunc
Sleepers(10, 20) - Will sleep a random time this is good for anti-detecting of the bot.
Code:
Func Sleepers($sleepx = 10, $sleepy = 20)
$sleep = Random($sleepx, $sleepy)
Sleep($sleep)
EndFunc
|
|
|
10/21/2008, 23:09
|
#2
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1
Received Thanks: 0
|
thinks
|
|
|
10/23/2008, 22:04
|
#3
|
elite*gold: 0
Join Date: Aug 2006
Posts: 147
Received Thanks: 360
|
thanks man for this functions, i want to learn some program langauge to make my own cheats and i see autoit is a good option. I don't have lot of time because of test but i'll try to learn autoit, or do you think it's better to learn another language??
|
|
|
10/24/2008, 06:05
|
#4
|
elite*gold: 20
Join Date: Dec 2005
Posts: 811
Received Thanks: 352
|
Well hey, I'm great in AutoIt myself, but I have never really had the urge to go further into it...
If possible, could you explain to me/everyone how to read a CONQUER coordinate, and GO to that coordinate...
Like so:
------200,100----
-----------------
----------------- If I'm standing at 200,100, how would I code it to
---- 100,200----- jump to 100,200... is this even possible with
AutoIt? :O
|
|
|
10/24/2008, 08:12
|
#5
|
elite*gold: 0
Join Date: Feb 2006
Posts: 209
Received Thanks: 455
|
Quote:
Originally Posted by darkirax
thanks man for this functions, i want to learn some program langauge to make my own cheats and i see autoit is a good option. I don't have lot of time because of test but i'll try to learn autoit, or do you think it's better to learn another language??
|
I strongly suggest AutoIt because it's an easy language to start with and easy to go deaper into aswell... I'm sure there are other great languages out there although I can't recomend something I havn't tried. But back to the question AutoIt is great.
Quote:
Originally Posted by swords
Well hey, I'm great in AutoIt myself, but I have never really had the urge to go further into it...
If possible, could you explain to me/everyone how to read a CONQUER coordinate, and GO to that coordinate...
Like so:
------200,100----
-----------------
----------------- If I'm standing at 200,100, how would I code it to
---- 100,200----- jump to 100,200... is this even possible with
AutoIt? :O
|
This is possible with autoit... As this is a tutor thread and now "I will do your work" thread I will give you the needed functions and then you can figure it out for yourself.
Firstly you need to open the memory for the conquer window.
Code:
Global $xad = "0x0057B64C", $yad = "0x0057B648" ;- This is for patch 5069
Global $Conquer_Handle = WinGetHandle("[Co")
Global $Process = WinGetProcess($Conquer_Handle)
Global $DllInfo1 = _MemoryOpen($Process)
Then you need to read where you are... with the memory read function
Code:
$xcoord = _MemoryRead($xad, $DllInfo1, "int")
$ycoord = _MemoryRead($yad, $DllInfo1, "int")
Now you have a raw coordinate where you are. Now you need to make it easier to understand them.
Take your coords and divide them by 32. like so
Code:
$xcoord = $xcoord / 32
$ycoord = $ycoord / 32
Now you have coords the way you want them like 150, 230 etc...
and then you need to use these coords and subract them with where you are going so that we can get a sense on which way the bot need to be heading. (If you need to go around something you need more coord landmarks because the bot can't know if something is in the way like a lake/river/wall etc.)
Let's say you're at 100, 100 and wants to go to 150, 50 ($xdestination, $ydestination)
Then $xcoord = 100 and so it $ycoord..
Code:
$xMove = $xcoord - $xdestination
$yMove = $ycoord - $ydestination
;- Now you $xMove will me -50 and $yMove will be 50 so now we need to figure out how to translate this to the bot to go left, right, up, down etc.
If $xMove > 0 Then ;- Checking if $xMove is greater than 0
$MoveRight = 1
elseif $xMove < 0 then
$moveleft = 1
EndIf
Now you need to continue to do this for the y coord and then make the bot move with the click function somewhere on the screen depending on where the bot needs to go.
You can also make the bot move diagonally by using something like:
Code:
If $MoveRight == 1 and $MoveUp == 1 Then
$MoveRightUp = 1
EndIf
You need this in your script to be able to use the memory functions also.
Code:
Func _MemoryOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $iv_InheritHandle = 1)
If Not ProcessExists($iv_Pid) Then
SetError(1)
Return 0
EndIf
Local $ah_Handle[2] = [DllOpen('kernel32.dll')]
If @Error Then
SetError(2)
Return 0
EndIf
Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', $iv_DesiredAccess, 'int', $iv_InheritHandle, 'int', $iv_Pid)
If @Error Then
DllClose($ah_Handle[0])
SetError(3)
Return 0
EndIf
$ah_Handle[1] = $av_OpenProcess[0]
Return $ah_Handle
EndFunc
Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword')
If Not IsArray($ah_Handle) Then
SetError(1)
Return 0
EndIf
Local $v_Buffer = DllStructCreate($sv_Type)
If @Error Then
SetError(@Error + 1)
Return 0
EndIf
DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
If Not @Error Then
Local $v_Value = DllStructGetData($v_Buffer, 1)
Return $v_Value
Else
SetError(6)
Return 0
EndIf
EndFunc
Func _MemoryClose($ah_Handle)
If Not IsArray($ah_Handle) Then
SetError(1)
Return 0
EndIf
DllCall($ah_Handle[0], 'int', 'CloseHandle', 'int', $ah_Handle[1])
If Not @Error Then
DllClose($ah_Handle[0])
Return 1
Else
DllClose($ah_Handle[0])
SetError(2)
Return 0
EndIf
EndFunc
Func _MemoryWrite($iv_Address, $ah_Handle, $v_Data, $sv_Type = 'dword')
If Not IsArray($ah_Handle) Then
SetError(1)
Return 0
EndIf
Local $v_Buffer = DllStructCreate($sv_Type)
If @Error Then
SetError(@Error + 1)
Return 0
Else
DllStructSetData($v_Buffer, 1, $v_Data)
If @Error Then
SetError(6)
Return 0
EndIf
EndIf
DllCall($ah_Handle[0], 'int', 'WriteProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
If Not @Error Then
Return 1
Else
SetError(7)
Return 0
EndIf
EndFunc
I think you'll get the picture (I hope I didn't make it too much of a blur and I hope that you understand atleast some of it.)
Remember if you've never made something like this before then don't expect to be done in like 30 minutes making of a script like this while learning at the same time will probably take a day or two atleast.
|
|
|
10/26/2008, 10:54
|
#6
|
elite*gold: 0
Join Date: Aug 2006
Posts: 147
Received Thanks: 360
|
thanks man it's very usefull
|
|
|
10/31/2008, 22:57
|
#7
|
elite*gold: 0
Join Date: Dec 2006
Posts: 150
Received Thanks: 628
|
Nvm allright
|
|
|
11/01/2008, 19:08
|
#8
|
elite*gold: 20
Join Date: Dec 2005
Posts: 811
Received Thanks: 352
|
Well Az, your way is possible, but well over-done... I have been looking up into the Memory searching and found that using CheatEngine gets this done way faster and easier than your method above... And what I'm going to accomplish by the end of the week will be a boundary function where the user puts in multiple x, y coords around the spawn and the bot will lvl/plvl within that boundary but not going outside of it.
|
|
|
11/01/2008, 20:33
|
#9
|
elite*gold: 20
Join Date: Oct 2008
Posts: 976
Received Thanks: 668
|
swords@
bot with boundary is good for long range attacks only
if monster is stuck and out of bounce, and u just killed all nearby monster, u will keep moving forward and backwards
besides, even using the boundary, u still need to instruct where the bot to click when its inside the bound, so thats why i prefer path points method using simple vector calculations
PS* how are u going to use cheatengine functions with ur autoit bot? Cheatengine is definately NOT easier, maybe the user will have a easier time to use it, but the code behind it definite not easier
|
|
|
11/02/2008, 00:01
|
#10
|
elite*gold: 20
Join Date: Dec 2005
Posts: 811
Received Thanks: 352
|
Quote:
Originally Posted by Evan Lim
swords@
bot with boundary is good for long range attacks only
if monster is stuck and out of bounce, and u just killed all nearby monster, u will keep moving forward and backwards
besides, even using the boundary, u still need to instruct where the bot to click when its inside the bound, so thats why i prefer path points method using simple vector calculations
PS* how are u going to use cheatengine functions with ur autoit bot? Cheatengine is definately NOT easier, maybe the user will have a easier time to use it, but the code behind it definite not easier
|
I have questioned these same things to a pro-AutoIt coder and he replied that using 'vector calculations' would be much harder... All you have to do is find the X coord and Y Cood in CheatEngine > Process Exists > MemoryOpen/MemoryRead > Then have it read if you are within the boundary or not.
I have to admit, I'm at a stuck-point, I cannot seem to figure out how to make the bot know its in the boundary, cause if I put: If $x < 200 Then (yadayada) it could think that I'm outside of the boundary, but in theory I'm inside of it cause I'm to the left of the X coordinate which means the coordinate is lesser than 200 but I'm in my selected boundary...
I'm working on a way to fix this... I have had a few ideas such as have two x coord variables... The first being < and the 2nd one being >... But that could have many flaws to it...
If you wanna explain what your 'vector calculations' is and how I could use to this to be easier than my method, I'm all for it... I'm curious as to how you made your bot. [Try making the explanation AutoIt oriented, as I have no clue how to code in AutoHotKey, though they are similar.]
P.S./Edit- No, I would not move back and forth if a monster is outside of my boundary cause I'm not searching for Monsters to kill, I'm searching for coordinates... I'm having 11 input boxes of x and y (22 total). The user will scout out their 11 points and the bot will 'sketch' an imaginary boundary to stay within. If a spawn is very big, you spread out your points, if its very small you make it more precise (putting your points in closer locations to make more 'bends/curves' from the boundary)
|
|
|
11/02/2008, 00:06
|
#11
|
elite*gold: 0
Join Date: Mar 2006
Posts: 583
Received Thanks: 182
|
there's an another coord system in memory, use that one instead of the onscreen coords. the one in memory is a norm horizontal/vertical axises
|
|
|
11/02/2008, 02:07
|
#12
|
elite*gold: 20
Join Date: Oct 2008
Posts: 976
Received Thanks: 668
|
swords@
UPSman2 is correct, use the system coord system is much better, because it does not require to shift 45 degrees as the on screen coordinate:
so yea, dont use this coordinate system
as it will make a mess if u trying to shift 45 degrees
although its possible by using matrix * tan(pi/4)
and about the vector formulas:
Code:
unitVector := Sqrt((NextPathX - CurrentX) **2 + (NextPathY - CurrentY) **2)
clickX:= round((NextPathX - CurrentX) / unitVector * 250) + 513
clickY:= round((NextPathX - CurrentX) / unitVector * 250) + 384
if u dont understand that, u can read this:
513 and 384 is the X,Y point of ur character in client
250 means form a circle with radius 250pixel around the character point
CurrentX and CurrentY are the dllcall memory reading of ur current location
NextPathX and NextPathY are the next path point ur character trying to go
clickX and clickY are the points that where u should be clicking (using the 250 radius circle)
|
|
|
11/02/2008, 04:57
|
#13
|
elite*gold: 20
Join Date: Dec 2005
Posts: 811
Received Thanks: 352
|
Well I do not know how to find this system coordinate and why make it so complicated with math formulas... Simply finding the address of the x, y coordinate in Cheat Engine and plugging it in and put several points to make a boundary sounds much easier than breaking it down to some huge math equation.... :S
If I can be given proof and examples of how to do this, I'll believe you...
EDIT: I do, now that I re-read, understand your concept a tad better... But Why do you have CuurentX but also 513... Aren't those the same? A Quick question... How did you manage to find this mathematical equation?
And In theory could you put for NextPathX (and Y) and variable from an input box?
So say my Input box is:
$InputBox1= (user types in 200)
I could do instead of CurrentX - NextPathX I could do CurrentX - $InputBox1 .... Right?
But then theres the question of... how does this make a boundary and how can this be put into a randomised bot? I don't want to personally set the boundary to jump to because every spawn varies... And I don't JUST want the bot to follow these routes... I want it RANDOMLY jumping within a perimeter. Your bot gives me the idea of this:


|
|
|
11/02/2008, 15:39
|
#14
|
elite*gold: 20
Join Date: Oct 2008
Posts: 976
Received Thanks: 668
|
swords@
ELSEpath and Archer bounce are both made with system coordinate
while ELSE is using vector equations and bounce is using boundary
which the position of system coordinate is
CharName + hex68 = systemX
systemX + hex4 = systemY
i am a math major student...so yea, i just know the triangle formula
btw..u should have learnt that before
doesnt that familiar to u? lets say u have 2 coordinate points, and u try to go from A to B by walking Right few steps from A, then Up few steps to arrive B. and that right few steps and up few steps are exactly what vector is
so yea, CurrentX and CurrentY are the A, and NextPathX and NextPathY are the B
but since ur screen is keep moving and ur character always stay in middle of the game screen
thats why we need a circle with radius 250 and fixed it in the center point of character 513, 384
input a coordinate shouldnt be a problem
and following the first image that u provide has nothing wrong with it
because when u actally botting, your character will move outside the pathlines and attack monsters, afterwards it will move back to the pathlines
which means every single loop is 100% different
(ELSE can save pathpoints in INI and use those points next time without re-inputting)
but according to the image2, if u want, u can do:
user input path value x200, y200
there should be a generator that produce lets say 3 more points randomly within the range 100:
minX = $x - 100
maxX = $x + 100
minY = $y - 100
maxY = $y + 100
random, outputx_1, $minX, $maxX
random, outputy_1, $minY, $maxY
random, outputx_2, $minX, $maxX
random, outputy_2, $minY, $maxY
random, outputx_3, $minX, $maxX
random, outputy_3, $minY, $maxY
which the outputx and outputy should be regenerated every time the loop passes
if i see someone just running around according to the path in image2, i can guaranteer the person is botting. you are just thinking too complicated, just a simple walking path is what a normal person would do. and if u think path function might miss certain spots, then just add one more point in that spot next time then, problem fixed.
usually when i make path points on a spawn, first i have four points
bot around 5-10mins, see if any missing spot, if yes, then just add a point at the end of the INI saved path points file
|
|
|
11/02/2008, 23:44
|
#15
|
elite*gold: 20
Join Date: Dec 2005
Posts: 811
Received Thanks: 352
|
Quote:
Originally Posted by Evan Lim
swords@
ELSEpath and Archer bounce are both made with system coordinate
while ELSE is using vector equations and bounce is using boundary
which the position of system coordinate is
CharName + hex68 = systemX
systemX + hex4 = systemY
i am a math major student...so yea, i just know the triangle formula
btw..u should have learnt that before
doesnt that familiar to u? lets say u have 2 coordinate points, and u try to go from A to B by walking Right few steps from A, then Up few steps to arrive B. and that right few steps and up few steps are exactly what vector is
so yea, CurrentX and CurrentY are the A, and NextPathX and NextPathY are the B
but since ur screen is keep moving and ur character always stay in middle of the game screen
thats why we need a circle with radius 250 and fixed it in the center point of character 513, 384
input a coordinate shouldnt be a problem
and following the first image that u provide has nothing wrong with it
because when u actally botting, your character will move outside the pathlines and attack monsters, afterwards it will move back to the pathlines
which means every single loop is 100% different
(ELSE can save pathpoints in INI and use those points next time without re-inputting)
but according to the image2, if u want, u can do:
user input path value x200, y200
there should be a generator that produce lets say 3 more points randomly within the range 100:
minX = $x - 100
maxX = $x + 100
minY = $y - 100
maxY = $y + 100
random, outputx_1, $minX, $maxX
random, outputy_1, $minY, $maxY
random, outputx_2, $minX, $maxX
random, outputy_2, $minY, $maxY
random, outputx_3, $minX, $maxX
random, outputy_3, $minY, $maxY
which the outputx and outputy should be regenerated every time the loop passes
if i see someone just running around according to the path in image2, i can guaranteer the person is botting. you are just thinking too complicated, just a simple walking path is what a normal person would do. and if u think path function might miss certain spots, then just add one more point in that spot next time then, problem fixed.
usually when i make path points on a spawn, first i have four points
bot around 5-10mins, see if any missing spot, if yes, then just add a point at the end of the INI saved path points file
|
Well I'm not all that good in this high-standard of math... My method will work perfectly good and you said somethin if you saw somethin runnin around as image2 you would know they are botting... Because I sure as heck wouldn't because anything my bot is completely random... Yours is on a set path + 10 on either side of the path and thats it... Mine jumps anywhere it pleases within the set boundary... :O
|
|
|
 |
|
Similar Threads
|
Any one who's willing to be A Tutor in HAcking and editing.
01/05/2010 - Grand Chase Philippines - 0 Replies
Guys... Im New In this forum and i would like to greet those famous names here like soulimperfect and sir.brian i also use your cheats in order to gain some eXp in GAme.... It so hard to be A leecher and i also want to make my own cheat. thnx to all...:awesome::awesome :awesome:
by The way we can be a good friend Just add me [email protected] THnx.
|
Need Tutor Using GLZ Engine
06/05/2009 - Grand Chase Philippines - 0 Replies
add me YM: [email protected]
Need help
|
PLS TUTOR ME IN CE CABAL
01/27/2009 - Cabal Online - 3 Replies
i can't use ce in cabal, pls teach me
|
[HELP] need tutor using bot for pw indo
11/15/2008 - PW Hacks, Bots, Cheats, Exploits - 2 Replies
can someone share info using bot for pw indo
im so blind 'bout cheat/bot pw
|
Looking for tutor
08/22/2007 - Silkroad Online - 6 Replies
Hello. Im looking for somebody who I could talk to over xfire or msn. I need help getting a bot running. I have botted before, but this time Im stuck and can't get neither TBOT or iSRObot running. Not many people reply at forums and I don't want to spam all over the place.
If you could help me PM me or leave your MSN/Xfire/mIRC channel or what ever else here.
Thanks.
|
All times are GMT +1. The time now is 13:14.
|
|