Log in

View Full Version : Need Help Using APPA



Kerk
10-08-2012, 10:53 PM
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
10-08-2012, 11:46 PM
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
10-09-2012, 01:04 AM
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
10-09-2012, 01:06 AM
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;