Jump to content

combo and check box and Error...


 Share

Recommended Posts

Hello i have this code bat why give automatically exit and does not begin to run ?

$Mm1 = IniRead("Config.ini", "mm1", "1", "") ;load INI
If $Mm1 = 1 Then GUICtrlSetState($mm1, $GUI_CHECKED)
$RIGHT = IniRead("Config.ini", "Position", "Right", "")
If $RIGHT = 1 Then GUICtrlSetState($RIGHT, $GUI_CHECKED)

Global $Paused
HotKeySet("{f2}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{f1}", " start")


While 1
sleep(100)
WEnd


Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc

Func Terminate()
Exit 0
EndFunc
 
Func start() ;

Sleep(Random(1000, 1500))

  If GUICtrlRead($mm1) = $GUI_CHECKED Then

  Mm1()





EndIf


EndFunc

Func Mm1()
While 1


$Coord = PixelSearch (461, 36, 800, 600, 0x75C0E2, 0, 4)
Sleep(Random(1000, 1500))
If Not @error Then
MouseClick ( "Left" , $Coord[0] + Random(1, 5), $Coord[1] - Random(1, 5), 1 , random(3, 7))
Sleep(Random(1000, 1500))




if GUICtrlRead($Mm1) = $GUI_CHECKED Then


If GUICtrlRead($Right) = $GUI_CHECKED Then
MouseMove(165 + Random(1,3),271 + Random(1,3), random(5, 9))
Sleep(Random(500, 1000))
MouseClick ( "Left" , $Coord[0] + Random(1, 5), $Coord[1] - Random(1, 5), 1 , random(3, 7))
Sleep(Random(500, 1000))
MouseMove(713 + Random(1,3),246 + Random(1,3), random(5, 9))
MouseClick ( "Right" , $Coord[0] + Random(1, 5), $Coord[1] - Random(1, 5), 1 , random(3, 7))
EndIf
EndIf
EndIf


WEnd

EndFunc
Link to comment
Share on other sites

  • Moderators

Look at your hotkeyset statement, for one thing. You have a space between " and the name of the function.

HotKeySet("{f1}", " start")

should be :

HotKeySet("{f1}", "start")

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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