Sign in to follow this  
Followers 0
Jayce

Help With A Script Error

5 posts in this topic

Hey Guys, Im EXTREMELY New To This Scripting Stuff.

When I Try To Run The Sxript Below, I Am Receiving This Error.

Posted Image

HotKeySet("Mouseclick("left")", "ToggleSpam")

HotKeySet("+{ESC}", "EndSpam")

Global $x

MsgBox(0, "MouseSpaz", "MouseClick("middle") Starts the spaz (press both keys with your left thumb)" & @LF & @LF & "Pressing Alt+X again will stop the spaz" & @LF & @LF & "Shift+Esc will quite the program")

While 1

While $x

MouseClick("primary")

WEnd

WEnd

;FUNCTIONS

Func ToggleSpam()

$x = Not $x

EndFunc ;==>ToggleSpam

Func EndSpam()

Exit

EndFunc ;==>EndSpam

Any Help Would be Appreciated, Thanks :D

Share this post


Link to post
Share on other sites



Hi, name of function should indicate your problem.

It's HotKeySet. Not HotMouseSet (there is no HotMouseSet, don't bother looking).

ohk, thanks. i wonder. is there any chance i could make it so that whilst i hold down my left mouse button or even my middle mouse button if possible that this script could run.

basically im trying to create a script that allows me to make very rapid mouse clicks, but prefferentially i would like the activation to occur when i click my mouse.

- thanks

Share this post


Link to post
Share on other sites

You could do something when the mouse is held down, but I don't think that would be very effective.

#Include <Misc.au3>

$DLL = DllOpen("user32.dll")
While 1
    Sleep(10)
    While _IsPressed(05, $DLL)
        Sleep(10)
        MouseClick("right")
    WEnd
WEnd

Some things to know:

  • This eats quite alot of CPU, increase the Sleep() if necessary/possible.
  • Use _IsPressed with a mousebutton that doesn't do anything in the game/application you intend to run or things will get messy. 05 is button 4 and 06 button 5. See _IsPressed() in the helpfile.
  • "right" means the right button (you couldn't guess that could you? :D). Look at MouseClick() in the helpfile for a nice table describing the choices for it.

Share this post


Link to post
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
Sign in to follow this  
Followers 0