BazzBarrett
2008-09-10 15:14:55
ill start with a question is the SRL RuneScape based only? if not i would like to suggest this
by using create window you turn:
var
TFN :TForm;
TFNHeight, TFNWidth :Integer;
TFNCaption : String;
TFNEOC : Boolean;
// EndScript(Sender: TObject; var Action: TCloseAction);
// Used in safecreatewindow for ending the scipt if the window is closed
procedure EndScript(Sender: TObject; var Action: TCloseAction);
begin
terminatescript;
end;
// DrawToWindow(BitMap, X, Y :integer);
// easy way of adding a bitmap to the windows canvas.
procedure DrawToWindow(BitMap, X, Y :integer);
begin
safedrawbitmap(BitMap, TFN.Canvas, x, y);
end;
// SafeCreateWindow;
// creates a form with a blank canvas from ur specification
// from the CreateWindow procedure
procedure SafeCreateWindow;
begin
TFN := CreateForm;
TFN.ClientWidth := TFNwidth;
TFN.ClientHeight := TFNheight;
TFN.Caption := TFNCaption;
TFN.Position := poDesktopCenter;
if TFNEOC then TFN.OnClose := @EndScript;
GetSelf.WindowState := wsMinimized;
TFN.Show;
end;
// CreateWindow(Width, Height: Integer; Caption :String; EndOnClose :Boolean);
//
// Width = The width of your window (if smaller than 114 then it will revert to 114)
// Height = The Height of your window (no min)
// Caption = The name of your Window
// EndOnClose = if true then it will end the script when you close the window
//
procedure CreateWindow(Width, Height: Integer; Caption :String; EndOnClose :Boolean);
var
V :TVariantArray;
begin
TFNWidth := Width;
TFNHeight := Height;
TFNCaption := Caption;
TFNEOC := EndOnClose;
ThreadSafeCall('SafeCreateWindow', v);
end;by using create window you turn:
program New;
var
GW :TForm;
V :TVariantArray;
procedure EndScript(Sender: TObject; var Action: TCloseAction);
begin
terminatescript;
end;
procedure setup;
begin
GW := CreateForm;
GW.ClientHeight := 300;
GW.ClientWidth := 300;
GW.Caption := 'A Window!';
GW.Position := poDesktopCenter;
GW.OnClose := @EndScript;
GetSelf.WindowState := wsMinimized;
GW.Show;
end;
begin
ThreadSafeCall('Setup', v);
end.into:program New;
{.include SRL/misc/Window.scar}
begin
createwindow(300, 300, 'A Window!', True);
end.
thx for ya time ;)