Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

Cycle Through Websites

Description
This script will cycle through the list of websites specified in the "websites" array at the top of the script, using the wait time specified in the waitTime variable. It will exit when the Escape key is pressed.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS), Thomas Malloch (BFS)
Contributors
-
Date Created
Mar 31, 2016
Date Last Modified
Mar 31, 2016

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run()
	{
		// Update the websites listed here with your site URLs
		string[] websites = { "https://www.displayfusion.com", "https://www.fileseek.ca", "https://www.voicebot.net" };
		
		// Specify the time in milliseconds to wait before switching to the next website
		uint waitTime = 5000;
		
		// Cycle through the websites until the Escape key is pressed
		while(!BFS.Input.IsKeyDown("27"))
		{
			for (int i = 0; i < websites.Length; i++)
			{
				// Open the website
				IntPtr windowHandle = BFS.Web.OpenUrlNewWindow(websites[i]);
				
				// Wait for the time specified in waitTime, or for the Escape key to be pressed
				for(int count = 0; count < waitTime; count += 100)
				{
					if(BFS.Input.IsKeyDown("27"))
					{
						BFS.Window.Close(windowHandle);
						return;
					}
						
					BFS.General.ThreadWait(100);
				}
					
				// Close the window
				BFS.Window.Close(windowHandle);
			}
		}
	}
}