using System;
using System.IO;
using Zennolab.CommandCenter;
namespace BlankTemplate
{
internal class Step1
{
public static int Execute(Instance instance)
{
// Переход на lessons.zennolab.com/en/advanced
Tab tb = instance.MainTab;
if ((tb.IsVoid) || (tb.IsNull)) return -1;
if (tb.IsBusy) tb.WaitDownloading();
tb.Navigate("lessons.zennolab.com/en/advanced");
if (tb.IsBusy) tb.WaitDownloading();
HtmlElement he;
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("email");
if (he.IsVoid) {
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildById("email");
}
if (he.IsVoid) {
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("input:text", "fulltag", "input:text", "text", 2);
}
if (he.IsVoid) return -1;
// Rise macros
he.SetValue(instance.RiseMacros("File.GetString", new [] { "D:\\text.txt", "random", "false" }), true);
return 0;
}
}
}