Calling execution of procedures in another script using Entry \ OnEntry

You can create an OnEntry procedure in one script that can be called from another script.

// Account 1
function OnEntry(var X: Integer): Boolean;
begin
  print('Call from another script, increase X');
  inc(X);
  Result:= True;
end;

begin
  Delay(-1);
end.


// Account 2
var
  X: Integer;
  Obj: TBot;

begin
  if BotList.ByName('Account name 1', Obj) then begin   // if found account
    X:= 5;                    // assign an initial value of X
    Print(Obj.UserName);      // print his name
    Obj.Control.Entry(X);     // call the OnEntry event on account 1
    Print(X);                 // print the new value of X
  end; 
end.