Sign in to follow this  
Followers 0
AzGuL^

Need a script

16 posts in this topic

#1 ·  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^

Share this post


Link to post
Share on other sites



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!

Share this post


Link to post
Share on other sites

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?

[center]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.[/center]

Share this post


Link to post
Share on other sites

#4 ·  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^

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

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

Edited by =sinister=

Share this post


Link to post
Share on other sites

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

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

I was going to say I wanted $10,000,000.00 but would settle for $1,000,000.00


SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Nothing happens now :-/

Share this post


Link to post
Share on other sites

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

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

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

#12 ·  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

Share this post


Link to post
Share on other sites

#13 ·  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^

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I still want my cheese burger :o

I will buy you one WHEN i get my $10.00 for helping that other newbie

lol

8)

Edited by Valuater

NEWHeader1.png

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