AutoIt bot making!

07/14/2006 01:37 swords#1
Alright first you need to get AutoIt (autoitscript.com) Look for the downloads etc. Once downloaded right click on your desktop and go to New (like where you can create a new folder etc) And it will say new Autoit script and have the little picture, click it for the name, name it like test.au3. Ill explain a little program first the concept of Mouse clicking.

Code:
MouseClick("left")
Alright this will left click many times in VERY rapid succession. Now lets make it a little bit more complicated.

Code:
MouseClick("left", 500, 200, 5)
Try to figure this out...

************
*******************
************
*******************

Got it? Probably not because you dont know the functions totally yet :D

Ok first function is left, that means it will use left clicks, 2nd function is the coordinates on your computer screen that it will click on, 3rd one (the 5) is how many times it will click at those coordinates. (After the 5 you may add this ', 500')
that will click the coordinates every 500 ms (milliseconds)

Ok lets go on to a more harder script for people who do autoit but not are very good.

Tell me what this will do:

Code:
    While 1
        $pixelsearch = Pixelsearch(0, 0, @Desktopwidth, @DesktopHeight, "0xB50400", 1, 38)
     If @error <> 1 then
       MouseClick("right", $pixelsearch[0], $pixelsearch[1] )
     Endif
   Wend
Alright that script is probably really messy because im trying to spacebar to indent since i cant use Tab in here lol. But when you have them lined up it works :P

Alright a pixelsearch is a function that pretty much... searches for the pixels 0xB50400 (which is a red color of a monsters health bar) throughtout the whole desktop

after that you will see a comma then a 1 that means it can only differ between 1 pixel (like its pretty much the same but a 0 would be that exact color) then the comma 38 means that it searches EVERY 38 pixels on the desktop to speed up the process. the arrays pixelsearch[0] pixel search[1] are too complicated for many people and ive jsut learned them like a month ago so not much to teach yet :)

For now thats all for todays lesson, if people actually get interested in this post ill post more later but before i go i need to explain the While 1 WEnd

Alright any code thats between While 1 and WEnd will loop (continue the script over and over thats between the while 1 and wend until something else comes up)

Also i cant teach everything you need to work for yourself as i did using the autoit help document in the autoit folder.
07/14/2006 13:10 stillnoob#2
Can you explain how to read memory adresses and also the specific offset, like the health bar ?
Im thinking in an Autolife...
07/14/2006 14:49 swords#3
Yes of course by using pixel functions, lol kind of funny atm as i read this im making a sweet autopotter as well. But yes if yo uget autoit i may help you with a simple one :)
11/11/2007 23:35 yum_batyum#4
thanks been trying to figure out how to do this but 1 question, how you make it only search the window...
11/13/2007 07:06 nathan6911#5
Quote:
Originally Posted by yum_batyum View Post
thanks been trying to figure out how to do this but 1 question, how you make it only search the window...
i need help with same thing:confused:
11/13/2007 08:49 emmanication#6
this has been a problem to me.

if u make a pixel search it only does it once. so in order to make a autopotter u need to search that region for pixels to see if it changes right?

how do u make it? function?
11/15/2007 04:07 evanxxxm#7
AutoIt is more like C++ scripts, too hard for me to learn it. so i pick autohotkey, which works no less function than autoit, but with a easier coding.
anyways, if u are using autohotkey instead of autoit, the following scripts will help u:


WinGet,COid, ID,[Conquer2.0] <-- focus only on CO window into var=COid
example: ControlClick, x110 y749,ahk_id %COid%,,RIGHT <-- Right Click on the F1 slot, works also with CO screen as background or minimize

for pixel search to check very second, we can use:
example: press F1 slot if HP is lower than 50%
loop
{
PixelSearch, , , 10, 720, 60, 720, 0x0B098F, 10, Fast
if ErrorLevel
{
ControlClick, x110 y750,ahk_id %COid%,,RIGHT
}
else
{
sleep 1000
}
}
11/05/2009 14:21 hachebe#8
i kinda wanne make a bot for the game freelancer simply to leave my account on and let my bot do the trading(the largest resourse for money in this universe) i want the bot to let my char fly between 2 stations and buy and sell in each of these stations
i found 2 stations near each other with just a few steps with a lot of cash
i wrote down everything i do to move between these stations and i kinda think the bot does exactly that
are at a planet ( in this case planet new london)
-go to market
-speak with merc
-buy 450 cargo
-go to landingpad
-launch into space
-search tradelane [planet new london,<other space station>]
-dock with tradelane [planet new london,<other space station>]
-search <other space station>
-dock with <other space station>
-go to market
-speak with merc
-sell 450 cargo
-go to landing platform
-launch into space
-search for tradelane [<other space station>,planet new london]
-dock with [<other space station>,planet new london]
-search docking ring planet new london
-dock with docking ring planet new london
=> repeat
now all the thing who are underlined should be changeable when i change location and ofcource the other station has a nam i just fergot
if anyone could tell me what the best way to make this bot is it would be greatly appreciated
i googled a lot but all i can do now is make a msgbox in autoit
i need this plz help me
thx up front
pieter
12/21/2009 04:58 ax5#9
Quote:
Originally Posted by swords View Post
Alright first you need to get AutoIt (autoitscript.com) Look for the downloads etc. Once downloaded right click on your desktop and go to New (like where you can create a new folder etc) And it will say new Autoit script and have the little picture, click it for the name, name it like test.au3. Ill explain a little program first the concept of Mouse clicking.

Code:
MouseClick("left")
Alright this will left click many times in VERY rapid succession. Now lets make it a little bit more complicated.

Code:
MouseClick("left", 500, 200, 5)
Try to figure this out...

************
*******************
************
*******************

Got it? Probably not because you dont know the functions totally yet :D

Ok first function is left, that means it will use left clicks, 2nd function is the coordinates on your computer screen that it will click on, 3rd one (the 5) is how many times it will click at those coordinates. (After the 5 you may add this ', 500')
that will click the coordinates every 500 ms (milliseconds)

Ok lets go on to a more harder script for people who do autoit but not are very good.

Tell me what this will do:

Code:
    While 1
        $pixelsearch = Pixelsearch(0, 0, @Desktopwidth, @DesktopHeight, "0xB50400", 1, 38)
     If @error <> 1 then
       MouseClick("right", $pixelsearch[0], $pixelsearch[1] )
     Endif
   Wend
Alright that script is probably really messy because im trying to spacebar to indent since i cant use Tab in here lol. But when you have them lined up it works :P

Alright a pixelsearch is a function that pretty much... searches for the pixels 0xB50400 (which is a red color of a monsters health bar) throughtout the whole desktop

after that you will see a comma then a 1 that means it can only differ between 1 pixel (like its pretty much the same but a 0 would be that exact color) then the comma 38 means that it searches EVERY 38 pixels on the desktop to speed up the process. the arrays pixelsearch[0] pixel search[1] are too complicated for many people and ive jsut learned them like a month ago so not much to teach yet :)

For now thats all for todays lesson, if people actually get interested in this post ill post more later but before i go i need to explain the While 1 WEnd

Alright any code thats between While 1 and WEnd will loop (continue the script over and over thats between the while 1 and wend until something else comes up)

Also i cant teach everything you need to work for yourself as i did using the autoit help document in the autoit folder.
I made a Design to make a program and i whant the program to change the Speed on the program procces.. Help to finish script ?

Quote:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Speed", 187, 179, 253, 154)
$Slider1 = GUICtrlCreateSlider(38, 66, 121, 33)
$Add = GUICtrlCreateButton("Add", 45, 112, 105, 33, $WS_GROUP)
$Pic1 = GUICtrlCreatePic("img/soft01-s.jpg", 0, 0, 185, 177, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Select = GUICtrlCreateLabel("Select a speed", 63, 47, 154, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd