Since i got some PM's asking how i set up everything to get it working, i will just write down here so i dont have to answer everyone..
I am using the Autoit Script posted by afghanjohnny, only adjusted it to my needs to get it working.
This is my adjusted code (1680x1050 Fullscreen Windowed)
Code:
;;Version 1.1.1
HotKeySet("{F7}", "getpos")
HotKeySet("{F9}", "ExitProg")
HotKeySet("{F8}", "StartStop")
#Find button X, Y, Color
$FB_X=676
$FB_Y=708
$FB_C=6883079
#Accept button X, Y, Color
$AB_X=802
$AB_Y=307
$AB_C=13571595
#First Pet X, Y, Color
$FP_X=621
$FP_Y=912
$FP_C=46080
#Forfeit flag X, Y, Color
$FF_X=902
$FF_Y=996
$FF_C=14080202
Func getpos()
Local $pos = MouseGetPos()
MsgBox(0, "Setup", "x is: " & $pos[0] & ", y is: " & $pos[1])
Local $col = PixelGetColor($pos[0], $pos[1])
MsgBox(0, "Setup", "color is: " & $col)
EndFunc
Func ExitProg()
Exit 0;;Exits the program
EndFunc
$On = False
While 1
While $On = True
$var = 1
sleep(2000)
While $var <> $FB_C
sleep(500)
$var = PixelGetColor($FB_X, $FB_Y)
WEnd
MouseClick("left",$FB_X, $FB_Y,1)
sleep(500)
Send("{ALTDOWN}{ESC}{ALTUP}")
sleep(2000)
MouseClick("left",$FB_X, $FB_Y,1)
sleep(500)
MouseMove($AB_X, $AB_Y, 10)
While $var <> $AB_C
sleep(1000)
$var = PixelGetColor($AB_X, $AB_Y)
WEnd
MouseClick("left",$AB_X, $AB_Y,1)
sleep(500)
Send("{ALTDOWN}{SHIFTDOWN}{ESC}{SHIFTUP}{ALTUP}")
sleep(1000)
MouseClick("left",$AB_X, $AB_Y,1)
sleep(500)
Send("{ALTDOWN}{ESC}{ALTUP}")
sleep(2000)
While $var <> $FP_C
sleep(1000)
$var = PixelGetColor($FP_X, $FP_Y)
WEnd
MouseClick("left",$FP_X, $FP_Y,1)
sleep(300)
Send("{ALTDOWN}{SHIFTDOWN}{ESC}{SHIFTUP}{ALTUP}")
sleep(500)
While $var <> $FF_C
sleep(500)
$var = PixelGetColor($FF_X,$FF_Y)
WEnd
MouseClick("left",$FF_X,$FF_Y,1)
sleep(4500)
WEnd
Sleep(100)
WEnd
Func StartStop()
If $On = False Then
MsgBox(0, "Start", "Welcome, if nothing happens, run setup by pressing F7 and change the values in the script.")
MsgBox(0, "Start", "First Im going to run a little script in your window.")
Sleep(1000)
send ("{Enter}")
send("/run PetBattleFrame.BottomFrame.ForfeitButton:SetScript(""OnClick"", function() C_PetBattles.ForfeitGame() end)")
send ("{Enter}")
$On = True
Else
$On = False
EndIf
EndFunc
What did i change?
Not much.. I am using Windows 8, so Alt+Tab didnt work for me. If my adjusted script doesnt change windows for you and you are not using windows 8, change all these lines
Code:
Send("{ALTDOWN}{SHIFTDOWN}{ESC}{SHIFTUP}{ALTUP}")
and
Send("{ALTDOWN}{ESC}{ALTUP}")
to
Code:
Send("{ALTDOWN}{TAB}{ALTUP}")
coordinates and colors of course, and i added one line
Code:
MouseMove($AB_X, $AB_Y, 10)
This makes to cursor move to the position of your accept button before it pops up and then scans for the "active" accept button color. Didn't get it working the other way, so this was my solution for finding the accept button.
I didnt use his built in script to get colors and coordinates, I used this one (its also originally from afghanjohnny, just added to show me coordinates and color at once cause i got confused from the output of his built in "getpos" script
) :
Code:
HotKeySet("{F9}", "ExitProg")
Func ExitProg()
Local $pos = MouseGetPos()
Local $var = PixelGetColor($pos[0], $pos[1])
MsgBox(0, "x, y & is", $pos[0] & "," & $pos[1] & "," & $var)
Exit 0;;Exits the program
EndFunc
while 1
sleep(500)
WEnd
Look at this picture to see where I got the colors and coordinates from Image - TinyPic - Free Image Hosting, Photo Sharing & Video Hosting
Just start the second script, move your mouse to the postition you want to get coords / colors for and press F9
Dont look at pet levels, just queued up to make the screenshots. I usually use 25 - 11 - 4.
Again, all credits for the scripts go to afghanjohnny, I just want to share my way of getting it to work. Using this methods, I adjusted it for 3 of my guildmates and its working without any problems. Leveled 1 character so far in about 1 day to 90 and just finished my bonus rolls for the next 30 weeks