macro autoit

06/19/2008 14:29 Cyrox49#1
Hi. I'm french.Sorry for my bad english. My version of cabal is europea.
I tried to make myself a macro but it is only 2 days that I practice autoit.
I therefore know quite limited. I like to share with you my program. I've tested but has no effect on the game like most other programs of the forum that I tested. I'd like to know why.it's really a simple program you will not hurt to understand?:confused:


$x = 1
$y = 1

WinWaitActive("CABAL") ;activation of the window cabal
MsgBox(0, "", "Macro is started") ;beginning of macro

for $i = 1 to 1296000 step 1 ;number of pixels on my screen(it's a resolution 1440x900
If PixelGetColor($x, $y) = 0x00FF00 Then ;color on this monster(OOFFOO is an example)
MouseClick("left", $x, $y, 1, 0)
Sleep(300)
Send("{é}") ;key skill
Sleep(300)
EndIf

$y = $y + 1

If $y = 900 Then
$y = 1
$x = $x + 1
EndIf
next


I explain a little.I made a search pixel by pixel to find the color that I have clarified and which is present on the monster. Once the pixel found mouse clicks on the pixel and then selects the monster in theory:). I then on a skill but it does absolutely nothing in the game Can you help me where I give a simple macro just to kill a monster with a bot. Thank you
06/19/2008 15:02 Whazzzup#2
does your mouse move when u run the script?
Quote:
Send("{é}") ;key skill
why "e"? why not 1,2,3?
06/19/2008 15:07 Cyrox49#3
if I made in my testing program by replacing a cabal by paint and putting a pixel with the color that I chosi in my program it works very well. But once I did with the cabal that does not work anymore. Yet I have captured code of the color of the monster(a red garlie:)) to kill. Not my mouse does not move at all. I use "é" because it corresponds to my skill to use. I could put "2" if you want. You have an idea to help me. My priority right now is to move the mouse over cabal
06/19/2008 15:12 Whazzzup#4
which mob is it? did u take screenshot & eyedrop the mob's color?
06/19/2008 15:21 Cyrox49#5
It's a redgarlie. I did a screen of a redgarlie and paste the screen in paint.
I went through another program to capture the color of the pixel where point the mouse (on the body of garlie) and it gave me the hexadecimal code of the color (orange dominance)

Here is the program :

Sleep(2000)

$var = PixelGetColor( 270 , 300 )
MsgBox(0,"The decmial color is", $var)
MsgBox(0,"The hex color is", Hex($var, 6))
MouseClick("left",260 , 230)
06/19/2008 15:50 Whazzzup#6
try this script,

[Only registered and activated users can see links. Click Here To Register...]
06/19/2008 15:54 Cyrox49#7
thanks. I tested it as soon as tonight
06/19/2008 18:05 Cyrox49#8
I tested the program. Moving the mouse over the red garlie but by working against it does not select. it positioned just above the cursor without click. I'm looking but I did not see why

$xTop = 30; i declare them
$yTop = 73
$xBot = 1002
$yBot = 692
$mobGreen = "0xFF5D0F"; i also declare the mob color

Sleep(6000)
while 1
$coord = PixelSearch($xTop,$yTop,$xBot,$yBot,$mobGreen,5);i search for the green mobs
$n = @error
If NOT @error Then;if the mob is found
while $n = 0;while it is still in the screen
$x = Random($coord[0], $coord[0]+40, 1);we randomize coordinates so we won't miss the mob
;since mobs have different shape and sizes
$y = Random($coord[1], $coord[1]+40, 1)
MouseClick("left", $x, $y, 2, 0); i click at the randomized coordinates the problem must come from this line mouseclick
$mm = PixelGetColor ( 378 , 12 ); i get the pixel color of that mob HP LIMIT
$mob = Hex($mm, 6);since the pixel i got is hex and PixelGetcolor function returns a decimal value i convert it
If $mob = "7B0000" Then; i compare the converted value i got from PixelGetColor in that point with the have i collected using AWI in the same point
ExitLoop; if it's a match (that means that the mob was selected)
;it will exit the loop and continue
EndIf
$coord = PixelSearch($xTop,$yTop,$xBot,$yBot,$mobGreen,5);w e repeat the same pixel search
; the ideea is that the program will try to click the mob untill he is selected
$n = @error
wend

;in this moment we have the mob selected
If $mob = "7B0000" Then ; but we check it anyway
while $mob = "7B0000" ; so as long as the mob is selected

Send("{F4}"); we just send the skills from F4 to F1
Send("{F3}"); chaotic i know but since we use speed hack
Send("{F2}");adding waiting times will just be a waste of time
Send("{F1}")

$mm = PixelGetColor ( 378 , 12 );we once again look for the mob's HP so we can complete the while loop
$mob = Hex($mm, 6);this means that the keys will be pressed untill the mob is dead
wend
Send("{Space}"); after the mob is dead we collect the items
Sleep(200)
Send("{Space}")
Sleep(200)
Send("{Space}")
Sleep(200)
EndIf

;now remember the "IF NOT @error Then" from the start?
;what if there is no mob in the screen?
;what then?

Else;if no mob is found
Send("{Right 7}") ;rotate the camera to look in other directions
Endif
Wend



HELP ME PLEASE!It progresses!
06/19/2008 18:39 Whazzzup#9
dont just copy/paste above script u have to modify it as well.

Quote:
MouseClick("left", , , 2, 0); i click at the randomized coordinates the problem must come from this line mouseclick
try to understand it little bit:
[Only registered and activated users can see links. Click Here To Register...]

all functions:
[Only registered and activated users can see links. Click Here To Register...]

btw u should post ur problem in autoit forum not here :p
06/19/2008 18:48 Cyrox49#10
where is the forum autoit?I just changed the color of the mobs. I think there is that it modified
06/19/2008 18:51 Whazzzup#11
Quote:
Originally Posted by Cyrox49 View Post
where is the forum autoit?I just changed the color of the mobs. I think there is that it modified
omg.. u use the program without knowing its site & forum? ._.

anyway here, [Only registered and activated users can see links. Click Here To Register...]

-------------------------------------------------------
Quote:
If $ mob = "7B0000"
(no space after $ dont know why the word gone after i post it here -_-)

that is ur problem, u have to insert new correct value, not 7B0000