Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 03:12

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

Advertisement



How to create your own bots/macros with AutoIt

Discussion on How to create your own bots/macros with AutoIt within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2006
Posts: 249
Received Thanks: 79
Starting Your Script

Creating your own bots and macros can be fun, and its very simple to do. This guide will talk about some basic methods on using AutoIt, and some very useful functions AutoIt provides that would help in making macros for Conquer.

First, if you don't have it already, download AutoIt by clicking the following link.


To start a new script, either go to Start>All Programs>AutoIt v3>SciTE Script Editor, OR right click your desktop and click new>AutoIt v3 Script.

Functions

Everybody probably knows what a function is, but if you don't, I'll give a brief description. A function is a series of commands that you can execute easily in one line of code. For example, in AutoIt there is a built in function called MouseClick(). What goes inside the parentheses are called parameters. The parameters tell the function specifically how to work. But you have to know the parameters that a function requires before using that function.

In MouseClick(), you have to enter the following in the parentheses: ("mousebutton(left or right)", x-coord, y-coord, #of clicks, speed)
For example, if I typed 'MouseClick("left",60,60,2,1)', it would move the mouse to coordinates (60,60), and click twice. The speed can be 1-10, 1 being instantly.

There are only a few functions that are useful in making bots/macros for CO, and these are the ones most useful to me:

sleep(time) --- ex. sleep(1000) would pause the script for 1 second
send(key) --- ex. send("{F1}") would hit the F1 key.
---More keys are "{CTRLDOWN}" , "{CTRLDOWN}" , "{LSHIFT}" , and "{RSHIFT}"

User-Defined Functions

The name is pretty self explanatory. These are functions that are made by the user, and can be called any time in the program by the user. To make your own function you type the following"

Func Click() ;creates a function called "Click". Since the parentheses are empty, this function doesn't require any parameteres from the user.
sleep(1000) ;code inside function
MouseClick("left",150,60,1,1) ;code inside function
sleep(1000) ;code inside function
EndFunc ; ends the function

Now, if the programmer at any time wants the program to pause 1 second, click (150, 50) one time, and then wait another second; they just have to type 'Click()'

Loops

You need to know how to do a loop in AutoIt to made a macro for CO, as when you make a macro you are going to want it to run continuously.

The loop I use most is a 'While', and they are very simple to use. If you want a loop to go forever simply type this:

While 1 ;starts loop
MouseClick("left",150,100,1,1)
sleep(1000)
WEnd ;where loop ends

Say you want something to run 10 times. You can use a counter variable to mark how many times something has ran. For example:

$counter=1 ;declares a variable "$counter" and sets its value at 1
While &#036;counter<=10 ;this loop will run as long as &#036;counter is less than or = to 10
MouseClick("left",150,100,1,1) ;code inside loop
sleep(1000) ;code inside loop
&#036;counter=&#036;counter+1 ;increments counter by 1. This makes this a non-infinite loop
WEnd ;end of loop

HotKeys

Say you want a loop to run forever, but exit when you hit "Ctrl+Alt+x". You have to set a hotkey, that when pressed, will trigger a Use-Defined Function. For example, this would be the whole program:

HotKeySet("^!x","QuitLoop") ; when the program is running, hitting "ctrl+alt+x" will call the function called "Quit"

&#036;counter=0 ; declares a counter variable

Func QuitLoop() ;user defined func called 'QuitLoop'
&#036;counter=1 ; if func QuitLoop is called, &#036;counter will become 1
EndFunc

While &#036;counter=0 ; loop goes while &#036;counter is 0
MouseClick("left",150,60,1,1) ; code inside loop
sleep(1000) ; code inside loop
WEnd

^^In the above program, the loop will continue running until somebody hits "Ctrl+Alt+x', making &#036;counter=1. If you want to make it so the whole program will automatically exit, use this hotkey:

HotKeySet("^!x","QuitProg") ;sets hotkey
Func QuitProg() ;user-defined-function
Exit ; quites out of the script
EndFunc

If-Statements

An if-statement tell the computer to do something only if certain conditions are met. If statements make the programs make decisions on what to do based on what the program user has inputted/clicked. To help with this example, I'll show you how to make a very simple built-in GUI (Graphic User Interface (windows)).

&#036;nbr=InputBox("Input Box","Give me a number 1-100") ;InputBox() is a built in GUI function that automatically creates a window where the user enters text or a number. Since there is a '&#036;nbr=' before it, whatever the user enters into the box will be stored into the variable '&#036;nbr'
If &#036;nbr>50 Then ; If &#036;nbr is greater than 50 THEN do the following until the if is closed
MsgBox(0,"Output Box","Your number was greater than 50") ; like inputbox, but simply displays text to the user and exits when they click "ok"
EndIf ; end of the if-statement
If &#036;nbr<50 Then
MsgBox(0,"Output Box","Your number was less than 50")
EndIf
If &#036;nbr=50 Then
MsgBox(0,"Output Box","Your number was 50")
EndIf

^^These are VERY basic GUIs, because they are built in, you don't really even create them. If people like this guide and I get some positive feedback from it, I will make another guide that goes into the detail of creating GUIs.

Compiling Scripts to .exe

When you have your script written and tested, go to start>programs>AutoIt v3>Compile script to .exe. Find your script file, and click "Convert". If you have a .ico editor you can attack and .ico to serve as your .exe's icon.

I know the examples I posted don't really create macros, but when you combine things together and be creative, you can make a fullworking macro. Here are two programs I wrote using AutoIt. If you download AutoIt, you can decompile them and look at the code to help you out or play around with it. Here they are:


spoonieluv97 is offline  
Thanks
52 Users
Old 01/06/2007, 21:15   #2
 
elite*gold: 0
Join Date: Apr 2006
Posts: 249
Received Thanks: 79
Any questions? It took me a while to write this
spoonieluv97 is offline  
Thanks
5 Users
Old 01/06/2007, 21:18   #3
 
elite*gold: 0
Join Date: Jan 2006
Posts: 157
Received Thanks: 10
German Translation would be nice!^^
[G]oc[K] is offline  
Thanks
4 Users
Old 01/06/2007, 21:23   #4
 
elite*gold: 0
Join Date: Jul 2006
Posts: 274
Received Thanks: 20
Im going to try this. If it works well, i give you some karma.
TT_TT is offline  
Thanks
3 Users
Old 01/06/2007, 21:38   #5
 
elite*gold: 0
Join Date: Mar 2006
Posts: 72
Received Thanks: 8
Nice work...*Dusts off AutoIt*
+K
Nakor5 is offline  
Thanks
3 Users
Old 01/06/2007, 21:43   #6
 
elite*gold: 0
Join Date: Mar 2006
Posts: 251
Received Thanks: 4
nice
darkhobo is offline  
Thanks
3 Users
Old 01/06/2007, 21:50   #7
 
elite*gold: 0
Join Date: Apr 2006
Posts: 249
Received Thanks: 79
Quote:
Originally posted by Nakor5@Jan 6 2007, 21:38
Nice work...*Dusts off AutoIt*
+K
Lol. Tyvm.
spoonieluv97 is offline  
Thanks
3 Users
Old 01/06/2007, 22:07   #8
 
elite*gold: 0
Join Date: Dec 2006
Posts: 208
Received Thanks: 4
Hey very good guide I use autoit to make bots and macros +karma.
monkeyman6969 is offline  
Thanks
2 Users
Old 01/06/2007, 22:15   #9
 
elite*gold: 0
Join Date: Apr 2006
Posts: 249
Received Thanks: 79
Quote:
Originally posted by monkeyman6969@Jan 6 2007, 22:07
Hey very good guide I use autoit to make bots and macros +karma.
Thanks. You got a really funny sig lmao.
spoonieluv97 is offline  
Thanks
2 Users
Old 01/07/2007, 00:48   #10
 
elite*gold: 0
Join Date: Sep 2006
Posts: 199
Received Thanks: 26
I wish more people would read it. Because that's all they need to do basic stuff like stiggers etc... ^^
Christoph_ is offline  
Thanks
2 Users
Old 01/07/2007, 05:47   #11
 
elite*gold: 0
Join Date: Apr 2006
Posts: 249
Received Thanks: 79
Quote:
Originally posted by Christoph_@Jan 7 2007, 00:48
I wish more people would read it. Because that's all they need to do basic stuff like stiggers etc... ^^
Very true. And people can also customize their own bots in case somebody elses doesn't work as well as it could for them.
spoonieluv97 is offline  
Old 01/07/2007, 07:16   #12
 
elite*gold: 0
Join Date: Apr 2006
Posts: 112
Received Thanks: 2
Nice guide, it works pretty well +1k
<BlAzE> is offline  
Old 01/07/2007, 09:50   #13
 
elite*gold: 0
Join Date: Jan 2007
Posts: 15
Received Thanks: 0
Nice ! im a noob in this kind of thing so
this guide would help really much ^^ +1k
NeoVivi is offline  
Old 01/07/2007, 17:44   #14
 
elite*gold: 0
Join Date: Apr 2006
Posts: 249
Received Thanks: 79
If you guys understand this, but don't understand how you cna use it to make a macro, just decompile my water leveler and my Archer Bot. The archer bot has code that searches for a certain color pixel (color of monster health bars). You guys should find that in the code or I'll post it in this guide. Its very important to know how to do if your going to make any kind of auto-leveling bot.
spoonieluv97 is offline  
Old 01/07/2007, 19:42   #15
 
elite*gold: 0
Join Date: Jul 2006
Posts: 274
Received Thanks: 20
Can you post simple codes?
TT_TT is offline  
Reply


Similar Threads Similar Threads
[GUIDE] How to create Scripts/bots with AutoIT
09/22/2010 - Tutorials - 6 Replies
for all who want to learn something or create bots for browsergames, mmorpgs and other games download Autoit here: http://www.autoitscript.com/cgi-bin/getfile.pl?au toit3/autoit-v3-setup.exe Now run the Scite Script Editor this is where you type in your code, let check your code if errors are in it and compile it to executable exe file. the first thing you need are the coordinates of your mouse to find locations on the screen, like skill buttons, status bars, or just positions which...
(GUIDE)How to create own scripts/bots with AutoIt
11/19/2008 - Rappelz - 4 Replies
for all who want to learn something or create bots for browsergames, mmorpgs and other games download Autoit here: http://www.autoitscript.com/cgi-bin/getfile.pl?au toit3/autoit-v3-setup.exe Now run the Scite Script Editor this is where you type in your code, let check your code if errors are in it and compile it to executable exe file. the first thing you need are the coordinates of your mouse to find locations on the screen, like skill buttons, status bars, or just positions which...
learning how to create/write Bots/Macros
01/28/2006 - Conquer Online 2 - 8 Replies
Well I know that this is kind of off topic and a lot of people have been flamed by asking questions. I've tried a search and couldnt really find anything in english that i could actually read. Does anyone know any good sites or anything that a beginner could start learning how to create/write programs for bots and stuff like that? I'm learning how to write programs in VisualBasic at school but dont really know much. If anyone could supply any sites and stuff it would be awesome. thanks in...



All times are GMT +1. The time now is 03:13.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.