Jump to content

Toggle On/Off Keys How? [ERROR Help]


Recommended Posts

Please read my last post below!

How would I add a toggle on/off key to this code, so when u hit like f3 its on then f4 off?

Also is there a keynumber for scrollwheel?

#include <Misc.au3>

$dll = DllOpen("user32.dll")
$ExitKey = '1B'; ESC

While 1
    Sleep(10)
    If _IsPressed("01", $dll) Then MouseMove(215, 485, 50)
    If _IsPressed($ExitKey, $dll) Then ExitLoop
    WEnd
    
    DllClose($dll)
Edited by omiden
Link to comment
Share on other sites

Ok I read up on it and this is what I got but I get a error.

#include <Misc.au3>

$dll = DllOpen("user32.dll")
$ExitKey = '75'; ESC
HotKeySet ( "BD" [, "On"] )
HotKeySet ( "BB" [, "Off"] )



Func On()
While 1
    Sleep(10)
    If _IsPressed("01", $dll) Then MouseMove(640, 518, 100)
    If _IsPressed($ExitKey, $dll) Then ExitLoop
    WEnd
    
    DllClose($dll)
EndFunc

Func Off()
    While 1
    Sleep(10)
    If _IsPressed("01", $dll) Then MouseMove(0, 0, 0)
    If _IsPressed($ExitKey, $dll) Then ExitLoop
    WEnd
    
    DllClose($dll)
    EndFunc

Errors

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\***\Desktop\recoil.au3"    
C:\Users\***\Desktop\recoil.au3 (5) : ==> Error parsing function call.:
HotKeySet ( "BD" [, "On"] )
HotKeySet ( "BD" ^ ERROR
>Exit code: 1    Time: 0.212
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...