Sign in to follow this  
Followers 0
Bacost

Problem with mouseclick

9 posts in this topic

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

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

MouseClick("left",$Cord1,568,1,10)

Here is the code, the thing is that if you choose red the $Cord1 should change to 1593, but it is giving me an error, IDK why.

Thanks for reading.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0