Sign in to follow this  
Followers 0
mechlordx

How come this code wont click properly?

4 posts in this topic

It is supposed to click in an x by x grid, depending on what hotkey you press. The show message is just to test if its actually running in the background. I know i have the 3-9 functions not set yet, but when i hit 1 or 2 it doesn click. At all. thanks for any help.

Global $Paused

HotKeySet("{ESC}", "Terminate")

HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d its a testing device

HotKeySet("{1}", "OnebyOne")

HotKeySet("{2}", "TwobyTwo")

HotKeySet("{3}", "ThreebyThree")

HotKeySet("{4}", "FourbyFour")

HotKeySet("{5}", "FivebyFive")

HotKeySet("{6}", "SixbySix")

HotKeySet("{7}", "SevenbySeven")

HotKeySet("{8}", "EightbyEight")

HotKeySet("{9}", "NinebyNine")

While 1

Sleep(100)

WEnd

Func Terminate()

Exit 0

EndFunc

Func ShowMessage()

MsgBox(4096,"","This is a message.")

EndFunc

Func OnebyOne()

MouseClick("left")

Endfunc

Func TwobyTwo()

$pos = MouseGetPos()

MouseClick("left", $pos[0] + 10, $pos[1] + 10)

MouseClick("left", $pos[0] + 10, $pos[1])

MouseClick("left", $pos[0], $pos[1] + 10)

MouseClick("left", $pos[0], $pos[1])

Endfunc

Func ThreebyThree()

$pos = MouseGetPos()

MouseClick("left")

Endfunc

Func FourbyFour()

$pos = MouseGetPos()

MouseClick("left")

Endfunc

Func FivebyFive()

$pos = MouseGetPos()

MouseClick("left")

Endfunc

Func SixbySix()

$pos = MouseGetPos()

MouseClick("left")

Endfunc

Func SevenbySeven()

$pos = MouseGetPos()

MouseClick("left")

Endfunc

Func EightbyEight()

$pos = MouseGetPos()

MouseClick("left")

Endfunc

Func NinebyNine()

$pos = MouseGetPos()

MouseClick("left")

Endfunc

Share this post


Link to post
Share on other sites



Hello mechlordx,

First, Welcome to the AutoIt Forums :graduated:

Your script works just fine for me, however, I will take a guess here, and assume your attempting to use the numpad digits for your HotKeySet's. With your script the numerical keys above the letters, are the ones that will work with your HotKey's, If you want to use numpad then use {NUMPAD0} - {NUMPAD9}.

Realm


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

i was actually was not using the numpad. i test the 1 and 2, and then check if its running with show message and it is. i have no idea then!

Share this post


Link to post
Share on other sites

Just saw this and thought that I might let you know about th code function.

type "[code ]" then everything inside your code. Remove the space in it by the way. Then paste your code and then type [/code ] again, remove the space. Then, all of your code should appoea:

Inside a box like this text right here.

There is also a button in the forum post editor which looks like this:

<>

But it is blue. That inserts the code tags automatically.

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