Canasian Posted April 25, 2009 Posted April 25, 2009 I can't get it to click what do i do? I've tried a whole bunch of different ways and no matter what i do i can't get this to click lol expandcollapse popup#include <GuiConstants.au3> Dim $getmess Dim $guic, $guib Dim $shoot = False $guic = GUICreate("Simple Click Bot", 650,400) $guib = GuiCtrlCreateButton("Start Bot",125,335,120,60) $exitb = GuiCtrlCreateButton("Exit",425,335,120,60) $gamebox = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") $creategb = GUICtrlCreateObj($gamebox, 0,0,650,330) Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) WinMove("Simple Click Bot","",0,0) With $gamebox .bgcolor = 0x000000 .Movie = "http://www.flashninjaclan.com/tutorialpages/shootinggame/shootinggame.swf" .Loop = True .wmode = "Opaque" EndWith GUISetState() While 1 $getmess = GUIGetMsg() Select Case ($getmess = $guib) $coordinates = PixelSearch(375,30, 440, 345, 0xFFFF00) MouseClick("left",$coordinates[0],$coordinates[1],1,0) Case ($getmess = $exitb) Or $getmess = -3 ExitLoop Exit EndSelect Wend
Mike23 Posted April 25, 2009 Posted April 25, 2009 (edited) try to declare your $coordinates as an array?? Local $coordinates[2] you can also see what the value is of coordinates maybe he doesn't find the correct values. edit: when i run your source. i get a shooting game and it works for me. Edited April 25, 2009 by Mike23
Canasian Posted April 25, 2009 Author Posted April 25, 2009 (edited) try to declare your $coordinates as an array?? Local $coordinates[2] you can also see what the value is of coordinates maybe he doesn't find the correct values. edit: when i run your source. i get a shooting game and it works for me. shooting game shows up and the GUI works and exit button and X work but.. when you click start bot.. you get: "Error: Subscript used with non-Array variable." I set it as Local or Dim and now i get this error.. how do i declare it as an array? putting [1] after the $coordinates? tried that too.. no workie.. Edited April 25, 2009 by Canasian
Mike23 Posted April 25, 2009 Posted April 25, 2009 (edited) $coordinates = PixelSearch(5,25, 644, 345, 0xFFFF00) change coords to the whole field like this. error is gone then. you got error because it detected the smilies out site de detection field. i got it like this now and its working for 1 min straight so:) Case ($getmess = $guib) while 1 $coordinates = PixelSearch(5,25, 644, 345, 0xFFFF00) MouseClick("left",$coordinates[0],$coordinates[1],1,0) wend Edited April 25, 2009 by Mike23
Canasian Posted April 25, 2009 Author Posted April 25, 2009 $coordinates = PixelSearch(5,25, 644, 345, 0xFFFF00) change coords to the whole field like this. error is gone then. you got error because it detected the smilies out site de detection field. i got it like this now and its working for 1 min straight so:) Case ($getmess = $guib) while 1 $coordinates = PixelSearch(5,25, 644, 345, 0xFFFF00) MouseClick("left",$coordinates[0],$coordinates[1],1,0) wend I still got this "Error: Subscript used with non-Array variable." when i click start bot.
Mike23 Posted April 25, 2009 Posted April 25, 2009 (edited) expandcollapse popup#include <GuiConstants.au3> Local $coordinates[2] <------------ Dim $getmess Dim $guic, $guib Dim $shoot = False $guic = GUICreate("Simple Click Bot", 650,400) $guib = GuiCtrlCreateButton("Start Bot",125,335,120,60) $exitb = GuiCtrlCreateButton("Exit",425,335,120,60) $gamebox = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") $creategb = GUICtrlCreateObj($gamebox, 0,0,650,330) Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) WinMove("Simple Click Bot","",0,0) With $gamebox .bgcolor = 0x000000 .Movie = "http://www.flashninjaclan.com/tutorialpages/shootinggame/shootinggame.swf" .Loop = True .wmode = "Opaque" EndWith GUISetState() While 1 $getmess = GUIGetMsg() Select Case ($getmess = $guib) while 1 $coordinates = PixelSearch(5,25, 644, 345, 0xFFFF00) MouseClick("left",$coordinates[0],$coordinates[1],1,0) wend Case ($getmess = $exitb) Or $getmess = -3 ExitLoop Exit EndSelect Wend see arrow Edited April 25, 2009 by Mike23
implite Posted April 25, 2009 Posted April 25, 2009 Very nice mike, looks like it clicks on one of them every time you hit the start bot button, now. Canasain do mind if I play with this code to help me learn pixelsearch? Im kinda noobish...
Mike23 Posted April 25, 2009 Posted April 25, 2009 Very nice mike, looks like it clicks on one of them every time you hit the start bot button, now.Canasain do mind if I play with this code to help me learn pixelsearch? Im kinda noobish...add pixelsearch in help it wil explain the whole function thats how i found the bug
implite Posted April 25, 2009 Posted April 25, 2009 (edited) lol I think adding in a hoykey for exit at this point would be good because I almost had to hard reset my computer to get out of this script... lol, I couldn't click the exit key cause the bot was going Edited April 25, 2009 by implite
Canasian Posted April 26, 2009 Author Posted April 26, 2009 (edited) I think i know the problem now.. Pixel search is searching whole resolution of the screen isn't it.. including my desktop? how do i get it to search only in the GUI? Ok i searched and i can do that with a handle.. so this is what i've got now.. is this set wrong? $wgh = WinGetHandle("Simple Click Bot") $coordinates = PixelSearch(320, 30, 420, 350, 0xFFFF00,"","",$wgh) Edited April 26, 2009 by Canasian
Valuater Posted April 26, 2009 Posted April 26, 2009 expandcollapse popup#include <GuiConstants.au3> Local $coordinates[2] Dim $getmess, $Runner Dim $guic, $guib Dim $shoot = False Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) HotKeySet("{ESC}", "Terminate") $guic = GUICreate("Simple Click Bot", 650, 400) $guib = GUICtrlCreateButton("Start Bot", 125, 335, 120, 60) $exitb = GUICtrlCreateButton("Exit", 425, 335, 120, 60) $gamebox = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") $creategb = GUICtrlCreateObj($gamebox, 0, 0, 650, 330) $wgh = WinGetHandle("Simple Click Bot") ;WinMove("Simple Click Bot", "", 0, 0) With $gamebox .bgcolor = 0x000000 .Movie = "http://www.flashninjaclan.com/tutorialpages/shootinggame/shootinggame.swf" .Loop = True .wmode = "Opaque" EndWith GUISetState() While 1 $getmess = GUIGetMsg() Select Case ($getmess = $guib) If $Runner Then $Runner = False GUICtrlSetData($guib, "Start Bot") ToolTip("") Else $Runner = True GUICtrlSetData($guib, "Stop Bot") ToolTip("Press (ESC) to Stop Bot", 20, 20, "Thanks Valuater... 8)", 1) EndIf Case ($getmess = $exitb) Or $getmess = -3 ExitLoop Exit EndSelect If $Runner Then $coordinates = PixelSearch(320, 30, 420, 350, 0xFFFF00, "", "", $wgh) If IsArray($coordinates) Then MouseClick("left", $coordinates[0], $coordinates[1], 1, 0) EndIf WEnd Func Terminate() $Runner = False GUICtrlSetData($guib, "Start Bot") ToolTip("") EndFunc 8)
Canasian Posted April 26, 2009 Author Posted April 26, 2009 (edited) lol Valuater how'd you get so pro? How long have you been doing this? you did it so easily haha The script works 110% perfect now. Edited April 26, 2009 by Canasian
Valuater Posted April 26, 2009 Posted April 26, 2009 lol Valuater how'd you get so pro? How long have you been doing this? you did it so easily haha The script works 110% perfect now.I had some great people help me when I came here, Gary Frost, Ron, Jos, mHz and many more.... But it's the Love of Autoit kept me going!!Enjoy!!8)
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