AzKay Posted September 3, 2006 Posted September 3, 2006 Okay, This is a script, for a game, where theres a ball, and you click it, and it stays up. The point is, to keep it off the ground as long as possible. Except, the response time is good, But, Just wondering if theres a way to give it a faster response? #Include <Misc.au3> Opt("MouseCoOrdMode", 0) Opt("PixelCoOrdMode", 0) HotKeySet("{F2}", "_Ball") While 1 WEnd Func _Ball() Do $Ball = PixelSearch(7, 200, 448, 353, 0x00CCFF, 25) If Not @Error Then MouseClick("Left", $Ball[0], $Ball[1], 1, 1) EndIf Until _IsPressed("72") EndFunc # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Moderators SmOke_N Posted September 3, 2006 Moderators Posted September 3, 2006 Search a smaller area? 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.
AzKay Posted September 3, 2006 Author Posted September 3, 2006 (edited) Yeah, Ive already reduced it as much as I can, Any other way? Edited September 3, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- #
zcoacoaz Posted September 3, 2006 Posted September 3, 2006 (edited) #Include <Misc.au3> Opt("MouseCoOrdMode", 0) Opt("PixelCoOrdMode", 0) HotKeySet("{F2}", "_Ball") While 1 WEnd Func _Ball1() AdlibEnable ( "_Ball2", 1 ) Do $Ball = PixelSearch(7, 200, 448, 253, 0x00CCFF, 25) If Not @Error Then MouseClick("Left", $Ball[0], $Ball[1], 1, 1) EndIf Until _IsPressed("72") EndFunc Func _Ball2() Do $Ball = PixelSearch(7, 254, 448, 353, 0x00CCFF, 25) If Not @Error Then MouseClick("Left", $Ball[0], $Ball[1], 1, 1) EndIf Until _IsPressed("72") AdlibDisable ( ) EndFunc i don't know how well it works since I don't have the actual game to test it on basically, it just splits the search area in half and does the two halves at the same time Edited September 3, 2006 by Xenogis [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
Moderators SmOke_N Posted September 3, 2006 Moderators Posted September 3, 2006 (edited) You could use a While/WEnd loop instead of Do/Until ... seems to be a tad fasterLocal $iCount1, $iCount2, $iTimer Sleep(500) $iTimer = TimerInit() While TimerDiff($iTimer) / 1000 < 3 $iCount1 += 1 WEnd $iTimer = '' Sleep(500) $iTimer = TimerInit() Do $iCount2 += 1 Until TimerDiff($iTimer) / 1000 > 2 MsgBox(64, 'Info', 'While loop counts = ' & $iCount1 & @CR & _ 'Do loop counts = ' & $iCount2)oÝ÷ Øey«-y²µë-×hzÁÛajÛ^²×hzÉ÷öÙh¢Jâm)䨨º(ÉbàèýIíY¢[yö¬µêÈv÷öÙ'£-j»bhrߺǦÊÇ¥}÷Ý«¢+Ù1½°ÀÌØí¥ ½Õ¹ÐİÀÌØí¥ ½Õ¹ÐȰÀÌØí¥Q¥µÈ°ÀÌØí¥¥Ä°ÀÌØí¥¥È)M±À ÔÀÀ¤(ÀÌØí¥Q¥µÈôQ¥µÉ%¹¥Ð ¤)¼($ÀÌØí¥ ½Õ¹ÐĬôÄ($ÀÌØí¥¥ÄôQ¥µÉ¥ ÀÌØí¥Q¥µÈ¤¼ÄÀÀÀ)U¹Ñ¥°ÀÌØí¥¥ÄÐìôÈ(ÀÌØí¥Q¥µÈôÌäìÌäì)M±À ÔÀÀ¤(ÀÌØí¥Q¥µÈôQ¥µÉ%¹¥Ð ¤)]¡¥±ÀÌØí¥¥È±ÐìôÀÌØí¥¥Ä($ÀÌØí¥ ½Õ¹ÐȬôÄ($ÀÌØí¥¥ÈôQ¥µÉ¥ ÀÌØí¥Q¥µÈ¤¼ÄÀÀÀ)]¹)5Í ½à ØÐ°Ìäí%¹¼Ìäì°Ìäí]¡¥±±½½À½Õ¹ÑÌôÌäìµÀìÀÌØí¥ ½Õ¹ÐȵÀì HµÀì|($Ìäí¼±½½À½Õ¹ÑÌôÌäìµÀìÀÌØí¥ ½Õ¹ÐÄ Edited September 3, 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.
Moderators SmOke_N Posted September 3, 2006 Moderators Posted September 3, 2006 @Xenogis, I think Adlib* actually pauses the rest of the functions to perform it's function... I might be wrong, but that seems to be the case when I use it. So I would think that would actually be slower. 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.
zcoacoaz Posted September 3, 2006 Posted September 3, 2006 Dang, it does pause the script. I thought it didn't.The adlib function should be kept simple as it is executed often and during this time the main script is paused [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
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