Ok, seeing there are a few of you out there who want to make macros using auto it i will share with you some code and explain what it does. Then from there you can ask questions on how to solve specific problems that you want your macro to be able to do.
The first thing you need is to be able to detect a monster and attack it, or in the case of a warrior using a mage ue with wind beads, to aim the windbeads at the monster.
So, what you need to do is to scan through a range of pixils looking for something specific that only a monster has, and that is the red bar above the name. Auto-IT has a pixil search function and to use it you write code like this,
Code:
$=PixelSearch(200,100,825,600,12059395,5)
$Coords is a variable to hold the return value from the function PixelSearch all variable in auto-it have a $ prefixing them. the values that follow PixilSearch are start_x, start_y, end_x, end_y that determines the range on the screen that it will scan, the next number is a colour, to determne the exact colour you need to use something like photoshop to get a RGB value which you can convert to a hex or decimal value, the number 12059395 is a decimal value for the colour red as scene on my display, this value may vary for you. The last number 5 is a skip value, its the number of pixils to skip per scan, see you check every one is overkill, the red bar is about 15 pixils long, so you only need to hit 1 pixil of the colour 12059395 to get a result, 5 is a fairly accurate and speedy way to scan for the colour.
Anyways, im tired and am going to bed, here is my complete attack function,
Code:
Func Attack()
$=PixelSearch(200,100,825,600,12059395,5)
If NOT @error Then
MouseClick("left",+10,+20,1,0)
Sleep(2500)
Else
MoveRandom()
EndIf
EndFunc ;==> This function searches for the RED monster bar attacks if it finds one, or moves to a new location if there is no monster found.
So what does it do,
1. if searches for the red in the monster bar,
2. it checks to see if $Coords has a value
3. clicks on the monster to begin attacking if $Coords has value
4. waits for a period of time because if it does not pause for a while, you will move on before you killed the monster.
5. if $Coords is not valid, it will move you to another location MoveRandom() is a function call, its a function that you will have to write yourself, there are a number of ways you can do this, have a go at it yourself.
Forum does some weird shit to code blocks, in the code blocks replace $ with $Coords