Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Guides & Templates
You last visited: Today at 22:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



The FULL guide to making your own Bots/Macros...PART 2

Discussion on The FULL guide to making your own Bots/Macros...PART 2 within the CO2 Guides & Templates forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Hiyoal's Avatar
 
elite*gold: 20
Join Date: Mar 2007
Posts: 2,444
Received Thanks: 1,066
Talking The FULL guide to making your own Bots/Macros...PART 2

Part 2

Hi all,

This is the second guide to making your own Bots and Macros using the script writer AutoIt. I have explained basic fundamentals in my previous Basic Guide on how to create Bots and Macros for Conquer and I will be further sharing my knowledge on how to create bots using Mouse Clicks and GUI for your programs.

Contents:
1. AutoIt Window Info
2. Mouse Functions
• MouseClick
• MouseMove
• MouseGetPos
• MouseClickDrag
• MouseDown and MouseUp
• MouseWheel

3. What are GUI’s?
4. Creating a GUI
• Making Transparent

5. Incorporating past knowledge into GUI
6. Debugging Code


1. AutoIt Window Info

In this tutorial I will be using AutoIt Window Info for both Mouse Functions and GUI. AutoIt Window Info can be found in your AutoIt folder. Eg. “C:\Program Files\AutoIt3\Au3info.exe”. This program enables you to get information about a program which you can use for GUI and mouse such as finding what coordinates your mouse is at.

2. Mouse Functions

Conquer 2.0 is a clicking game. You don’t use the arrow keys at all, so for making Bots and Macros for Conquer 2.0 you need to incorporate the mouse. AutoIt scripting supports mouse functions in all the ways you will ever need it to.

• MouseClick
MouseClick is a function which tells the cursor in Windows to click. You can specify which button you want clicked, where you want it clicked and how many clicks you want the macro to send to the mouse.

Eg. This is an example of the MouseClick Function.

Quote:
Originally Posted by Hiyoal
MouseClick("Left",76, 749,1) ;Order of operations are "MouseClick" function, "Mousebutton" being used, "x" and "y" pixel axis of screen, "clicks" the number of clicks
Sleep(2000) ;stalls program for 2 seconds
MouseClick("Left",981, 757,2) ;clicks on your Time bar
• MouseMove

MouseMove is a function which tells the cursor in windows to change its position (measured in pixels). You can specify where to move the mouse and how fast it should change its position (Range: 0 “Fastest”, 100 “Slowest”)

Eg. This is an example of the MouseMove Function.

Quote:
Originally Posted by Hiyoal
MouseMove(10,10,0) ;moves mouse to points 10,10 (pixels) in an instant
Sleep(5000) ;stalls for 5 seconds
MouseMove(100,57,50) ;moves mouse to points 100,57 (pixels) slower than first mousemove
• MouseGetPos

MouseGetPos is a function which tells the program where your mouse is (x and y values of coordinates). This can be used to make an autoclicker for Conquer but to specify where the mouse is for the MouseClick function, you need to make a declaration before so that the program can read where the mouse is and store it, not just find where the mouse is and never use it.

Eg. This is an example of an autoclicker

Quote:
Originally Posted by Hiyoal
Global $counter=0 ;globally declare $counter to the program, not just as a variable contained in a Function

While 1
HotKeySet("{INSERT}","Start")
HotKeySet("{END}","END")
WEnd

Func Start()
$counter=1
While $counter=1
$getpos=MouseGetPos() ;finds where the mouse is at (in x and y coordinates)
MouseClick("Left",$getpos[0],$getpos[1],1) ;$getpos[0] is the x coordinate number from MouseGetPos and $getpos[1] is the y coordinate number from MouseGetPos
WEnd
EndFunc


Func End()
$counter=0
EndFunc
• MouseClickDrag

MouseClickDrag is a function which tells the mouse to click at a coordinate and hold down the mouse button and move to another coordinate. This can be used to make an Autotrader in Conquer or an Autodropper.

Eg. Here is an example of the mouseclickdrag function.

Quote:
Originally Posted by Hiyoal
MouseClickDrag("left", 0, 200, 600, 700, 5) ;Order: “Button”, “x” coord (#1), “y” coord (#1), “x” coord (#2), “y” coord (#2), “Speed”
• MouseDown and MouseUp

MouseDown is a function which tells the mouse to hold down the mousebutton until the MouseUp function is called.

Eg. This is how you can incorporate MouseDown and MouseUp Functions in AutoIt

Quote:
Originally Posted by Hiyoal
MouseDown(“Left”)
Sleep(10000)
MouseUp(“Left”)
• MouseWheel

MouseWheel is a function which tells the cursor or mouse functions for 2000/NT/XP to move the mousewheel in a direction for a certain amount of repetitions. This could be used in conquer to make an auto tao bot which casts spells and regens magic by sitting in the “Little rock” at PC Caves.

Eg.

Quote:
Originally Posted by Hiyoal
MouseWheel(“Down”,10) ;moves the mousewheel down 10 times (in clicks)
MouseWheel(“Up”,10) ;moves the mousewheel up 10 times (in clicks)
__________________________________________________ __________________________________________________ _________________________

3. What are GUI’s?

GUI stands for Graphical User Interface. This is User friendly and it is better to use a GUI instead of giving prompts such as MsgBoxes. You can also make it look nice and it gives the User an image to refer to instead of just pressing buttons and not knowing what they are doing.

4. Creating a GUI

GUI is Extremely Hard to create when writing code. It is much better if you can use your mouse to click and drag, resize and customise the look without debugging code continually. So… I have found a program on the internet called .
It is a visual GUI creator which makes creating GUI for AutoIt much faster then writing code.

If you are going to code GUI then always start off the coding with “#include <GUIConstants.au3>”



KODA is pretty straight forward to use but I have realised that it does not include Transparency for Labels in the Styles or ExStyles tabs. I have also figured out how to make transparent labels from making
THIS:


Into THIS:


• Making Transparent

To make transparent labels (only show text, doesn’t show grey background when on top of a picture), Generate Code from a GUI script with a background and a label in it, and copy and paste into an *.au3 file.

Next, open the script ([Edit script], not [Run script]) and find the words “GUICtrlCreateLabel”

Quote:
Originally Posted by Hiyoal
$Label1 = GUICtrlCreateLabel("Hello", 208, 40, 48, 28)
Now enter down a line from the end of $label1 and write “GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

Quote:
Originally Posted by Hiyoal
$Label1 = GUICtrlCreateLabel("Hello", 208, 40, 48, 28)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
as so.

Now you have Transparent Labels!!!

5. Incorporating past knowledge into GUI

From what we have learnt so far in creating and writing code in AutoIt, I can now explain how to make a GUI which…FUNCTIONS. If you just create a GUI with buttons and other fancy things but do not include any written code from the Part 1 Guide, Mouse Functions or File Read Functions then the program will do NOTHING.

Here is a template in which I have explained how to incorporate past knowledge into GUI. Open this up using SciTE editor and read the green lines if you do not understand how something works.



6. Debugging Code

If you ever want to know a value of a returned $variable then use MsgBoxes. I use these all the time to see whether a function has failed or succeeded in running through the code. You can check what some different values will return in AutoIt if you read the Help File. This is how I have learnt all the things I have been teaching you.

An example of debugging is:

Quote:
Originally Posted by Hiyoal

$value=Msgbox(3, “Test”, “Click on the buttons below and I can you can see what each returns”)
Msgbox(0, “”, $value)
You can now see that if you press the button:
“Yes”:: it will receive the value “6”
“No”:: it will receive the value “7”
“Cancel”:: it will receive the value “2”

You can now write code like this:

Quote:
Originally Posted by Hiyoal

$value=Msgbox(3, “Test”, “Click on the buttons below and I can you can see what each returns”)

If $value=6 Then
Msgbox(0, “”, “You pressed Yes”)
Exit
ElseIf $value=7 Then
Msgbox(0, “”, “You pressed No”)
Exit
ElseIf $value=2 Then
Msgbox(0, “”, “You pressed Cancel”)
EndIf
One last thing I have not pointed out with AutoIt scripting is that when you use the instance “InputBox”, you cannot just close it when it are in use (You can click the X button, but the Box will not close). I have not explained InputBoxes but by reading the prompts when in SciTE, you will be able to determine how they work.

To fix this “Close” error use code like this:

Quote:
Originally Posted by Hiyoal
[COLOR=Red
$value=[/COLOR]InputBox("Test", "Press the X Button","","")
If @error=1 Then
Msgbox(0,"","Close")
Exit
EndIf
That is the end of my Part 2 guide to creating Bots/Macros yourself.

I hope you have all found this very helpful because it has taken me a long time to write and edit this.

Written by Hiyoal
For ElitePvPers

Hiyoal
Hiyoal is offline  
Thanks
36 Users
Old 12/20/2007, 07:31   #2
 
Real~Death's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 1,272
Received Thanks: 246
nice guide
im sure it took some time thanks man
+K
Real~Death is offline  
Old 12/20/2007, 14:53   #3
 
elite*gold: 0
Join Date: Aug 2007
Posts: 267
Received Thanks: 28
Nice Guide

I might use this guide for making some bots xD
+k
Toopy is offline  
Old 12/20/2007, 19:37   #4
 
elite*gold: 0
Join Date: Jul 2007
Posts: 18
Received Thanks: 20
Awesome work, it's organized and easy to understand. I can't wait till I get on my computer to test this new info.

+K for you
DaSpy is offline  
Old 12/21/2007, 05:09   #5
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2
Received Thanks: 0
This doesn't make any sense, but how do you make green/red shadows?
ConquER_GuY_450 is offline  
Old 12/21/2007, 05:52   #6
 
elite*gold: 0
Join Date: Jan 2007
Posts: 331
Received Thanks: 361
Good guide
David5646 is offline  
Thanks
1 User
Old 12/21/2007, 06:01   #7
 
Hiyoal's Avatar
 
elite*gold: 20
Join Date: Mar 2007
Posts: 2,444
Received Thanks: 1,066
@ConquER_GuY_450
Shadows for what???
And if you have read the First Guide to Making Bots and Macros then you would have understood this. It is all pretty basic and everyone except you has understood it -_-

Thanks to everyone else neway. Im glad you like it :P

Hiyoal
Hiyoal is offline  
Thanks
1 User
Old 12/21/2007, 06:48   #8
 
elite*gold: 0
Join Date: Dec 2007
Posts: 1
Received Thanks: 0
Thumbs up XD

thanks man XD
-Truth- is offline  
Old 04/19/2008, 21:54   #9
 
elite*gold: 0
Join Date: May 2006
Posts: 63
Received Thanks: 2
Thank you for the guide. Its great not having to be a leech..

Very helpful.
IJazzI is offline  
Old 04/19/2008, 22:16   #10
 
elite*gold: 0
Join Date: Nov 2007
Posts: 182
Received Thanks: 29
Good Guid !
Can you explain why can I modified memory adress and packet ?

Thx
anerax is offline  
Old 04/19/2008, 23:49   #11
 
Hiyoal's Avatar
 
elite*gold: 20
Join Date: Mar 2007
Posts: 2,444
Received Thanks: 1,066
I dont know packets, but I do know memory.

Ill make a new guide in the future explaining memory reading/writing and pixel search functions.

Hiyoal
Hiyoal is offline  
Old 04/20/2008, 11:20   #12
 
elite*gold: 0
Join Date: Nov 2007
Posts: 182
Received Thanks: 29
Thx, in fact, i would like when i "clic" on start, the memory adress value of xxxxxxxxx become 128 and the character speedhack...is it possble ?
anerax is offline  
Old 04/21/2008, 08:40   #13
 
Hiyoal's Avatar
 
elite*gold: 20
Join Date: Mar 2007
Posts: 2,444
Received Thanks: 1,066
Anything is possible. Look at UPSman's source code in autoit, it has this exact example you are looking for

Hiyoal
Hiyoal is offline  
Old 05/23/2008, 22:18   #14
 
elite*gold: 0
Join Date: May 2008
Posts: 1
Received Thanks: 0
great guide,
but i cant find one think: pixle serch, actuly i need script wich would detect two difrent pixles one next to one.
for exsample 0xFFFFF and next to it 0xFFFFC
i need that for some bot,

well if u know site/topic where i could get that/lern to make that or u can write it please help ><
kenners is offline  
Old 05/24/2008, 11:25   #15
 
Hiyoal's Avatar
 
elite*gold: 20
Join Date: Mar 2007
Posts: 2,444
Received Thanks: 1,066
Help file is always good to check. Or ask a question on the AutoIt forums.

Hiyoal
Hiyoal is offline  
Reply


Similar Threads Similar Threads
[GUIDE]AutoIt Part 1. Building Bots/Macros for Newbies
02/27/2011 - RFO Hacks, Bots, Cheats, Exploits & Guides - 33 Replies
Part 1 Hi all, As you have read in the thread title, this is a FULL guide for creating your own Bots and Macros. I will be teaching you some of the basic fundamentals in programming and also some advanced fundamentals which will include creating GUI's for your Bots and Macros. Advanced fundamentals will be in the 2nd Part of this tutorial. Contents: 1. What we are using 2. Introduction to the AutoIt language
The FULL guide to making your own Bots/Macros...PART1
04/19/2008 - CO2 Guides & Templates - 27 Replies
Part 1 Hi all, As you have read in the thread title, this is a FULL guide for creating your own Bots and Macros. I will be teaching you some of the basic fundamentals in programming and also some advanced fundamentals which will include creating GUI's for your Bots and Macros. Advanced fundamentals will be in the 2nd Part of this tutorial. Contents: 1. What we are using 2. Introduction to the AutoIt language



All times are GMT +2. The time now is 22:42.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.