Jump to content

GUI help + error


Recommended Posts

Okay well I have been working on a small project lately. It's going to be quick, I am still learning AutoIt, I am trying to make it a goal to learn at least 2 new statements every day. So if anyone could be so kind to tell me why this Auto Clicker I am making is not working, I have gotten it to work a couple of times but when the GUI opens up, the buttons are not working.. When I press them nothing happends.. So if someone could give me a hand with this I would be so grateful.

GUICreate( "Clicker 1.0" , 500 , 500 )

GuiSetState()

$Sen = 0

While $Sen <=10

$Button1= GUICtrlCreateButton("Start Right Clicking", 5, 5, 120, 30)

$Button2= GUICtrlCreateButton("Start Left Clicking", 130, 40, 120, 30)

$Button3= GUICtrlCreateButton("Start Left Then Right Clicking", 50, 75, 150, 30)

$Button4= GUICtrlCreateButton("Start Right Then Left Clicking", 50, 110, 150, 30)

$Button5 = GUICtrlCreateButton("Coordinate Find", 130, 5, 120, 30)

$Button6 = GUICtrlCreateButton("About Clicker", 5, 40, 120, 30)

WEnd

$ontop= GUICtrlCreateCheckbox ("On Top", 5, 220, 120, 18)

If GUICtrlRead($ontop) = 1 Then WinSetOnTop($appname, "", 1)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Button1

$Input1 = InputBox( "Y Coordinate" , "Please enter the correct Y coordinate to figure out the correct Y coordinate please use the "Coordinate Find" tool on the GUI menu.")

$Input2 = InputBox( "X Coordinate" , "Please enter the correct X coordinate to figure out the correct X coordinate please use the "Coordinate Find" tool on the GUI menu.")

$Input3 = InputBox( "Number of Clicks" , "Please enter the amount of times you would like it to click" )

$Speed = InputBox ( "Speed Of the Clicks" , "Please enter the speed of the clicks, this ranges between 1 and 100, 1 being the fastest and 100 being the slowest")

Global $Zero = 0

While $Zero <=10

MouseClick( "right" , $Input2 , $Input1 , $Input3 , $Speed)

WEnd

Case $msg = $Button2

$Input11 = InputBox( "Y Coordinate" , "Please enter the correct Y coordinate to figure out the correct Y coordinate please use the "Coordinate Find" tool on the GUI menu.")

$Input22 = InputBox( "X Coordinate" , "Please enter the correct X coordinate to figure out the correct X coordinate please use the "Coordinate Find" tool on the GUI menu.")

$Input33 = InputBox( "Number of Clicks" , "Please enter the amount of times you would like it to click" )

$Speed1 = InputBox ( "Speed Of the Clicks" , "Please enter the speed of the clicks, this ranges between 1 and 100, 1 being the fastest and 100 being the slowest")

While $Zero <=10

MouseClick( "right" , $Input22 , $Input11 , $Input33 , $Speed1)

WEnd

Case $msg = $Button3

$InputA = InputBox( "Y Coordinate" , "Please enter the Y coordinate for the left mouse click, if you do not know this then please use the "Coordinate Find" tool on the GUI menu")

$InputB = InputBox( "X Coordinate" , "Please enter the X coordinate for the left mouse click, if you do not know this then please use the "Coordinate Find" tool on the GUI menu")

$InputC = InputBox( "Number of Clicks" , "Please enter the amount of times you would like it to click" )

$SpeedCC = InputBox ( "Speed Of the Clicks" , "Please enter the speed of the clicks, this ranges between 1 and 100, 1 being the fastest and 100 being the slowest")

$InputAA = InputBox( "Y Coordinate" , "Please enter the Y coordinate for the right mouse click, if you do not know this then please use the "Coordinate Find" tool on the GUI menu")

$InputBB = InputBox( "X Coordinate" , "Please enter the X coordinate for the right mouse click, if you do not know this then please use the "Coordinate Find" tool on the GUI menu")

While $Zero <=10

MouseClick( "left" , $InputB , $InputA , $InputC , $SpeedCC)

MouseClick( "right" , $InputBB , $InputAA , $InputC , $SpeedCC)

WEnd

Case $msg = $Button4

$InputJJ = InputBox( "Y Coordinate" , "Please enter the Y coordinate for the right mouse click, if you do not know this then please use the "Coordinate Find" tool on the GUI menu")

$InputKK = InputBox( "X Coordinate" , "Please enter the X coordinate for the right mouse click, if you do not know this then please use the "Coordinate Find" tool on the GUI menu")

$InputCD = InputBox( "Number of Clicks" , "Please enter the amount of times you would like it to click" )

$SpeedCD = InputBox ( "Speed Of the Clicks" , "Please enter the speed of the clicks, this ranges between 1 and 100, 1 being the fastest and 100 being the slowest")

$InputJ = InputBox( "Y Coordinate" , "Please enter the Y coordinate for the right mouse click, if you do not know this then please use the "Coordinate Find" tool on the GUI menu")

$InputK = InputBox( "X Coordinate" , "Please enter the X coordinate for the right mouse click, if you do not know this then please use the "Coordinate Find" tool on the GUI menu")

While $Zero <=10

MouseClick( "right" , $InputKK , $InputJJ , $InputCD , $SpeedCD)

MouseClick( "left" , $InputK , $InputJ , $InputCD , $SpeedCC)

Case $msg = $Button5

$position = MouseGetPos()

MsgBox(0, "Mouse X:", $position[0] & "and Y:" & $position[1])

Case $msg = $Button6

MsgBox(0, "Blank for now..")

EndSelect

WEnd

Link to comment
Share on other sites

First thing:

$Sen = 0
While $Sen <=10oÝ÷ ØjëÓ~z

this will generate infinite loops while nothing modifies $Zero (it is set to be =0) and it is not changed.

So - think what you need to do and modify the script accordingly - look what these values should do and set them.

My guess it is that they are counters and it will allow that part to be executed 10 times ... if this is the case - add an increment statement inside the loops ($Zero = $Zero +1 or $Zero+=1 )

... this is it so far ...

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...