Search the Community
Showing results for tags 'securitycode'.
-
Hi. I've been developing a Security Camera Toolkit I want it to play a sound when movement is detected, and when NoCameraMovement function is called, save mouse position, and move the mouse constantly back to his main position so camera doesnt move ("Because it constantly moves left/right to check the area, but the only way to stop the movement is moving your mouse constantly to the center") and both of the functions are not working What's wrong with my script? #include <GUIConstantsEx.au3> HotKeySet("{f1}", "_Check_For_Movement") HotKeySet("{v}", "NoCameraMovement") HotKeySet("{f2}", "_sleep") Opt('MustDeclareVars', 1) Local $_MS_POS = 0 MainGUI() Func MainGUI() Local $Button1, $Button2, $msg GUICreate("Sec_Camera_Tool") Opt("GUICoordMode", 2) $Button1 = GUICtrlCreateButton("MS_Check", 10, 30, 100) $Button2 = GUICtrlCreateButton("RC_Tool", 0, -1) GUISetState() ; Run the GUI until the window is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 call ("_Check_For_Movement") Case $msg = $Button2 call ("NoCameraMovement") EndSelect WEnd EndFunc Func _Check_For_Movement() While 1 Local $MovementCheck = PixelChecksum ( 0, 0, 1279, 1023, 1) $MovementCheck = PixelChecksum ( 0, 0, 1279, 1023, 1) If IsArray($MovementCheck) = True Then SoundPlay("beep.mp3") EndIf WEnd EndFunc Func NoCameraMovement() while 1 $_MS_POS = MouseGetPos() MouseMove($_MS_POS[0], $_MS_POS[1], 5) WEnd EndFunc func _sleep() while 1 sleep(1000) WEnd EndFunc Any help is appreciated