Jump to content
Sign in to follow this  
JustInuYasha

Need a lil help

Recommended Posts

JustInuYasha

I'm trying to figure out the code for making SURE the script fires 'Left Click' before moving on to the sleeping then more Moving.

I've been practicing for a few hours w/o help, so I'm finally asking for some.

Can someone take a look at his and help me out?

Please and thank you!!!

#include <Misc.au3>

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

$Path = @ScriptDir&"/AutoClickConfig.ini"

If Not FileExists($Path) Then

$File = FileOpen($Path, 10)

$Contents = _

"/////////////////////////////////////////////////////////////////////////////////////////////"&@CRLF& _

"// ONLY change values in settings"&@CRLF& _

"// Below is the hotkey value list"&@CRLF& _

"// Duration is the pause between each click in milliseconds(ms) -- (1000ms = 1sec)"&@CRLF& _

"// Showtip = 1 To show conformation tooltip on running, else = 0"&@CRLF& _

"/////////////////////////////////////////////////////////////////////////////////////////////"&@CRLF&@CRLF& _

"[settings]"&@CRLF& _

"StartKey = 11"&@CRLF& _

"Stopkey = 12"&@CRLF& _

"Duration = 15000"&@CRLF& _

"Button = Left"&@CRLF& _

"Send = 20"&@CRLF _

"ShowTip = 1"&@CRLF _

"[Hotkeys]"&@CRLF& _

"01 = Left mouse button"&@CRLF& _

"02 = Right mouse button"&@CRLF& _

"04 = Middle mouse button"&@CRLF& _

"05 = X1 mouse button"&@CRLF& _

"06 = X2 mouse button"&@CRLF& _

"08 = BACKSPACE key"&@CRLF& _

"09 = TAB key"&@CRLF& _

"0C = CLEAR key"&@CRLF& _

"0D = ENTER key"&@CRLF& _

"10 = SHIFT key"&@CRLF& _

"11 = CTRL key"&@CRLF& _

"12 = ALT key"&@CRLF& _

"13 = PAUSE key"&@CRLF& _

"14 = CAPS LOCK key"&@CRLF& _

"1B = ESC key"&@CRLF& _

"20 = SPACEBAR"&@CRLF& _

"21 = PAGE UP key"&@CRLF& _

"22 = PAGE DOWN key"&@CRLF& _

"23 = END key"&@CRLF& _

"24 = HOME key"&@CRLF& _

"25 = LEFT ARROW key"&@CRLF& _

"26 = UP ARROW key"&@CRLF& _

"27 = RIGHT ARROW key"&@CRLF& _

"28 = DOWN ARROW key"&@CRLF& _

"29 = SELECT key"&@CRLF& _

"2A = PRINT key"&@CRLF& _

"2B = EXECUTE key"&@CRLF& _

"2C = PRINT SCREEN key"&@CRLF& _

"2D = INS key"&@CRLF& _

"2E = DEL key"&@CRLF& _

"30 = 0 key"&@CRLF& _

"31 = 1 key"&@CRLF& _

"32 = 2 key"&@CRLF& _

"33 = 3 key"&@CRLF& _

"34 = 4 key"&@CRLF& _

"35 = 5 key"&@CRLF& _

"36 = 6 key"&@CRLF& _

"37 = 7 key"&@CRLF& _

"38 = 8 key"&@CRLF& _

"39 = 9 key"&@CRLF& _

"41 = A key"&@CRLF& _

"42 = B key"&@CRLF& _

"43 = C key"&@CRLF& _

"44 = D key"&@CRLF& _

"45 = E key"&@CRLF& _

"46 = F key"&@CRLF& _

"47 = G key"&@CRLF& _

"48 = H key"&@CRLF& _

"49 = I key"&@CRLF& _

"4A = J key"&@CRLF& _

"4B = K key"&@CRLF& _

"4C = L key"&@CRLF& _

"4D = M key"&@CRLF& _

"4E = N key"&@CRLF& _

"4F = O key"&@CRLF& _

"50 = P key"&@CRLF& _

"51 = Q key"&@CRLF& _

"52 = R key"&@CRLF& _

"53 = S key"&@CRLF& _

"54 = T key"&@CRLF& _

"55 = U key"&@CRLF& _

"56 = V key"&@CRLF& _

"57 = W key"&@CRLF& _

"58 = X key"&@CRLF& _

"59 = Y key"&@CRLF& _

"5A = Z key"&@CRLF

$Contents2 = _

"5B = Left Windows key"&@CRLF& _

"5C = Right Windows key"&@CRLF& _

"60 = Numeric keypad 0 key"&@CRLF& _

"61 = Numeric keypad 1 key"&@CRLF& _

"62 = Numeric keypad 2 key"&@CRLF& _

"63 = Numeric keypad 3 key"&@CRLF& _

"64 = Numeric keypad 4 key"&@CRLF& _

"65 = Numeric keypad 5 key"&@CRLF& _

"66 = Numeric keypad 6 key"&@CRLF& _

"67 = Numeric keypad 7 key"&@CRLF& _

"68 = Numeric keypad 8 key"&@CRLF& _

"69 = Numeric keypad 9 key"&@CRLF& _

"6A = Multiply key"&@CRLF& _

"6B = Add key"&@CRLF& _

"6C = Separator key"&@CRLF& _

"6D = Subtract key"&@CRLF& _

"6E = Decimal key"&@CRLF& _

"6F = Divide key"&@CRLF& _

"70 = F1 key"&@CRLF& _

"71 = F2 key"&@CRLF& _

"72 = F3 key"&@CRLF& _

"73 = F4 key"&@CRLF& _

"74 = F5 key"&@CRLF& _

"75 = F6 key"&@CRLF& _

"76 = F7 key"&@CRLF& _

"77 = F8 key"&@CRLF& _

"78 = F9 key"&@CRLF& _

"79 = F10 key"&@CRLF& _

"7A = F11 key"&@CRLF& _

"7B = F12 key"&@CRLF& _

"90 = NUM LOCK key"&@CRLF& _

"91 = SCROLL LOCK key"&@CRLF& _

"A0 = Left SHIFT key"&@CRLF& _

"A1 = Right SHIFT key"&@CRLF& _

"A2 = Left CONTROL key"&@CRLF& _

"A3 = Right CONTROL key"&@CRLF& _

"A5 = MENU key"&@CRLF& _

"BA = ;"&@CRLF& _

"BB = ="&@CRLF& _

"BC = ,"&@CRLF& _

"BD = -"&@CRLF& _

"BE = ."&@CRLF& _

"BF = /"&@CRLF& _

"C0 = `"&@CRLF& _

"DB = ["&@CRLF& _

"DC = \"&@CRLF& _

"DD = ]"

FileWrite($File,$Contents&$Contents2)

FileClose($File)

EndIf

$Settings = IniReadSection($Path, "Settings")

$Er = @error

If $Er or NOT IsArray($Settings) Then

MsgBox(0,"Error","Could not read AutoClickConfig.ini"&@CRLF&"Error Code: "&$er)

Exit

EndIf

$Start = String($Settings[1][1])

$Stop = String($Settings[2][1])

$Dur = Number($Settings[3][1])

$Button = String($Settings[4][1])

$Send = String($Settings[5][1])

If $Settings[6][1] then

$Keys = IniReadSection($Path,"Hotkeys")

For $i = 1 to $keys[0][0]

If $Keys[$i][0] = $Settings[1][1] then $Startkey = $Keys[$i][1]

Next

For $i = 1 to $keys[0][0]

If $Keys[$i][0] = $Settings[2][1] then $Stopkey = $Keys[$i][1]

Next

For $i = 5 to 1 step -1

ToolTip("StartKey: "&$Startkey&"("&$Start&")"&@CRLF&"StopKey: "&$Stopkey&"("&$Stop&")"&@CRLF&"Duration: "&$Dur&@CRLF&$i&"...",0,0)

Sleep(1000)

Next

ToolTip("")

EndIf

Opt("MouseCoordMode",0)

While 1

If _IsPressed($Start) Then

Do

Sleep(100)

Until Not _IsPressed($Start)

Do

MouseMove(324,227)

Sleep(1600)

MouseClick($Button)

Sleep(1500)

MouseMove(500,565)

Sleep(1500)

MouseClick($Button)

Sleep(1000)

MouseMove(500,470)

MouseClick($Button)

Sleep(500)

MouseClick($Button)

Send($Send)

Sleep(2000)

Send("{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}")

$Interupt = Check4stop($Dur)

Until _IsPressed($Stop) or $interupt = 1

Do

Sleep(100)

Until NOT _IsPressed($Stop)

EndIf

WEnd

Func Check4stop($Duration)

$Timer = TimerInit()

Do

If _IsPressed($Stop) then Return 1

Until TimerDiff($Timer) >= $Duration

EndFunc

Func Quit()

Exit

Endfunc

Share this post


Link to post
Share on other sites
JustInuYasha

Can anyone give me a hand with this code?

I can't figure this out!

Share this post


Link to post
Share on other sites
Melba23

JustInuYasha,

Please do not bump your own posts within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer - like this. ;-)

You say you want to be "SURE the script fires 'Left Click' before moving on to the sleeping then more Moving". What evidence do you have that it is not clicking? When I run the posted code (after adjusting the coordinates so I can see a result), the mouse moves and clicks as I would expect and the various hotkeys start, stop and exit as coded.

So how do you know you have a problem?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
JustInuYasha

JustInuYasha,

Please do not bump your own posts within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer - like this. ;-)

You say you want to be "SURE the script fires 'Left Click' before moving on to the sleeping then more Moving". What evidence do you have that it is not clicking? When I run the posted code (after adjusting the coordinates so I can see a result), the mouse moves and clicks as I would expect and the various hotkeys start, stop and exit as coded.

So how do you know you have a problem?

M23

Well I've come a long way from that post.. Kinda

I know it's actually firing the command. It IS clicking.

It must just be the program I'm trying to use it on. It doesn't exactly connect every time?

I'm not sure how to explain it.

Got any ideas for why the exe i'm using it on wouldn't be picking up the 'clicks' correctly?

That's my best guess atm.

Share this post


Link to post
Share on other sites
JustInuYasha

Why do I think I'm looking at some sort of keystroke logger?

How do you get a keylogger out of clicks and spaces???????????????????????????????????????????

It's a game....

Is there a way, I can make it keep clicking there every like (100) until a Pixel changes color in a certain area?

If so I don't know how to do that and it'd be VERY useful!

Edited by JustInuYasha

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.