Jump to content
Sign in to follow this  
Canasian

Having hard time again.

Recommended Posts

Canasian

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

#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

Share this post


Link to post
Share on other sites
Mike23

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 by Mike23

Share this post


Link to post
Share on other sites
Canasian

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..

Posted Image

Edited by Canasian

Share this post


Link to post
Share on other sites
Mike23

$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 by Mike23

Share this post


Link to post
Share on other sites
Canasian

$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.

Share this post


Link to post
Share on other sites
Mike23

#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 by Mike23

Share this post


Link to post
Share on other sites
implite

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...

Share this post


Link to post
Share on other sites
Mike23

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 ;)

Share this post


Link to post
Share on other sites
implite

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 by implite

Share this post


Link to post
Share on other sites
Canasian

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 by Canasian

Share this post


Link to post
Share on other sites
Valuater

#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)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Canasian

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 by Canasian

Share this post


Link to post
Share on other sites
Valuater

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.