Sign in to follow this  
Followers 0
Letis

My Clicker - Problem

4 posts in this topic

Hello i did program which click right or left button on mouse - x-times - you write number of clicks into a white space..

i dont know why it has got problem with ->

If $nMsg = $right2 Then

If ^ ERROR

there is the code..

#include <GUIConstants.au3>
HotKeySet("{F11}", "exit2")
GUICreate("Clicker", 210, 80)
GUISetBkColor(0xF52412)
$Label = GUICtrlCreateLabel("Write a number of clicks->click on a button", 5, 10)
$left2  = GUICtrlCreateButton("Left", 10, 50, 50, 20)
$right2   = GUICtrlCreateButton("Right", 80, 50, 50, 20)
$space2  = GUICtrlCreateInput("", 82, 25, 45, 21)
$exit = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
GUISetState() ; display the GUI

$inp = 50
While 1 
If $nMsg = $right2 Then
        $i = 0
        $inp = GUICtrlRead($space2)
        If $inp >= 1 Then
            Do
                Sleep(300)
                MouseClick("right")
                $i = $i + 1
            Until $i = $inp
            MsgBox(0, "Clicker", " Complete")
        EndIf
    EndIf   
If $nMsg = $left2 Then
        $i = 0
        $inp = GUICtrlRead($space2)
        If $inp >= 1 Then
            Do
                Sleep(300)
                MouseClick("left")
                $i = $i + 1
            Until $i = $inp
            MsgBox(0, "Clicker", "Complete")
        EndIf
    EndIf   
    WEnd

Func exit2 ()
    Exit
EndFunc

Can you help me?

Share this post


Link to post
Share on other sites



Hello i did program which click right or left button on mouse - x-times - you write number of clicks into a white space..

i dont know why it has got problem with ->

If $nMsg = $right2 Then

If ^ ERROR

there is the code..

#include <GUIConstants.au3>
HotKeySet("{F11}", "exit2")
GUICreate("Clicker", 210, 80)
GUISetBkColor(0xF52412)
$Label = GUICtrlCreateLabel("Write a number of clicks->click on a button", 5, 10)
$left2  = GUICtrlCreateButton("Left", 10, 50, 50, 20)
$right2   = GUICtrlCreateButton("Right", 80, 50, 50, 20)
$space2  = GUICtrlCreateInput("", 82, 25, 45, 21)
$exit = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
GUISetState(); display the GUI

$inp = 50
While 1 
If $nMsg = $right2 Then
        $i = 0
        $inp = GUICtrlRead($space2)
        If $inp >= 1 Then
            Do
                Sleep(300)
                MouseClick("right")
                $i = $i + 1
            Until $i = $inp
            MsgBox(0, "Clicker", " Complete")
        EndIf
    EndIf   
If $nMsg = $left2 Then
        $i = 0
        $inp = GUICtrlRead($space2)
        If $inp >= 1 Then
            Do
                Sleep(300)
                MouseClick("left")
                $i = $i + 1
            Until $i = $inp
            MsgBox(0, "Clicker", "Complete")
        EndIf
    EndIf   
    WEnd

Func exit2 ()
    Exit
EndFunc

Can you help me?

You haven't set $nMsg to anything so it won't work. Add

$nMsg = GuiGetMsg()

after the while 1line and before If $nMsg = $right2 Then


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

You forgot to define what $nMsg is in your loop. Add $nMsg = GUIGetMsg() right below your While 1 line.


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

thx men:) i am noob in auto it:D i am learning it now... :)

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  
Followers 0