Jump to content

Problem with mouseclick


Bacost
 Share

Recommended Posts

if GUICtrlRead($Colo) = "Black" then
    $Choose = 0x444444
    $Cord1 = 1593

EndIf
if GUICtrlRead($Colo) = "Red" then
    $Choose = 0xC9302C
    $Cord1 = 699
EndIf

 While 1
   MouseClick("left",502,488,1,10)
   Send("{CTRLDOWN}")
   Send("a")
   Send("{CTRLUP}")
   Send("{DEL}")
   Sleep(1000)
   Send(GUICtrlRead($Amoun) & ' {ENTER}')
   Sleep(1000)
   MouseClick("left",$Cord1,568,1,10)
   Sleep(60000)
   color()

and it says  Variable used without being declared.:
MouseClick("left",$Cord1,568,1,10)
MouseClick("left",^ ERROR
>Exit code: 1    Time: 12.13

Link to comment
Share on other sites

the whole script is needed.

In your snipet i can't see a Control $Colo nor the region where variables are created. So when GuiCtrlRead($colo) wether 'Black' nor 'Red' the variable $coor1 may be never declared. So back to beginning, read the help =>Language Reference (specialy - Variables).

Edited by AutoBert
Link to comment
Share on other sites

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 266, 139, -1, -1)
GUISetBkColor(0x0066CC)
$Start = GUICtrlCreateButton("Start", 8, 8, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Info = GUICtrlCreateButton("How To?", 8, 56, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Exit = GUICtrlCreateButton("Exit", 8, 104, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Colo = GUICtrlCreateInput("Color", 112, 104, 145, 21)
$Amoun = GUICtrlCreateInput("Amount", 112, 32, 145, 21)
$Amount = GUICtrlCreateLabel("Amount to Bet", 120, 8, 99, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Color = GUICtrlCreateLabel("Black or Red", 120, 80, 105, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $Choose
Global $Cord1


if GUICtrlRead($Colo) = "Black" then
    $Choose = 0x444444
    $Cord1 = 1593

EndIf
if GUICtrlRead($Colo) = "Red" then
    $Choose = 0xC9302C
    $Cord1 = 699
 EndIf





While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Start
            Betting()
         Case $Info


    EndSwitch
 WEnd




HotKeySet("{ESC}","endProg")
Func endProg()
   Exit
   EndFunc

Func Betting()
   While 1
   MouseClick("left",502,488,1,10)
   Send("{CTRLDOWN}")
   Send("a")
   Send("{CTRLUP}")
   Send("{DEL}")
   Sleep(1000)
   Send(GUICtrlRead($Amoun) & ' {ENTER}')
   Sleep(1000)
   MouseClick("left",$Cord1,568,1,10)
   Sleep(60000)
   color()

WEnd
   EndFunc

That is the full code is a work in progress btw

Link to comment
Share on other sites

1 hour ago, Bacost said:
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 266, 139, -1, -1)
GUISetBkColor(0x0066CC)
$Start = GUICtrlCreateButton("Start", 8, 8, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Info = GUICtrlCreateButton("How To?", 8, 56, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Exit = GUICtrlCreateButton("Exit", 8, 104, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Colo = GUICtrlCreateInput("Color", 112, 104, 145, 21)
$Amoun = GUICtrlCreateInput("Amount", 112, 32, 145, 21)
$Amount = GUICtrlCreateLabel("Amount to Bet", 120, 8, 99, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Color = GUICtrlCreateLabel("Black or Red", 120, 80, 105, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $Choose
Global $Cord1


if GUICtrlRead($Colo) = "Black" then
    $Choose = 0x444444
    $Cord1 = 1593

EndIf
if GUICtrlRead($Colo) = "Red" then
    $Choose = 0xC9302C
    $Cord1 = 699
 EndIf





While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Start
            Betting()
         Case $Info


    EndSwitch
 WEnd




HotKeySet("{ESC}","endProg")
Func endProg()
   Exit
   EndFunc

Func Betting()
   While 1
   MouseClick("left",502,488,1,10)
   Send("{CTRLDOWN}")
   Send("a")
   Send("{CTRLUP}")
   Send("{DEL}")
   Sleep(1000)
   Send(GUICtrlRead($Amoun) & ' {ENTER}')
   Sleep(1000)
   MouseClick("left",$Cord1,568,1,10)
   Sleep(60000)
   color()

WEnd
   EndFunc

That is the full code is a work in progress btw

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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