Sign in to follow this  
Followers 0
LoganWitt

Script that presses a single key every 5 minutes.

11 posts in this topic

As the title says, it probably sounds extremely simple to all of you super techies, but allow me to say this first. I'm no computer whiz. I just like playing games, although I don't have much time for it. (Which is why I'm looking into making this).

I'd really like some help, and if someone does just outright do the 5 seconds of work I'm sure you guys could do this in (which would take me like 5 days to even begin to attempt) that would be great, but I would also appreciate a more human like walkthrough in making something simple such as this. I did read a good deal of the helpfile, but a lot of it I just didn't understand. I don't know any "languages" or any fancy computer stuff. I'm a complete newbie.

I've even tried making a script that just changes windows to the window I want the key pressed on, but for some reason when I ran it as a script nothing happened :/ not sure what I did wrong.

Anyways here's the details on the script : I want it to of course swap to the window so the key pressing works on that window, then I want it to press a single keyboard key once every 5 minutes and 30 seconds. (I'll probably be at work, class, or sleeping while this is happening).

That's it. So yeah, it sounds super easy, but I can't find anything to do it for me, nor can I make it.

Really appreciate any help the nice people of this community could give to me :) Thanks!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

As the title says, it probably sounds extremely simple to all of you super techies, but allow me to say this first. I'm no computer whiz. I just like playing games, although I don't have much time for it. (Which is why I'm looking into making this).

I'd really like some help, and if someone does just outright do the 5 seconds of work I'm sure you guys could do this in (which would take me like 5 days to even begin to attempt) that would be great, but I would also appreciate a more human like walkthrough in making something simple such as this. I did read a good deal of the helpfile, but a lot of it I just didn't understand. I don't know any "languages" or any fancy computer stuff. I'm a complete newbie.

I've even tried making a script that just changes windows to the window I want the key pressed on, but for some reason when I ran it as a script nothing happened :/ not sure what I did wrong.

Anyways here's the details on the script : I want it to of course swap to the window so the key pressing works on that window, then I want it to press a single keyboard key once every 5 minutes and 30 seconds. (I'll probably be at work, class, or sleeping while this is happening).

That's it. So yeah, it sounds super easy, but I can't find anything to do it for me, nor can I make it.

Really appreciate any help the nice people of this community could give to me :) Thanks!

while 1

sleep (330000)

winactivate ("title of window")

send ("key here")

wend

like that or something?

why don't you post the script that you have...

Edited by tp9191

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Now I know what winactive and send do, but what are the while 1 and sleep 330k and wend for?

So far I just have

WinActivate ( "title" )

Not sure where to go from there, but once I understand the above question I think I can finish it :)

Edited by LoganWitt

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

while 1 and wend are to loop the script so that it repeats.

while 1 is at the beginning of what you want to loop.

wend stands for while end, obviously it is where you want the script to stop looping.

sleep pauses the script. in your case you want it to pause for 5 minutes and 30 seconds. you need to convert that to milliseconds... so that comes out to 330000.

i'm also somewhat a newbie so i'm not sure if you can just use minutes/seconds form instead of milliseconds for sleep.

Edited by tp9191

Share this post


Link to post
Share on other sites

for winactivate use the au3 info tool to get the window title. also i suggest reading the help file under winactivate.

Share this post


Link to post
Share on other sites

Please make sure to read the forum rules and you will learn that any kind of game automation isn't allowed here.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Ooh, you're obviously smarter than me since you've already figured all this out!

Thanks for the tips, I'll give it a try with the lines you gave me and see if I can get it working.

How would I send just a single letter? Is there a code for it? I couldn't find that in the help file.

Also sorry Water, didn't know that. D: Can't really edit it now to say something else though.

Edited by LoganWitt

Share this post


Link to post
Share on other sites

if you are trying to automate a game, then bad bad bad. :o and i can't help you any further.

Share this post


Link to post
Share on other sites

Ah darn, I'm sure others are here doing the same :P they were just smarter in how they worded their post xD

Share this post


Link to post
Share on other sites

Ah darn, I'm sure others are here doing the same :P they were just smarter in how they worded their post xD

I doubt it. The truth always comes out in the end via posting code.

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

LoganWitt,

I'm sure others are here doing the same they were just smarter in how they worded their post

Probably an accurate assessment - but as you have essentially admitted the offence...... :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