Sign in to follow this  
Followers 0
ZenMastah

[REQUEST] - Timed Key Presses

6 posts in this topic

Hi,

Good morning, good after and good night, I would appreciate it if someone could give me a crash course(tutorial) on how to make a script that presses keys on a timer and then releases that key and presses another and then a timer that waits to press another key and so forth.

Example:

start script

w key gets pressed for 25 seconds

w key gets released after 25 seconds

once w key is released after 25 seconds the u key gets pressed for 1 second

after u is pressed for 1 second the number 1 key gets pressed for 0.5 seconds

after the number 1 key gets pressed for 0.5 seconds timer starts and waits 25 seconds

after 25 seconds the whole process starts again but this time instead of w being pressed, the letter s is pressed instead

I have another program that can create it but for some reason it wont run on this PC, only on my other PC. I can open it but it goes invisible once it opens. That creates the script I am after like so below

*w,25000,-w,*u,1000,-u,25000

*s,25000,-s,*u,1000,-u,25000

I need a script that runs on an AutoIt script that does the same thing as the program i mentioned above does but I would also like to know if I can assign the script to a specific window so i can continue browsing the web while the script does its own thing in the background.

Can someone please help me out,

Thank you in advance :)

Share this post


Link to post
Share on other sites



Hi, ZenMastah. Just out of curiosity, what application are you trying to interact with? There are quite often easier ways of doing what you want, with ControlSend or some other function, depending on the program itself.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Agreed with JLogan3o13, but an easy way to do so, would be to create a 2d array, with the miliseconds to press, and key to press. Then loop through it.

in the loop you can modify:AutoItSetOption() to set the array value for milliseconds to press (no need to release) SendKeyDownDelay Alters the length of time a key is held down before being released during a keystroke. For applications that take a while to register keypresses you may need to raise this value from the default. A value of 0 removes the delay completely.

Time in milliseconds to pause (default=5).


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi, ZenMastah. Just out of curiosity, what application are you trying to interact with? There are quite often easier ways of doing what you want, with ControlSend or some other function, depending on the program itself.

The progam is actually a game called dekaron and I need a script to work with it. All i need is a script like what i described in my first post

w gets pressed for 25000ms

after the 25000ms U gets pressed

after U is pressed the number 1 above the Q button gets pressed

after the Number 1 button gets pressed a timer waits 25000ms

after the 25000ms S gets pressed for 25000ms

after the 25ms U gets pressed

after U is pressed the number 1 above the Q button gets pressed

after the Number 1 button gets pressed a timer waits 25000ms

then after the 2nd 25000ms timer it starts all over again in a loop.

This script in the game makes me run up using w for 25 seconds, selects a monster, attacks it with number 1, waits 25 seconds then makes me run back down using S for 25 seconds returning back tot he same spot I started pressing W at and selecting a monster and attacking it with number 1 again. Then that gets looped continuosly until I stop the script.

But i also need it to be assinged to the window/process so i can continue with my work so it runs in the background wihtout affecting my work.

Edited by ZenMastah

Share this post


Link to post
Share on other sites

The progam is actually a game called dekaron and I need a script to work with it.

You don't seem to have learned much since Melba locked your last post about this game. Game automation is not allowed on this forum, and you are not going to receive any help.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

ZenMastah,

You have only started 2 threads - both have been about game automation. If you continue in this vein you will not have a long stay here. I suggest you take the next 3 days to read the Forum Rules and follow them in future. :naughty:

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
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0