1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-27 19:42:22 -05:00

Some minor changes.. Revert if you dislike.

This commit is contained in:
Raymond 2011-02-08 16:20:28 +01:00
parent 981ec3760a
commit 34cf62b181
4 changed files with 17 additions and 31 deletions

View File

@ -170,21 +170,7 @@ end;
procedure ext_OpenScriptEx(FileName: string; Run: boolean); procedure ext_OpenScriptEx(FileName: string; Run: boolean);
begin begin
FileName := SetDirSeparators(FileName); FileName := SetDirSeparators(FileName);
with SimbaForm do SimbaForm.LoadScriptFile(FileName,True,false);
begin
AddTab();
with CurrScript do
begin
SynEdit.Lines.LoadFromFile(FileName);
StartText := SynEdit.Lines.Text;
ScriptName := ExtractFileNameOnly(FileName);
ScriptFile := FileName;
ScriptChanged := False;
end;
RefreshTab();
UpdateTitle();
end;
if (Run) then if (Run) then
SimbaForm.RunScript(); SimbaForm.RunScript();
end; end;

View File

@ -107,6 +107,16 @@ begin
Result:=Random(Abs(aFrom-aTo))+Min(aTo,AFrom); Result:=Random(Abs(aFrom-aTo))+Min(aTo,AFrom);
end; end;
function ps_Random(Int: integer): integer; extdecl;
begin
result := Random(int);
end;
function ps_RandomE : extended;
begin
result := Random;
end;
function ps_ArcTan2(y,x : extended) : extended; extdecl; function ps_ArcTan2(y,x : extended) : extended; extdecl;
begin begin
result := ArcTan2(y,x); result := ArcTan2(y,x);

View File

@ -37,21 +37,15 @@ begin;
end; end;
{$ENDIF} {$ENDIF}
procedure ps_Wait(t: Integer); extdecl; procedure ps_Wait(t: DWord); extdecl;
{$ifdef MSWINDOWS} {$ifdef MSWINDOWS}
begin begin
if t < 0 then Sleep(t);
raise Exception.CreateFmt('The given wait time ([%d]) is invalid.',[t])
else
Sleep(t);
end; end;
{$else} {$else}
var var
EndTime : DWord; EndTime : DWord;
begin begin
if t < 0 then
raise Exception.CreateFmt('The given wait time ([%d]) is invalid.',[t]);
if t > 50 then if t > 50 then
begin; begin;
EndTime := GetTickCount + t; EndTime := GetTickCount + t;
@ -266,11 +260,6 @@ begin
'+//1sR/NLyhCQ=='))); '+//1sR/NLyhCQ==')));
end; end;
function ps_Random(Int: integer): integer; extdecl;
begin
result := Random(int);
end;
procedure ps_SetClipBoard(const Data: string); extdecl; procedure ps_SetClipBoard(const Data: string); extdecl;
begin begin
try try

View File

@ -76,6 +76,8 @@ AddFunction(@ps_point,'function Point(x,y:integer) : TPoint;');
AddFunction(@ps_Distance,'function Distance(xs,ys,xe,ye : integer) : integer;'); AddFunction(@ps_Distance,'function Distance(xs,ys,xe,ye : integer) : integer;');
AddFunction(@ps_hypot,'function Hypot(X, Y: Extended): Extended;'); AddFunction(@ps_hypot,'function Hypot(X, Y: Extended): Extended;');
AddFunction(@ps_RandomRange,'function RandomRange(aFrom,aTo: Integer): Integer;'); AddFunction(@ps_RandomRange,'function RandomRange(aFrom,aTo: Integer): Integer;');
AddFunction(@ps_Random,'function Random(Int: integer): integer;');
AddFunction(@ps_RandomE,'function RandomE: extended;');
AddFunction(@ps_incex,'procedure IncEx(var x : integer; increase : integer);'); AddFunction(@ps_incex,'procedure IncEx(var x : integer; increase : integer);');
AddFunction(@ps_DecEx,'procedure DecEx(var x : integer; Decrease : integer);'); AddFunction(@ps_DecEx,'procedure DecEx(var x : integer; Decrease : integer);');
AddFunction(@ps_BinCoe,'function BinCoe(a, b: LongInt): Extended;'); AddFunction(@ps_BinCoe,'function BinCoe(a, b: LongInt): Extended;');
@ -160,8 +162,8 @@ AddFunction(@ps_ExtractFileExt,'function ExtractFileExt(const FileName: string):
{other} {other}
SetCurrSection('Other'); SetCurrSection('Other');
AddFunction(@ps_Wait, 'procedure wait(t: integer);'); AddFunction(@ps_Wait, 'procedure wait(t: LongWord);');
AddFunction(@ps_Wait, 'procedure Sleep(t: integer);'); AddFunction(@ps_Wait, 'procedure Sleep(t: LongWord);');
{$IFNDEF MML_EXPORT_THREADSAFE} {$IFNDEF MML_EXPORT_THREADSAFE}
AddFunction(@ps_GetTClient,'function GetTClient : TClient;'); AddFunction(@ps_GetTClient,'function GetTClient : TClient;');
AddFunction(@ps_SetSupressExceptions, 'procedure SetSupressExceptions(Supress : boolean);'); AddFunction(@ps_SetSupressExceptions, 'procedure SetSupressExceptions(Supress : boolean);');
@ -180,7 +182,6 @@ AddFunction(@ps_DecodeDate,'procedure DecodeDate ( const SourceDate : TDateTime
AddFunction(@ps_ConvertTime,'procedure ConvertTime(Time: integer; var h, m, s: integer);'); AddFunction(@ps_ConvertTime,'procedure ConvertTime(Time: integer; var h, m, s: integer);');
AddFunction(@ps_HakunaMatata,'procedure HakunaMatata;'); AddFunction(@ps_HakunaMatata,'procedure HakunaMatata;');
AddFunction(@ps_Simba,'procedure Simba;'); AddFunction(@ps_Simba,'procedure Simba;');
AddFunction(@ps_Random,'function Random(Int: integer): integer;');
AddFunction(@ps_PlaySound,'procedure PlaySound( Sound : string);'); AddFunction(@ps_PlaySound,'procedure PlaySound( Sound : string);');
AddFunction(@ps_StopSound,'procedure StopSound;'); AddFunction(@ps_StopSound,'procedure StopSound;');
{$IFNDEF MML_EXPORT_THREADSAFE} {$IFNDEF MML_EXPORT_THREADSAFE}