[INTERFACE]
DIALOG, "Диалог", 600, 152;
STATIC, "Порядковый номер выполнения команды в JavaScript (начинается с 0)", 4, 4, 368, 20;
EDIT, 376, 4, 216, 20, int Num;
STATIC, "Вывести текст", 4, 28, 80, 20;
EDIT, 88, 28, 504, 20, string Mes;
STATIC, "Перейти на порядковый номер команды (при отсутствие параметра перейдет на следующий)", 4, 52, 488, 20;
EDIT, 492, 52, 100, 20, unknown GOTO_Y;
STATIC, "Комментарий", 4, 76, 76, 20;
EDIT, 84, 76, 508, 20, unknown Comment;
BUTTON_OK, "Принять", 384, 104, 100, 20;
BUTTON_CANCEL, "Закрыть", 492, 104, 100, 20;
[END]

[APPEARANCE]
COLOR = 100, 100, 100;
SIZE_X = 12;
SIZE_Y =6;
[END]


[INFO]
>>" ">>Num>>[ENDL]>>Mes>>[ENDL]>>"Перейти на ">>GOTO_Y>>[ENDL]>>Comment
[END]


[ASSOC_VAR]
Num=0;
Mes="Текст или имя переменной без кавычек";
v_Mes_v=W#@22@##%~%34~~Mes~~%34~A@@&%W;
GOTO_Y=;
Comment=;
V_Comment=~%34~~Comment~~%34~;
V_GOTO_Y=~%34~~GOTO_Y~~%34~;
[END]

[REGEXPLACE_CODE]
A@@&%W=;
W#@22@##%=;
~%34~~%34~A@@&%W=~%94~~%34~~%34~A@@&%W;
W#@22@##%~%34~~%34~=W#@22@##%~%34~~%94~~%34~;
[END]

[GLOBAL_VAR]
string Script_JS="";
string Global_Var_B_JS = "";
string Global_Var_C_JS = "";
string Send_Global_Var_JS="";
string Call_Get_Fun_JS="";
string Get_Global_Var_JS="";
string Send_Back_Global_Var_JS = "";
string Get_Back_Global_Var_JS = "";
string All_Call_Send="";
[END]


[FUNCTION_BODY]
function(int nom, string vp, string komment, string goto_y)
{
Script_JS=Script_JS+"if (st=="+format(nom+1)+")/^/"+komment+"^r^n { ^r^n";
Script_JS=Script_JS+"var_input.value = ^""+komment+"^";^r^n";
Script_JS=Script_JS+"alert("+vp+");^r^n";
if (goto_y=="") Script_JS=Script_JS+"st=st+1; addNum(); T_Pz=Date.now(); Pz=1; addPz(); wai=Date.now(); addWai(); T=0; All_Call_Send(); return; ^r^n";
else Script_JS=Script_JS+"st=" + format(formatsn(goto_y)+1) + "; addNum(); T_Pz=Date.now(); Pz=1; addPz(); wai=Date.now(); addWai(); T=0; All_Call_Send(); return;^r^n";
Script_JS=Script_JS+" } ^r^n";
string t, var;
var=vp;
  if (regexsearch(1, #t, var, "^"")==0)
  {
    if (regexsearch(1, #t, Global_Var_C_JS, "( "+var+" | "+var+"=| "+var+";)")==0)
    {
    Global_Var_C_JS=Global_Var_C_JS+"var "+var+";^r^n";
    Global_Var_B_JS=Global_Var_B_JS+"var "+var+";^r^n";
    Send_Global_Var_JS=Send_Global_Var_JS+"function Send"+var+"()^r^n{chrome.runtime.sendMessage({T"+var+":"+var+"}, function(response) {var tst=response.farewell;});}^r^n";
    Call_Get_Fun_JS=Call_Get_Fun_JS+"Get"+var+"();^r^n";
    Get_Global_Var_JS=Get_Global_Var_JS+"function Get"+var+"()^r^n{chrome.runtime.sendMessage({greeting:^"GlobalVar_"+var+"^"},function(response){"+var+"=response.farewell;});}^r^n";
    Get_Back_Global_Var_JS=Get_Back_Global_Var_JS+"if (request.greeting==^"GlobalVar_"+var+"^"){sendResponse({farewell:"+var+"});S=1;}^r^n";
    Send_Back_Global_Var_JS=Send_Back_Global_Var_JS+"if (request.T"+var+"){"+var+"=request.T"+var+";}^r^n";
    All_Call_Send=All_Call_Send+"Send"+var+"();^r^n";
    }
  }
}
[END]

[CALL]
(Num, v_Mes_v, V_Comment, V_GOTO_Y)
[END]

