diff --git a/Projects/SMARTLoader/project1.lpi b/Projects/SMARTLoader/project1.lpi new file mode 100644 index 0000000..fcb7cbb --- /dev/null +++ b/Projects/SMARTLoader/project1.lpi @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/SMARTLoader/project1.lpr b/Projects/SMARTLoader/project1.lpr new file mode 100644 index 0000000..eee6b3a --- /dev/null +++ b/Projects/SMARTLoader/project1.lpr @@ -0,0 +1,95 @@ +program project1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, SysUtils, CustApp, + { you can add units after this } + dynlibs; + +const libSmart = 'smart'; + + +procedure std_setup (ServerURL, SecondParam: PChar; sizeX, sizeY: Integer; SomeStr: PChar); cdecl; external libSmart; + + +type + + { TMyApplication } + + TMyApplication = class(TCustomApplication) + protected + procedure DoRun; override; + public + constructor Create(TheOwner: TComponent); override; + destructor Destroy; override; + procedure WriteHelp; virtual; + end; + + +procedure LoadSmart; +begin + std_setup('http://world19.runescape.com/', 'plugin.js?param=o0,a1,m0', 765, 503, 's'); +end; + +{ TMyApplication } + +procedure TMyApplication.DoRun; +var + ErrorMsg: String; +begin + // quick check parameters + ErrorMsg:=CheckOptions('h','help'); + if ErrorMsg<>'' then begin + ShowException(Exception.Create(ErrorMsg)); + Terminate; + Exit; + end; + + // parse parameters + if HasOption('h','help') then begin + WriteHelp; + Terminate; + Exit; + end; + + LoadSmart; + sleep(100000); + + { add your program here } + + // stop program loop + Terminate; +end; + +constructor TMyApplication.Create(TheOwner: TComponent); +begin + inherited Create(TheOwner); + StopOnException:=True; +end; + +destructor TMyApplication.Destroy; +begin + inherited Destroy; +end; + +procedure TMyApplication.WriteHelp; +begin + { add your help code here } + writeln('Usage: ',ExeName,' -h'); +end; + +var + Application: TMyApplication; + +//{$R *.res} + +begin + Application:=TMyApplication.Create(nil); + Application.Run; + Application.Free; +end. +