Jump to content

Send Key & Left Click questions


Recommended Posts

I have been searching through the forums, and I have also read the documentation and could not find what I was looking for.

So I have two questions

1.) How can I assign a number pad key like {NUMPAD0} to be a hotkey to launch the send key function?

2.) I am running this game and the accuracy of a weapon get worse when you hold down the left key on the mouse. Therefore, I was thinking is it possible when you hold down the left key instead of a continuous left click that it left clicks rapidly? ß Yea I know I am lazy :P

Can anyone help me with these two problems?

Link to comment
Share on other sites

This might help you figure out the left mouse click thing

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 200 )
    If _IsPressed("01", $dll) Then
        MsgBox(0,"_IsPressed", "Left Mouse Key Pressed")
        ExitLoop
    EndIf
WEnd
DllClose($dll)


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Okay I have this, but I did a syntax check and says the syntax is wrong :P

HotKeySet("{NUMPAD0}", "Send("Please stop Tk'ing"[,1)")

HotKeySet("{NUMPAD0}", "YourFunction")

Func YourFunction()

Send("Please stop Tk'ing",1)

EndFunc
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

no..

HotkeySet("*KEY TO SEND*", "*FUNC NAME*")

soo it would be like

HotKeySet("{NUMPAD0}", "Send")

Func Send()
     Send("Please Stop Tk'ing", 1)
EndFunc

While 1
     Sleep(1000)
WEnd

The sleep loop is too keep auto it running...

[EDIT]

gafrost hadnt post before

Edited by lopolop
Link to comment
Share on other sites

Okay I have this, but I did a syntax check and says the syntax is wrong :P

HotKeySet("{NUMPAD0}", "Send("Please stop Tk'ing"[,1])")
Try

HotKeySet("{NUMPAD0}", "SendMessage")

While 1
    Sleep(100)
WEnd

Func SendMessage()
    Send("Please stop Tk'ing",1)
EndFunc

Edit

Too slow again

Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

I think the script detects if the left mouse key is pressed ?.?.?

That is what you wanted. :P


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Oh, I see now...

Okay I know when the left key is pressed how can I tie that together with the MouseClick function?

Not ideal

#include <Misc.au3>
$dll = DllOpen("user32.dll")
$pos = MouseGetPos()
while 1
    sleep(50)
    if _IsPressed("01", $dll) then
MouseClick("left",$pos[0],$pos[1],10)
Endif
WEnd
DllClose($dll)

This will give bursts of 10 clicks for every time you click the left button

Edit

Removed MouseClick("left") from first line of code.

Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

oh :P, Thank You!!!

I really hate to ask this and should have asked ealier but is there a way I can put a interval between the shots?

Is it a good idea to put

#include <Misc.au3>MouseClick("left")

at the beginning of the code?

The #include <Misc.au3> goes at the top the rest of the line was a pasting error.

If you read about MouseClick in the helpfile you will see that there is a speed option that can be added to the command.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

What is this script for AgentSmith15?...

It's for Halo...

About the auto left click, in Halo if you were to hold the left key down to shoot someone after three continuous shots it gets very inaccurate.

And about the hotkeys, We run a server and we need to type alot of stuff. From Rcon commands to telling someone to watch their language...

Link to comment
Share on other sites

Okay so this is what I have...

#include <Misc.au3>MouseClick("left")

If WinExists($g_szVersion) Then Exit; It's already running, keeps only one copy of the script running.
AutoItWinSetTitle($g_szVersion)

WinWaitActive("Halo"); Pauses execution of the script until the Halo window is active.

opt("SendKeyDelay", 200); Alters the the length of the brief pause in between sent keystrokes.
opt("SendKeyDownDelay", 120); Alters the length of time a key is held down before released during a keystroke.

HotKeySet("{NUMPAD0}", "SendMessage")

While 1
    Sleep(100);The sleep loop is too keep Autoit running.
WEnd

Func SendMessage()
    Send("t Please stop Tk'ing", 1)
EndFunc  ;==>SendMessage

; Below is the auto left click code

$dll = DllOpen("user32.dll")
$pos = MouseGetPos()
While 1
    Sleep(50)
    If _IsPressed ("01", $dll) Then
        MouseClick("left", $pos[0], $pos[1], 10)
    EndIf
WEnd
DllClose($dll)

Yes, I know I need to set a title and i'm looking how to do it...

Link to comment
Share on other sites

Set a title, as in change a title.. A little more explanation would be good if you could. I think what I posted will work...

Edited by Sardith

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

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