Sign in to follow this  
Followers 0
Quisto

Need Help Setting Up A Simple Macro

11 posts in this topic

Hi, im need of help setting up a real simple macro, like an "autofire" that where on the old joysticks.

This is what i want the macro to do:

Double click left mouse button as fast as possible at a specific Cordinate (that i can put in myself later).

I want this macro to Auto repeat it self over and over as quickly as possible.

And if there is a possibility to bind this to a keyboard button so that i can turn it on and off

If someone could help me with this i would be really grateful, i just found this program but it seems way to complicated for me :whistle: .

Thanks alot. Q

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Written direcly in the forum window. So untested :whistle:

Is intended that you make a settings.ini file with a single section with name [settings] and with value x_coord and y_coord

$y = IniRead(@ScriptDir & "\setting.ini","Settings","Y_Coord","")
$x = IniRead(@ScriptDir & "\setting.ini","Settings","X_Coord","")

HotKeySet("^+s","_Start")
HotKeySet("^+p","_Pause")
HotKeySet("^+e","_Terminate")

;Determine if user has swapped right and left mouse buttons
 $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")

; It's okay to NOT check the success of the RegRead operation
 If $k = 1 Then
     $primary = "right"
 Else;normal (also case if could not read registry key)
     $primary = "left"
 EndIf

While 1
  Sleep(200)
WEnd


Exit

Func _Start()
 While 1
   MouseClick($primary, $x, $y)
 WEnd
EndFunc

Func _Pause()
 While 1
 Sleep(200)
 WEnd
EndFunc

Func _Terminate()
 Exit
EndFunc
Edited by ezzetabi

Share this post


Link to post
Share on other sites

Hi, thanks alot for the help, but i still need help setting this up, all the basics acctualy.

How do i make this work.

I put the code in one file wich i named Quisto.au3

Then i made a ini file named Coord.ini and this i sthe text i put in it 36,915

what do i do next?

a step by step would be nice :whistle:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Yep, copy the code in a .au3 file. (copy it again, it had a problem)

Create a setting.ini plain text file in the same folder with that content:

[settings]
x_coord=
y_coord=

ok? now put next the =s the cood you want the script use.

Start the script, press control+shift+S to start, control+shift+P to pause and control+shift+E to terminate it.

Edited by ezzetabi

Share this post


Link to post
Share on other sites

ok, now this what i have done i copied the first code you gave me into the Quisto.au3 file. Then i made a .ini file called settings with the text:

[settings]

x_cord=36

y_cord=915

Then i put both files in a directory on my desktop.

Then i run the Quisto.au3 file, An auto it script appears in the system tray, but its blinking with a red X. neither of the ctrl+shift commands work.

Is there something i did wrong or something i have to add to the .au3 file or the .ini file?

:whistle: .Q

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

it is all my fault, sorry... In the original script I wrote "Coord" in the ini section instead of Settings... I corrected now. and also tested

EDIT... in your post you wrote

x_cord=36

y_cord=915

mmn... I wrote coord what is correct?

Edited by ezzetabi

Share this post


Link to post
Share on other sites

Great now its working, now i only have one problem, When i press ctrl+shift+s to start the script instead o fixating on the coordinates i put x= 36 y= 915 wich is almost in the bottom left corner of the screen. The cursour positions itself in the top left corner of the creen almost as if the coordinates are "outside" the screen.

Am i putting i bad Coords?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

The coords are calculated from the top left

0,0

x ------------------------->

I Going right the X increase until @DesktopHeight

I

I

I

I

I Going down the Y increase until @DesktopWidth

I

I

¥

Use Autoit 3 Winspy to see...

Edited by ezzetabi

Share this post


Link to post
Share on other sites

After i read yor edited reply i check and i had this in my settings.ini

[settings]

x_cord=36

y_cord=915

So i changed it to what you originaly wrote, wich was:

[settings]

x_coord=36

y_coord=915

But the cursor still positions itself in the top left corner of the screen.

Share this post


Link to post
Share on other sites

:whistle: YES !!!!! now its working, i had named the settings file wrong. Thank you so very very much for your help. I would never been able to pull this off by myself.

Thank so you much again and may you have a long happy life B)

Share this post


Link to post
Share on other sites

May I ask why do you need this?

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