Jump to content

Help With A Script Error


Recommended Posts

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





Func ToggleSpam()

$x = Not $x

EndFunc ;==>ToggleSpam

Func EndSpam()


EndFunc ;==>EndSpam

Any Help Would be Appreciated, Thanks :D

Link to comment
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

Link to comment
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
    While _IsPressed(05, $DLL)

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...