Mikeywarren Posted May 26, 2006 Share Posted May 26, 2006 well ive done soem work on a script i have made earlier to make it more functional, im just looking for some input here and if it is set out correctly and will work many thanks expandcollapse popupOpt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait("Monster&Me - MythOfOrient","") If Not WinActive("Monster&Me - MythOfOrient","") Then WinActivate("Monster&Me - MythOfOrient","") WinWaitActive("Monster&Me - MythOfOrient","") HotKeySet( "{Esc}", "exit_now" ) while 1 MouseMove(317,489) MouseDown("left") MouseUp("left") Sleep(7000) MouseMove(318,488) MouseDown("left") MouseUp("left") Sleep(7000) If ( PixelGetColor(380,745) = 335636 ) Or ( PixelGetColor(580,745) = 270356 ) Then heal() EndIf Sleep(500) WEnd Func exit_now() Exit EndFunc Func heal() If ( PixelGetColor(380,745) = 335636 ) Then sleep(4000) send("^i") sleep(4000) MouseMove(,) sleep(4000) MouseDown("left") MouseUp("left") sleep(4000) Send("r") sleep(4000) send("o") sleep(4000) MouseMove(,) sleep(4000) MouseDown("left") MouseUp("left") Endif Or if ( PixelGetColor(580,745) = 270356 ) Then sleep(4000) send("^i") sleep(4000) MouseMove(,) sleep(4000) MouseDown("left") MouseUp("left") sleep(4000) Send("p") sleep(4000) MouseMove(,) sleep(4000) MouseDown("left") MouseUp("left") Endif EndFunc any comments are greatly appreciated Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 26, 2006 Moderators Share Posted May 26, 2006 (edited) I don't see your pixelgetcolor working (look at operators in the help file "==" vs "=") and the "Or" in your function will not work the way you have it. For MouseMove/Down/Up just look at MouseClick()Edit:I didn't notice you were using Decimal with your PixelGetColor() vs Hex. @4got1 - the tidy helped me see it clearer Edited May 26, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
4gotn1 Posted May 26, 2006 Share Posted May 26, 2006 (edited) im not sure if it * works * or not, but i tidied up your code some expandcollapse popupGlobal $GetColor_1, $GetColor_2, $GetColor_3 Opt("WinWaitDelay", 100) Opt("WinTitleMatchMode", 4) Opt("WinDetectHiddenText", 1) Opt("MouseCoordMode", 0) HotKeySet( "{Esc}", "exit_now") WinWait("Monster&Me - MythOfOrient", "") If Not WinActive("Monster&Me - MythOfOrient", "") Then WinWaitActive("Monster&Me - MythOfOrient", "") While 1 $GetColor_1 = PixelGetColor(380, 745) $GetColor_2 = PixelGetColor(580, 745) MouseMove(317, 489) MouseClick("Left") Sleep(7000) MouseMove(318, 488) MouseClick("Left") Sleep(7000) If $GetColor_1 = 335636 Or $GetColor_2 = 270356 Then heal() EndIf Sleep(500) WEnd Func exit_now() Exit EndFunc; => exit_now() Func heal() $GetColor_3 = PixelGetColor(380, 745) If $GetColor_3 = 335636 Then Sleep(4000) Send("^i") Sleep(4000) MouseMove(,) Sleep(4000) MouseClick("Left") Sleep(4000) Send("r") Sleep(4000) Send("o") Sleep(4000) MouseMove(,) Sleep(4000) MouseClick("Left") Elseif (PixelGetColor(580, 745) = 270356) Then Sleep(4000) Send("^i") Sleep(4000) MouseMove(,) Sleep(4000) MouseClick("Left") Sleep(4000) Send("p") Sleep(4000) MouseMove(,) Sleep(4000) MouseClick("Left") EndIf EndFunc; => heal() -edit- i read Smoke N 's post and changed it up again Edited May 26, 2006 by 4gotn1 Link to comment Share on other sites More sharing options...
Mikeywarren Posted May 26, 2006 Author Share Posted May 26, 2006 I don't see your pixelgetcolor working (look at operators in the help file "==" vs "=") and the "Or" in your function will not work the way you have it. For MouseMove/Down/Up just look at MouseClick()ahh thanks, ill start fixing it Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now