Jump to content

Script that presses a single key every 5 minutes.


 Share

Recommended Posts

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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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
Link to comment
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.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_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: 22/04/2018

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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