Jump to content

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

Can't seem to get a simple pause hotkey to work


  • Please log in to reply
1 reply to this topic
dimmer
  • Members
  • 1 posts
  • Last active: Oct 26 2015 09:54 PM
  • Joined: 25 Oct 2015

If I add a general pause hotkey like v::Pause the code will either just not do anything at all (doesn't error just does nothing) or it will work like normal but the pause won't work. I'm pretty new to this so it's probably something really stupid I'm not noticing. Btw I know I used ifwinactive like 4 too many times but I really just don't want the script to hit f keys in other windows if I tab over in the middle of a sleep or something. Works flawlessly other than pausing.

#IfWinActive, ahk_class "D3 Main Window Class"
CoordMode, Pixel

loop
{
if WinActive("ahk_class D3 Main Window Class") 
	{
	if (GetKeyState("XButton1", "P"))
		{
		sleep 10000
		}

		PixelGetColor, color, 466, 715
		PixelGetColor, color2, 606, 715
	
		if (color=0x9C6900)
		{
			if (GetKeyState("XButton1", "P"))
			{
			sleep 10000
			}
	
			else
			{
			if WinActive("ahk_class D3 Main Window Class") 
				{
				sleep 180
				if WinActive("ahk_class D3 Main Window Class")
					{
					send {f11}
					}
				}
			}
		}
		else if (color2=0x101018)
		{
			if (GetKeyState("XButton1", "P"))
			{
			sleep 10000
			}
	
			else
			{
			if WinActive("ahk_class D3 Main Window Class") 
				{
				sleep 180
				if WinActive("ahk_class D3 Main Window Class")
					{
					send {f10}
					}
				}
			}
		}
		else
		{
		sleep 200
		}
	
	}
	
}


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

Try using like this:

v::Pause,1

Pause