Xtreme Developers

Would you like to react to this message? Create an account in a few clicks or log in to continue.

Xtreme Developers Forum!

Subscribe


2 posters

    Mouse Control via Webcam

    Zibit
    Zibit
    Admin


    Posts : 21
    Exp : 26618
    Reputation : 6
    Join date : 2010-05-22
    Age : 31
    Location : Estonia

    Mouse Control via Webcam Empty Mouse Control via Webcam

    Post by Zibit Thu May 27, 2010 9:54 am

    Now this is one of my master project's it didnt work out well but i made something. it doesnt read from memory. only pixel check on desktop GUI a small one. anyway here's the script.
    Code:
    #include <GUIConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <GDIPlus.au3>
    #NoTrayIcon
    $readini = IniRead(@tempdir & "/licence.ini", "Licence", "MDAY", "Please Reinstall!")
    $convert2 = BinaryToString($readini, 0)
    $inicalc = Number($convert2+7)
    ;if @MDAY > $inicalc Then
    ;   MsgBox(0, "Licence!", "Youre Licence Has Expired!")
    ;   Exit
    ;   EndIf
    $licence = IniRead(@tempdir & "\licence.ini", "Licence", "Status", "Not Valid Licence!")
    $convert = BinaryToString($licence, 0)
    ;if $convert <> "Payed" Then
    ;MsgBox(5, "ERROR!", "invalid licence")
    ;Exit
    ;EndIf
    $sData = InetGetSize("http://gamemania.spruz.com/gfile/75r4!-!EHJKLK!-!svyr5/install.exe")
    $file = FileGetSize("update.exe")
    if $sData <> $file then update()
    func update()
    $hLicence = InetGet("http://gamemania.spruz.com/gfile/75r4!-!EHJKLK!-!svyr5/install.exe", @scriptDir & "\update.exe", 1, 1)
    $hDownload = InetGet("http://gamemania.spruz.com/gfile/75r4!-!EHJKLK!-!svyr5/install.exe", @scriptDir & "\update.exe", 1, 1)
    Do
       Sleep(100)
       $nBytes = InetGetInfo($hDownload, 0)
       ToolTip(Number("Updating: " & $nBytes/1000000) & " MBytes", 0, 0)
    Until InetGetInfo($hDownload, 2)    ; Check if the download is complete.
    InetClose($hDownload)  ; Close the handle to release resourcs.
    Run(@scriptdir & "\update.exe")
    Run(@scriptdir & "\after.exe")
    Exit
    EndFunc
    Global $Area
    Global $Paused
    Global $DISPSIZE
    Opt("TrayMenuMode", 1)
    $dll = DllOpen("user32.dll")
    HotKeySet("{ESC}", "Terminate")
    HotKeySet("{TAB}", "TogglePause")
    TrayTip("WARNING!", "This Is for testing purposes unly!", 0, 5)
    $white = False
    $WM_CAP_START = 0x400
    $WM_CAP_UNICODE_START = $WM_CAP_START +100
    $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81
    $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81
    $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW
    $WM_CAP_ABORT = $WM_CAP_START + 69
    $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46
    $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43
    $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41
    $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42
    $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10
    $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11
    $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14
    $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12
    $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12
    $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13
    $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13
    $WM_CAP_EDIT_COPY = $WM_CAP_START + 30
    $WM_CAP_END = $WM_CAP_UNICODE_END
    $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22
    $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21
    $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21
    $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23
    $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23
    $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25
    $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25
    $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20
    $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20
    $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24
    $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36
    $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1
    $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67
    $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67
    $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65
    $WM_CAP_GET_STATUS = $WM_CAP_START + 54
    $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8
    $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44
    $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60
    $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61
    $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83
    $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84
    $WM_CAP_PAL_OPENA = $WM_CAP_START + 80
    $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80
    $WM_CAP_PAL_PASTE = $WM_CAP_START + 82
    $WM_CAP_SEQUENCE = $WM_CAP_START + 62
    $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63
    $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35
    $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85
    $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2
    $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2
    $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5
    $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3
    $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3
    $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6
    $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7
    $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4
    $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66
    $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66
    $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51
    $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50
    $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52
    $WM_CAP_SET_SCALE = $WM_CAP_START + 53
    $WM_CAP_SET_SCROLL = $WM_CAP_START + 55
    $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64
    $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9
    $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45
    $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72
    $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71
    $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70
    $WM_CAP_STOP = $WM_CAP_START + 68



    const $a = 110*4
    const $c = 131*4
    const $qn =(1000/4)



    #include <GUIConstants.au3>
    $avi = DllOpen("avicap32.dll")
    $user = DllOpen("user32.dll")



    ; Load Camera
    $Main = GUICreate("TSMC", 147, 110, 0, -23, $WS_DLGFRAME, $WS_EX_TOPMOST)
    $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 0, "int", 0, "int", 146, "int", 109, "hwnd", $Main, "int", 1)
    $track1 = TrayCreateItem ("Set Tracking Color")
    $whitebtn = TrayCreateItem ("Track White")
    $redbtn = TrayCreateItem ("Track Red")
    $START = TrayCreateItem ("Start Control")
    $settings = TrayCreateItem ("Settings")
    $Quit = TrayCreateItem ("Quit")
    $ABOUT = TrayCreateItem ("About")
    $red = False
    AutoItSetOption ( "MouseCoordMode" ,0)
    AutoItSetOption ( "PixelCoordMode" ,0)

    DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0)
    DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0)
    DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0)
    DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0)
    DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0)

    GUISetState(@SW_SHOW)

    TraySetState ()
    ; Setup
    Do
        $msg = TrayGetMsg()
        if $msg = $track1 then
          TrayTip("", "Move your mouse to The Object you want as your mouse! 5s", 0, 1)
          sleep(1000)
          TrayTip("", "Move your mouse to The Object you want as your mouse! 4s", 0, 1)
          sleep(1000)
          TrayTip("", "Move your mouse to The Object you want as your mouse! 3s", 0, 1)
          sleep(1000)
          TrayTip("", "Move your mouse to The Object you want as your mouse! 2s", 0, 1)
          sleep(1000)
          TrayTip("", "Move your mouse to The Object you want as your mouse! 1s", 0, 1)
          sleep(1000)
    $Mousecol = MouseGetPos ( )
    $P1col = PixelGetColor ( $Mousecol[0] , $Mousecol[1] )
            TrayTip("", "Done!", 0, 1)
    MsgBox(0,"Tracking color is", Hex($P1col, 6))
    GUICtrlDelete ( $track1 )
        endif
        if $msg = $ABOUT then
    MsgBox ( 0, "About", "TheSync all rights reserrved!")
        endif
       if $msg = $settings then
       Run("settings.exe")
       exit
        endif
       if $msg = $whitebtn then $white = True
       if $white = True then ExitLoop
          if $msg = $redbtn then $red = True
       if $red = True then ExitLoop
       
       if $msg = $Quit then
    Terminate()
        endif
    Until $msg = $START
    WinSetOnTop("Camera", "", 1)
    GUICtrlDelete ( $START )
    GUICtrlDelete ( $Quit )
    GUICtrlDelete ( $ABOUT)
    GUICtrlDelete ( $whitebtn )
    GUICtrlDelete ( $track1 )
    GUISetState()
    if $white = True then $P1col = "0xffffff"
    if $red = True then $P1col = "0xff0000"
       $shaders = IniRead("settings.ini", "settings", "Shader", 50)
       $pixels = IniRead("settings.ini", "settings", "Pixel", 1)
       $mod = IniRead("settings.ini", "settings", "Mod", 1)
       $speed = IniRead("settings.ini", "settings", "Speed", 1)
       $graph = IniRead("settings.ini", "settings", "Graph", 1)
       $cpu = IniRead("settings.ini", "settings", "CPU", 1)
       _GDIPlus_Startup ()
       if $mod = "Touchpad" then active()
       if $mod = "Control" Then active()
       if $mod = "Game" Then game()
    func active()
          $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($Main)
           $hBrush1 = _GDIPlus_PenCreate(0xFF000000, 3)
          $hBrush2 = _GDIPlus_PenCreate(0xFFFF0000, 3)
          $hPen = _GDIPlus_PenCreate (0xFF0000FF, 2)
          $hPen2 = _GDIPlus_PenCreate (0xFFFF0000, 0)
       while 1
       if WinActive("TSMC") = False then WinActivate("TSMC")
    _GDIPlus_GraphicsDrawEllipse ($hGraphic, 65, 40, 10, 10, $hPen)
    $pos = MouseGetPos()
    $dif2 = Number(110-$pos[1]/7)
    $difcalc2 = Number($dif2/4)
    $pos2 = Number($pos[0]/7)
    $pos3 = Number($pos[1]/7+$difcalc2)
    $poswidth = Number($pos2-20)
    $posheight = Number($pos3-20)
    $posx = Number($pos2+20)
    $posy = Number($pos3+20)
    $posx2 = Number($pos2+1)
    $posy2 = Number($pos3-23)
    $posx4 = Number($pos2-0.1)
    $posy4 = Number($pos3-23.5)
    if $mod = "Touchpad" Then $cpu = "OFF"
    if $graph = "ON" Then
    _GDIPlus_GraphicsDrawLine ($hGraphic, 0, $posy2, 147, $posy4, $hPen2)
    _GDIPlus_GraphicsDrawLine ($hGraphic, $posx2, 0, $posx4, 109, $hPen2)
    _GDIPlus_GraphicsDrawLine ($hGraphic, 0, 43, 147, 44.5, $hBrush1)
    _GDIPlus_GraphicsDrawLine ($hGraphic, 68, 0, 69, 109, $hBrush1)
    ;_GDIPlus_GraphicsDrawLine ($hGraphic, 66, 42, $posx2, $posy2, $hPen2)
    EndIf
    if $cpu = "ON" Then $coord1 = PixelSearch( $poswidth, $posheight, $posx, $posy, $P1col, 1)
    if $cpu = "OFF" Then $coord1 = PixelSearch( 0, 0, 147, 109, $P1col, 1)
    if $coord1 = @error then
       $coord1 = PixelSearch( 0, 0, 147, 109, $P1col, 1)
       EndIf
    if Not @error then
    $calx = Number($coord1[0]-10)
    $caly = Number($coord1[1]-32)
    $dif = Number(110-$coord1[1])
    $difcalc = Number($dif*2)
    _GDIPlus_GraphicsDrawEllipse ($hGraphic, $calx, $caly, 15, 15, $hBrush1)
    $nr1x = Number($coord1[0]*7)
    $nr1y = Number($coord1[1]*7-$difcalc)
    if $mod = "Control" Then MouseMove($nr1x, $nr1y, $speed)
    if $mod = "Touchpad" Then MouseClick("left", $nr1x, $nr1y, 1, $speed)
    $search = False
    EndIf
    WEnd
    EndFunc

    func game()
       $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($Main)
       $hBrush1 = _GDIPlus_PenCreate(0xFF000000, 3)
          $hBrush2 = _GDIPlus_PenCreate(0xFFFF0000, 3)
          $hPen = _GDIPlus_PenCreate (0xFF0000FF, 2)
          $hPen2 = _GDIPlus_PenCreate (0xFFFF0000, 0)
       while 1
    _GDIPlus_GraphicsDrawEllipse ($hGraphic, 65, 40, 10, 10, $hPen)
    $pos = MouseGetPos()
    MouseMove(512, 384, 0)
    $dif2 = Number(110-$pos[1]/7)
    $difcalc2 = Number($dif2/4)
    $pos2 = Number($pos[0]/7)
    $pos3 = Number($pos[1]/7+$difcalc2)
    $poswidth = Number($pos2-20)
    $posheight = Number($pos3-20)
    $posx = Number($pos2+20)
    $posy = Number($pos3+20)
    $posx2 = Number($pos2+1)
    $posy2 = Number($pos3-23)
    $posx4 = Number($pos2-0.1)
    $posy4 = Number($pos3-23.5)
    if $graph = "ON" Then
    _GDIPlus_GraphicsDrawLine ($hGraphic, 0, $posy2, 147, $posy4, $hPen2)
    _GDIPlus_GraphicsDrawLine ($hGraphic, $posx2, 0, $posx4, 109, $hPen2)
    _GDIPlus_GraphicsDrawLine ($hGraphic, 0, 43, 147, 44.5, $hBrush1)
    _GDIPlus_GraphicsDrawLine ($hGraphic, 68, 0, 69, 109, $hBrush1)
    ;_GDIPlus_GraphicsDrawLine ($hGraphic, 66, 42, $posx2, $posy2, $hPen2)
    EndIf
    if $cpu = "ON" Then $coord1 = PixelSearch( $poswidth, $posheight, $posx, $posy, $P1col, 1)
    if $cpu = "OFF" Then $coord1 = PixelSearch( 0, 0, 147, 109, $P1col, 1)
    if $coord1 = @error then
       $coord1 = PixelSearch( 0, 0, 147, 109, $P1col, 1)
       EndIf
    if Not @error then
    $calx = Number($coord1[0]-10)
    $caly = Number($coord1[1]-32)
    $dif = Number(110-$coord1[1])
    $difcalc = Number($dif*2)
    _GDIPlus_GraphicsDrawEllipse ($hGraphic, $calx, $caly, 15, 15, $hBrush1)
    $nr1x = Number($coord1[0]*7)
    $nr1y = Number($coord1[1]*7-$difcalc)
    ;MsgBox(0, "", $nr1x & "  " & $nr1y)
    MouseMove($nr1x, $nr1y, $speed)
    Endif
    wend
    EndFunc

    ; ----------- Pause and Exit-----------------------
    Func TogglePause()
        $Paused = NOT $Paused
        While $Paused
            sleep(100)
            ToolTip('Mouse Control is Paused',0,0)
        WEnd
        ToolTip("")
    EndFunc
    Func Terminate()
         
          ;DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_CALLBACK_FRAME, "int", 0, "int", 0)
            DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_END, "int", 0, "int", 0)
            DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0)
      ;DllClose($avi)
            DllClose($user)
        Exit 0
    EndFunc
    and Settings:
    Code:
    #include <GUIConstantsEx.au3>

    Opt('MustDeclareVars', 0)

    Example()

    Func Example()
        Local $Button1, $Button2, $msg
        GUICreate("TSMC Settings", 350, 250) ; will create a dialog box that when displayed is centered
       GUICtrlCreateLabel("If shader is large then the object" & @CRLF & " you use as a mouse will be easier to detect!", 10, 20, 170, 50)
       GUICtrlCreateLabel("The more larger Pixel Check is " & @CRLF & "the less lagg you will have!", 180, 20, 170, 50)
        $Button1 = GUICtrlCreateButton("Shader 1", 10, 60, 120, 20)
        $Button2 = GUICtrlCreateButton("Shader 25", 10, 80, 120, 20)
       $Button3 = GUICtrlCreateButton("Shader 50", 10, 100, 120, 20)
       $Button4 = GUICtrlCreateButton("Shader 75", 10, 120, 120, 20)
       $Button5 = GUICtrlCreateButton("Shader 100", 10, 140, 120, 20)
       $Button6 = GUICtrlCreateButton("Pixel Check 10", 180, 60, 120, 20)
        $Button7 = GUICtrlCreateButton("Pixel Check 8", 180, 80, 120, 20)
       $Button8 = GUICtrlCreateButton("Pixel Check 6", 180, 100, 120, 20)
       $Button9 = GUICtrlCreateButton("Pixel Check 4", 180, 120, 120, 20)
       $Button10 = GUICtrlCreateButton("Pixel Check 2", 180, 140, 120, 20)
       $Button11 = GUICtrlCreateButton("Pixel Check 1", 180, 160, 120, 20)
       $Button12 = GUICtrlCreateButton("Mouse", 100, 210, 95, 20)
       $Button13 = GUICtrlCreateButton("Mouse Speed", 10, 160, 120, 20)
       $Button14 = GUICtrlCreateButton("Graph", 10, 180, 80, 20)
       $Button15 = GUICtrlCreateButton("CPU Save", 205, 180, 95, 20)
       $combo = GUICtrlCreateCombo("", 100, 190) ; create first item
        $data = GUICtrlSetData(-1, "Touchpad|Mouse Control|Game", "")
        GUICtrlSetState($Button2, $GUI_CHECKED)

        GUISetState()      ; will display an  dialog box with 1 checkbox

        ; Run the GUI until the dialog is closed
        While 1
            $msg = GUIGetMsg()
            Select
          Case $msg = $GUI_EVENT_CLOSE
             run("TSMC.exe")
                    ExitLoop
                Case $msg = $Button1
                    MsgBox(64, 'Info:', 'Shaders Changed!')
                IniWrite("settings.ini", "settings", "Shader", "1")
                Case $msg = $Button2
                    MsgBox(64, 'Info:', 'Shaders Changed!')
                IniWrite("settings.ini", "settings", "Shader", "25")
             Case $msg = $Button3
                    MsgBox(64, 'Info:', 'Shaders Changed!')
                IniWrite("settings.ini", "settings", "Shader", "50")
             Case $msg = $Button4
                    MsgBox(64, 'Info:', 'Shaders Changed!')
                IniWrite("settings.ini", "settings", "Shader", "75")
             Case $msg = $Button5
                    MsgBox(64, 'Info:', 'Shaders Changed!')
                IniWrite("settings.ini", "settings", "Shader", "100")
                Case $msg = $Button6
                    MsgBox(64, 'Info:', 'Pixels Changed!')
                IniWrite("settings.ini", "settings", "Pixel", "10")
                Case $msg = $Button7
                    MsgBox(64, 'Info:', 'Pixels Changed!')
                IniWrite("settings.ini", "settings", "Pixel", "8")
                Case $msg = $Button8
                    MsgBox(64, 'Info:', 'Pixels Changed!')
                IniWrite("settings.ini", "settings", "Pixel", "6")
                Case $msg = $Button9
                    MsgBox(64, 'Info:', 'Pixels Changed!')
                IniWrite("settings.ini", "settings", "Pixel", "4")
                Case $msg = $Button10
                    MsgBox(64, 'Info:', 'Pixels Changed!')
                IniWrite("settings.ini", "settings", "Pixel", "2")
                Case $msg = $Button11
                    MsgBox(64, 'Info:', 'Pixels Changed!')
                IniWrite("settings.ini", "settings", "Pixel", "1")
                Case $msg = $Button12
                $read = GUICtrlRead($combo)
                    MsgBox(64, 'Info:', 'Mouse Set to ' & $read)
                if $read = "Mouse Control" Then IniWrite("settings.ini", "settings", "Mod", "Control")
                if $read = "Game" Then IniWrite("settings.ini", "settings", "Mod", "Game")
                if $read = "Touchpad" Then IniWrite("settings.ini", "settings", "Mod", "Touchpad")
                Case $msg = $Button13
                   $speed = InputBox("Mouse Speed", "Enter the speed of the mouse to be controlled")
                   IniWrite("settings.ini", "settings", "Speed", $speed)
                Case $msg = $Button14
                   $read = IniRead("settings.ini", "settings", "Graph", "Error with settings.ini")
                   if $read = "ON" then IniWrite("settings.ini", "settings", "Graph", "OFF")
                   if $read = "ON" then MsgBox(0, "Graphics", "Graphics has been changed to OFF")
                   if $read = "OFF" then IniWrite("settings.ini", "settings", "Graph", "ON")
                   if $read = "OFF" then MsgBox(0, "Graphics", "Graphics has been changed to On")
                Case $msg = $Button15
                   $read = IniRead("settings.ini", "settings", "CPU", "Error with settings.ini")
                   if $read = "ON" then IniWrite("settings.ini", "settings", "CPU", "OFF")
                   if $read = "ON" then MsgBox(0, "CPU SPEED", "CPU SAVE has been changed to OFF")
                   if $read = "OFF" then IniWrite("settings.ini", "settings", "CPU", "ON")
                   if $read = "OFF" then MsgBox(0, "CPU SPEED", "CPU SAVE has been changed to On")
            EndSelect
        WEnd
    EndFunc  ;==>Example

    you must download the includes becouse it reads data from settings.ini
    Usually these things are made with sectors, like 4-6 sectors and no math but i made them with math which makes it less buggy.
    avatar
    maakera
    Newbie
    Newbie


    Posts : 12
    Exp : 25946
    Reputation : 0
    Join date : 2010-09-19

    Mouse Control via Webcam Empty Re: Mouse Control via Webcam

    Post by maakera Sun Sep 19, 2010 9:19 am

    you really should start thinking of Face Recognizion.
    Zibit
    Zibit
    Admin


    Posts : 21
    Exp : 26618
    Reputation : 6
    Join date : 2010-05-22
    Age : 31
    Location : Estonia

    Mouse Control via Webcam Empty Re: Mouse Control via Webcam

    Post by Zibit Sun Sep 19, 2010 9:20 am

    i got it already not the best but it will do Smile

    Sponsored content


    Mouse Control via Webcam Empty Re: Mouse Control via Webcam

    Post by Sponsored content


      Current date/time is Thu Nov 21, 2024 5:10 am