Jump to content

Recommended Posts

Posted (edited)

I need this script; I press keyboard button "G" then it triggers this;

presses keyboard button

presses with mouse on cord x;y

presses keyboard button

Just hit me with a script where I can change the button/coords, if it's possible. I may not loop it, just do the sequence when I get "G".

Thanks in advance.

Edited by AzGuL^
Posted

ok, read the helpfile look at

HotKeySet()

Send()

MouseClick()

people will probably not write it for you but if you make some kind of effort to do it yourself and you have problems, people will help

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
  • Moderators
Posted

Just hit me with a script where I can change the button/coords, if it's possible. I may not loop it, just do the sequence when I get "G".

Can you get me a cheese burger while your at it?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted (edited)

ok, read the helpfile look at

HotKeySet()

Send()

MouseClick()

people will probably not write it for you but if you make some kind of effort to do it yourself and you have problems, people will help

~cdkid

Thanks for the fast response!

I now made this;

HotKeySet("^!g", "MyScript")

Func MyScript()
    Send(^!p)
    MouseClick(100,150)
    Send(^!p)
    Exit
EndFunc

But it tells me some error around the Send cmd :o I believe I didn't get how to send a key :geek:

EDIT; SmOke_N, haha so funny .. ?

Edited by AzGuL^
Posted

HotKeySet("{END}", "End")
HotKeySet("g", "Go")

$btn = InputBox("Btn", "What is the button to press?")
$x = InputBox("Mouse Click X", "What is the X coordinate for the mouse click?")
$y = InputBox("Mouse Click Y", "What is the Y coordinate for the mouse click?")

While 1
    Sleep(10)
WEnd

Func End()
    Exit
EndFunc

Func Go()
    Send($btn)
    MouseClick("left", $x, $y)
    Send($btn)
EndFunc

Posted (edited)

HotKeySet("{g}", "MyScript")

Func MyScript()
Send("{p}")
MouseClick("left", 100, 150, 2)
Send("{p}")
 Exit
EndFunc

Edited by =sinister=
Posted

Thanks to the ones who helped me it works now, BUT I would like it to be very rapid speed. Atm it likes run smooth if we say I got the mouse in the lower right corner it runs smooth up to the point where it needs to click. Is there some way to remove this delay so it executes the sequence within a few miliseconds?

This is my current code;

HotKeySet("{END}", "End")
HotKeySet("{DEL}", "Go")

While 1
    Sleep(1)
WEnd

Func End()
    Exit
EndFunc

Func Go()
    Send("P")
    MouseClick("left", 100, 150)
    Send("P")
EndFunc
Posted

change

Func Go()
    Send("P")
    MouseClick("left", 100, 150)
    Send("P")
EndFunc

to

Func Go()
    Send("P")
    MouseClick("left", 100, 150, 0)
    Send("P")
EndFunc

the mouse should move instantaniously now

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
  • Moderators
Posted

Had you bothered looking at MouseClick() in the helpfile?

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

MouseClick("left", 100, 150, 1, 1)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted (edited)

Here is the complete code, give this a spin

Opt("SendKeyDelay", 0)
HotKeySet("{END}", "End")
HotKeySet("{DEL}", "Go")

While 1
    Sleep(1)
WEnd

Func End()
    Exit
EndFunc

Func Go()
    Send("P")
    MouseClick("left", 100, 150, 1, 0)
    Send("P")
EndFunc
Edited by mikeytown2
Posted (edited)

SmOke_N, thanks a TON, you actually helped me this time.

mikeytown2, thanks too! :o

Thanks all, this can be closed now, or whatever you do with topics which is "done". :geek: Thanks again !

Edited by AzGuL^
Posted

Had you bothered looking at MouseClick() in the helpfile?

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

MouseClick("left", 100, 150, 1, 1)

>.< oops, forgot about the clicks param :o

--im an :geek:

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
  • Moderators
Posted

SmOke_N, thanks a TON, you actually helped me this time.

mikeytown2, thanks too! :geek:

Thanks all, this can be closed now, or whatever you do with topics which is "done". ;) Thanks again !

I still want my cheese burger :o

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
  • Recently Browsing   0 members

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