Jump to content

[Help] How to repeatedly mouseclick on mousedown?


 Share

Recommended Posts

What I want is:

    If LButton pressed:  after 120ms, spam LButton until LButton not pressed

How do you tell it to click, while still recognizing the physical LButton's state?

#include <Misc.au3>
HotKeySet("{Esc}", "Hotkey_Esc")


While 1
    Sleep ( 100 )
    If _IsPressed("01") Then
        Sleep ( 120 )
        While _IsPressed("01") ; while LButton Down <<< not working; conflicts w/ MouseClick
            Sleep ( 10 )
            MouseClick ( "Primary" )
        WEnd
    EndIf
WEnd


Func Hotkey_Esc()
    Exit
EndFunc

ps.  i can do this easily in autohotkey -.-

; <<< AutoHotkey Code >>>
LButton::       ;While LButton Down, Spam LButton
  MouseClick, L
  Sleep 120
  Loop
    {
    Sleep 10
    Getkeystate,VarLB,LButton,P
    If VarLB=U
      Break
    MouseClick, L
    }
  Return

please help, i'm here cause i like autoit more than autohotkey :)

Link to comment
Share on other sites

  • Moderators

Can you explain just what you're trying to accomplish? There is probably an easier way than spamming Mouseclicks

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Can you explain just what you're trying to accomplish? There is probably an easier way than spamming Mouseclicks

Accomplish:  spam clicks easily for click-heavy games

No, there isn't a way that doesn't involve spamming clicks...

Its a very useful script, which I pull up very often, I'm just having trouble converting it to Autoit, is all.....

donno if it'll help, but heres the full script in AutoHotkey

; <<< AutoHotkey >>>
#SingleInstance Force
Return

    ; LButton = Spam LButton
    ; RButton = Spam RButton



LButton::       ;While LButton Down, Spam LButton
  MouseClick, L
  Sleep 100
  Loop
    {
    Sleep 10
    Getkeystate,VarLB,LButton,P
    If VarLB=U
      Break
    MouseClick, L
    }
  Return

RButton::       ;While RButton Down, Spam RButton
  MouseClick, R
  Sleep 100
  Loop
    {
    Sleep 10
    Getkeystate,VarRB,RButton,P
    If VarRB=U
      Break
    MouseClick, R
    }
  Return

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#E::    Edit
#R::    Reload
#Esc::  ExitApp
Link to comment
Share on other sites

  • Moderators

 

Accomplish:  spam clicks easily for click-heavy games

 

It appears you missed the forum rules on your way in, which specifically prohibits "Launching, automation or script interaction with games or game servers, regardless of the game.". Please review them now, in the bottom right corner of each forum page, to see why you will not receive any help with this issue.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

It appears you missed the forum rules on your way in, which specifically prohibits "Launching, automation or script interaction with games or game servers, regardless of the game.". Please review them now, in the bottom right corner of each forum page, to see why you will not receive any help with this issue.

I let my guard down. ya got me.

i'll resort to google now... saw an answer on a different thread in same forum somewhere..   -.-

Link to comment
Share on other sites

  • Moderators

Aside from my personal respect for AutoIt as a language, as well as the forum. I would add only this:

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Aside from my personal respect for AutoIt as a language, as well as the forum. I would add only this:

Thats funny... you seem to think using a bot for repetitive tasks is somehow better than becoming the bot.

Sorry you despise me for playing a game. In my defense, I'm trying to learn, have fun, and Not Grind my life away.

If you still despise me, thats your own issue, just don't pretend like you understand me -.-

Link to comment
Share on other sites

On a lighter note, I found out about various useful tools in Scite's Tools section  yay! very useful!

and how to add udfs, including the udf which solves this thread:  MouseOnEvent

sorry for being negative this thread. i'll try to refrain in the future.

thread solved, and gn :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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