Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Terrible at scripting, trying to run a loop that will press enter every few seconds


  • Please log in to reply
4 replies to this topic
Untixx
  • Members
  • 2 posts
  • Last active: Oct 27 2015 03:16 AM
  • Joined: 17 Oct 2015

I'm terrible at this, and I'm trying to run a loop that will press enter every few seconds to a pokemon game that I downloaded. My script should work, but it doesn't go through to the game. Anything wrong with this script that I'm just not seeing?

 

#z::
WinActivate, Pokemon Rejuvenation
Loop
{
SendEvent, c
Sleep, 10
if stop
{
Break
}
if pause {
Loop
{
If pause!=1
Break
Sleep,319
}
}
ToolTip, %A_Index% 
Sleep, 119
}
return
q::stop = 1
p::pause:=!pause


Xtra
  • Members
  • 954 posts
  • Last active: Jul 23 2016 09:04 PM
  • Joined: 29 Sep 2013

There is no enter in your script?

 

Your loop sends the c key, displays a tooltip, and sleeps.



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

Also, your script will only activate the Pokemon window once, when it first starts.  If you change to another window, the keys will be sent to the new window.



Untixx
  • Members
  • 2 posts
  • Last active: Oct 27 2015 03:16 AM
  • Joined: 17 Oct 2015

How would I make the script work multiple times?



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

How would I make the script work multiple times?

 Easiest way would be to put the WinActivate command inside the loop.