Script error "An error has occured in the script on this page"

Get help with using AutoHotkey and its commands and hotkeys
Zeleene
Posts: 1
Joined: 11 Nov 2019, 03:39

Script error "An error has occured in the script on this page"

11 Nov 2019, 03:47

Hello,

I get the following error suddenly after having run the same script for months.
I made a script that makes a window, goes to a stocks page and auto-refreshes every hour. Helps me keep track of my stocks. (Code below)

How can I make this error disappear or suppress it? Right now it comes up every hour and the script pauses until I press (Yes/No) manually.

https://imgshare.io/image/x1kjc


Code: Select all

#NoTrayIcon
#ErrorStdOut

Gui, Starbreeze:Add, ActiveX, w490 h50 vStarbreeze, Shell.Explorer
Gui, Starbreeze:-SysMenu
Gui, Starbreeze:+Owner
Gui Starbreeze:Show, x-1922 y0 NoActivate, Starbreeze B: 1.68

; -------------------------------------------------------------------------------------

While(TimeFunc())
{
	Process, Exist, wow.exe
	wow = %ErrorLevel%
	Process, Exist, PathOfExile_x64.exe
	poe = %ErrorLevel%
	Process, Exist, TslGame.exe
	pubg = %ErrorLevel%
	Process, Exist, SC2_x64.exe
	sc = %ErrorLevel%

	if wow+poe+pubg+sc = 0
	{
		Starbreeze.Navigate("https www.avanza.se /aktier/om-aktien.html/5528/starbreeze-b")  Broken Link for safety
		
		
		Sleep 3000
		Stfound=0
	
		Loop 7
		{
		ControlSend,, {Space}, Starbreeze
		sleep 10
		}

		Loop 60
		{
			if Stfound=0
			{
				CoordMode Pixel
				ImageSearch, StarbreezeX, StarbreezeY, -1922, 0, -1372, 75, *20 Aktier.bmp
				if ErrorLevel = 1
				{
					ControlSend,, {Down}, Starbreeze
					sleep 10
				}
				else
				{
					Stfound=1
					Loop 6
					{
						ControlSend,, {Down}, Starbreeze
					}					
				}
			}
					}
		Sleep 3600000
	}
	else
	{
	Sleep 3600000
	}
}
while (!TimeFunc())
{
	sleep 3600000
	if (TimeFunc())
	{
		Gui, Starbreeze:Destroy
		Gui, Ericsson:Destroy
		Sleep 5000
		reload
	}
}

return


TimeFunc()
{
	FormatTime,x,, HH
	FormatTime,y,, ddd
	if x between 9 and 18
		xx := 1
	else
		xx := 0
	if (y = "lör") or (y = "sön")
		yy := 0
	else
		yy := 1
	if (xx + yy = 2)
	return True
	else
	return False
}

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boiler, Google [Bot], ImNewAtThis, panhartstuff, Rohwedder, theskyishigh and 183 guests