SRL Archive - Help

Need Help Using APPA


Kerk

2012-10-08 18:53:45

I've made a few scripts for private servers and I have no way of running them without the script using my mouse. I searched through the forums and came across APPA. Unfortunately I have no idea how to work this, so if someone could help me that would be great.

Le Jingle

2012-10-08 19:46:42

You place the dll into your plugins folder and import it into your simba script.
When I started typing a short sample code, I remembered Home made a nice include for scar (which should need little to no edits for simba), which this example originates from:


{$i SRL/srl.simba}
{$loadlib Appa_Simba}
begin
appa_ShowForm; //Show the form
appa_NavigateTo('', 10000); //Wait until it's fully loaded
appa_NavigateTo('http://www.google.com', 10000); //Navigate
end.

Kerk

2012-10-08 21:04:05

I always get "Invalid number of parameters" at
appa_Navigate('', 10000); //Wait until it's fully loaded
appa_Navigate('http://www.google.com', 10000); //Navigate

Le Jingle

2012-10-08 21:06:27

From: Kerk
I always get "Invalid number of parameters" at
appa_Navigate('', 10000); //Wait until it's fully loaded
appa_Navigate('http://www.google.com', 10000); //Navigate


Oops, that's because it's not in the dll, try searching for Home's include.

Here's the snippet that makes appa_Navigate() work;

function appa_NavigateTo(URL: string; TimeOut: Integer): Boolean;
var
t: Integer;
begin
Result := False;
if (not appa_Showing) then
Exit;

if (URL <> '') then
appa_Navigate(URL);
t := GetSystemTime + TimeOut;
while (not appa_PageLoaded) and appa_Showing and (GetSystemTime < t) do
Wait(250);

Result := appa_PageState >= 3;
end;