mirror of
https://github.com/moparisthebest/Simba
synced 2024-08-13 16:53:59 -04:00
Merge branch 'master' of ssh://villavu.com:54367/simba
This commit is contained in:
commit
6b34a9d108
@ -702,7 +702,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
mdtm := SDTMToMDTM(toSDTM);
|
mdtm := SDTMToMDTM(toSDTM);
|
||||||
WriteLn('');
|
WriteLn('');
|
||||||
WriteLn(mdtm.ToString);
|
WriteLn('DTM := DTMFromString(''' + mdtm.ToString + ''');');
|
||||||
WriteLn('');
|
WriteLn('');
|
||||||
mdtm.Free;
|
mdtm.Free;
|
||||||
end;
|
end;
|
||||||
|
@ -38,10 +38,10 @@ var
|
|||||||
DeContents : string;
|
DeContents : string;
|
||||||
Failed : boolean;
|
Failed : boolean;
|
||||||
begin
|
begin
|
||||||
Memo.Lines.Add('Downloading Reflection...');
|
Memo.Lines.Add('Downloading Reflection...');
|
||||||
Contents := GetPage('http://wizzup.org/static/srl/srlref.tar.bz2');
|
Contents := GetPage('http://wizzup.org/static/srl/srlref.tar.bz2');
|
||||||
Failed := True;
|
Failed := True;
|
||||||
Memo.Lines.Add('Uncompressing Reflection...');
|
Memo.Lines.Add('Uncompressing Reflection...');
|
||||||
if DecompressBZip2(Contents,DeContents,4096) then
|
if DecompressBZip2(Contents,DeContents,4096) then
|
||||||
if UnTarEx(DeContents,IncludePath,true) then
|
if UnTarEx(DeContents,IncludePath,true) then
|
||||||
Failed := False;
|
Failed := False;
|
||||||
@ -77,9 +77,6 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
Updating := True;
|
Updating := True;
|
||||||
|
|
||||||
GetLocalVersion(LocalR);
|
|
||||||
GetOnlineVersion(OnlineR);
|
|
||||||
|
|
||||||
if (LocalR < OnlineR) then
|
if (LocalR < OnlineR) then
|
||||||
begin
|
begin
|
||||||
case MessageDlg('Reflection Updater', 'Updates are available. '+
|
case MessageDlg('Reflection Updater', 'Updates are available. '+
|
||||||
@ -98,7 +95,6 @@ begin
|
|||||||
f.ShowModal;
|
f.ShowModal;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
MessageDlg('Reflection Updater', 'No Reflection update' ,mtConfirmation, [mbYes],0);
|
|
||||||
writeln('No Reflection update');
|
writeln('No Reflection update');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -132,12 +128,20 @@ end;
|
|||||||
|
|
||||||
procedure OnReflectionUpdateClick(Sender: TObject);
|
procedure OnReflectionUpdateClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Update;
|
GetLocalVersion(LocalR);
|
||||||
|
GetOnlineVersion(OnlineR);
|
||||||
|
|
||||||
|
if (OnlineR <= LocalR) then
|
||||||
|
MessageDlg('Reflection Updater', 'No Reflection update' ,mtConfirmation, [mbYes],0)
|
||||||
|
else
|
||||||
|
Update;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure OnUpdateTimer(Sender: TObject);
|
procedure OnUpdateTimer(Sender: TObject);
|
||||||
begin;
|
begin;
|
||||||
Timer.Interval := 30 * 60 * 1000; //Every half hour
|
Timer.Interval := 30 * 60 * 1000; //Every half hour
|
||||||
|
GetLocalVersion(LocalR);
|
||||||
|
GetOnlineVersion(OnlineR);
|
||||||
Update;
|
Update;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
1446
Extensions/security.sex
Normal file
1446
Extensions/security.sex
Normal file
File diff suppressed because it is too large
Load Diff
@ -65,15 +65,15 @@ begin
|
|||||||
Failed := not UnTarEx(DeContents,PluginPath,false);
|
Failed := not UnTarEx(DeContents,PluginPath,false);
|
||||||
end;
|
end;
|
||||||
if Failed then
|
if Failed then
|
||||||
begin
|
begin
|
||||||
Writeln('Failed to update the plugins');
|
Writeln('Failed to update the plugins');
|
||||||
Memo.Lines.Add('Failed to update the plugins');
|
Memo.Lines.Add('Failed to update the plugins');
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Writeln('Succesfully updated your plugins.');
|
Writeln('Succesfully updated your plugins.');
|
||||||
Memo.Lines.Add('Succesfully updated your plugins.');
|
Memo.Lines.Add('Succesfully updated your plugins.');
|
||||||
end;
|
end;
|
||||||
DeContents := '';
|
DeContents := '';
|
||||||
Contents := '';
|
Contents := '';
|
||||||
Result := Failed;
|
Result := Failed;
|
||||||
@ -87,10 +87,10 @@ var
|
|||||||
DeContents : string;
|
DeContents : string;
|
||||||
Failed : boolean;
|
Failed : boolean;
|
||||||
begin
|
begin
|
||||||
Memo.Lines.Add('Downloading SRL...');
|
Memo.Lines.Add('Downloading SRL...');
|
||||||
Contents := GetPage('http://wizzup.org/static/srl/srl.tar.bz2');
|
Contents := GetPage('http://wizzup.org/static/srl/srl.tar.bz2');
|
||||||
Failed := True;
|
Failed := True;
|
||||||
Memo.Lines.Add('Uncompressing SRL...');
|
Memo.Lines.Add('Uncompressing SRL...');
|
||||||
if DecompressBZip2(Contents,DeContents,4096) then
|
if DecompressBZip2(Contents,DeContents,4096) then
|
||||||
if UnTarEx(DeContents,IncludePath,true) then
|
if UnTarEx(DeContents,IncludePath,true) then
|
||||||
Failed := False;
|
Failed := False;
|
||||||
@ -99,10 +99,10 @@ begin
|
|||||||
if Result then
|
if Result then
|
||||||
Result := Failed;
|
Result := Failed;
|
||||||
if not Failed then
|
if not Failed then
|
||||||
begin
|
begin
|
||||||
Memo.Lines.Add('Succesfully updated your SRL!');
|
Memo.Lines.Add('Succesfully updated your SRL!');
|
||||||
Writeln('Succesfully updated your SRL!');
|
Writeln('Succesfully updated your SRL!');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DoUpdate(Sender: TObject);
|
procedure DoUpdate(Sender: TObject);
|
||||||
@ -132,18 +132,16 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
Updating := True;
|
Updating := True;
|
||||||
|
|
||||||
GetLocalVersion(LocalP,LocalS);
|
|
||||||
GetOnlineVersion(OnlineP,OnlineS);
|
|
||||||
|
|
||||||
if (LocalP < OnlineP) or (LocalS < OnlineS) then
|
if (LocalP < OnlineP) or (LocalS < OnlineS) then
|
||||||
begin
|
begin
|
||||||
case MessageDlg('SRL Updater', 'Updates are available. '+
|
case MessageDlg('SRL Updater', 'Updates are available. '+
|
||||||
'Do you want to open the Updater now?',
|
'Do you want to open the Updater now?',
|
||||||
mtConfirmation, [mbNo,mbYes],0) of
|
mtConfirmation, [mbNo,mbYes],0) of
|
||||||
mrYes : OpenForm := True;
|
mrYes : OpenForm := True;
|
||||||
else
|
else
|
||||||
OpenForm := False;
|
OpenForm := False;
|
||||||
end;
|
end;
|
||||||
if not OpenForm then
|
if not OpenForm then
|
||||||
begin
|
begin
|
||||||
Updating := False;
|
Updating := False;
|
||||||
@ -153,7 +151,6 @@ begin
|
|||||||
f.ShowModal;
|
f.ShowModal;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
MessageDlg('SRL Updater', 'No SRL update / Plugins update available!' ,mtConfirmation, [mbYes],0);
|
|
||||||
writeln('No SRL update / Plugins update available!');
|
writeln('No SRL update / Plugins update available!');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -183,14 +180,22 @@ begin
|
|||||||
else
|
else
|
||||||
Settings.SetKeyValue('AutoUpdate', 'True');
|
Settings.SetKeyValue('AutoUpdate', 'True');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure OnSRLUpdateClick(Sender: TObject);
|
procedure OnSRLUpdateClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Update;
|
GetLocalVersion(LocalP,LocalS);
|
||||||
|
GetOnlineVersion(OnlineP,OnlineS);
|
||||||
|
if (OnlineP <= LocalP) and (OnlineS <= LocalS) then
|
||||||
|
MessageDlg('SRL Updater', 'No SRL update / Plugins update available!', mtConfirmation, [mbYes], 0)
|
||||||
|
else
|
||||||
|
Update;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure OnUpdateTimer(Sender: TObject);
|
procedure OnUpdateTimer(Sender: TObject);
|
||||||
begin;
|
begin;
|
||||||
Timer.Interval := 30 * 60 * 1000; //Every half hour
|
Timer.Interval := 30 * 60 * 1000; //Every half hour
|
||||||
|
GetLocalVersion(LocalP,LocalS);
|
||||||
|
GetOnlineVersion(OnlineP,OnlineS);
|
||||||
Update;
|
Update;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -289,4 +294,4 @@ begin;
|
|||||||
result := '1.0';
|
result := '1.0';
|
||||||
end;
|
end;
|
||||||
begin
|
begin
|
||||||
end.
|
end.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||||
AppId={{524C9B9A-B57F-4FEC-89BE-292202EBA44D}
|
AppId={{524C9B9A-B57F-4FEC-89BE-292202EBA44D}
|
||||||
AppName=Simba
|
AppName=Simba
|
||||||
AppVerName=Simba Release Candidate
|
AppVerName=Simba Release Candidate 2
|
||||||
AppPublisherURL=http://simba.villavu.com/
|
AppPublisherURL=http://simba.villavu.com/
|
||||||
AppSupportURL=http://simba.villavu.com/
|
AppSupportURL=http://simba.villavu.com/
|
||||||
AppUpdatesURL=http://simba.villavu.com/
|
AppUpdatesURL=http://simba.villavu.com/
|
||||||
@ -38,6 +38,7 @@ Source: "C:\Simba\Extensions\srl.sex"; DestDir: "{app}\Extensions"; Flags: ignor
|
|||||||
Source: "C:\Simba\Extensions\associate.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion
|
Source: "C:\Simba\Extensions\associate.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion
|
||||||
Source: "C:\Simba\Extensions\dtm_editor.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion
|
Source: "C:\Simba\Extensions\dtm_editor.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion
|
||||||
Source: "C:\Simba\Extensions\reflection.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion
|
Source: "C:\Simba\Extensions\reflection.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion
|
||||||
|
Source: "C:\Simba\Extensions\security.sex"; DestDir: "{app}\Extensions"; Flags: ignoreversion
|
||||||
Source: "C:\Simba\Includes\mml.simba"; DestDir: "{app}\Includes"; Flags: ignoreversion
|
Source: "C:\Simba\Includes\mml.simba"; DestDir: "{app}\Includes"; Flags: ignoreversion
|
||||||
Source: "C:\Simba\Fonts\*"; DestDir: "{app}\Fonts"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "C:\Simba\Fonts\*"; DestDir: "{app}\Fonts"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: "C:\Simba\Tests\PS\*"; DestDir:"{app}\Scripts\Tests"; Flags: ignoreversion
|
Source: "C:\Simba\Tests\PS\*"; DestDir:"{app}\Scripts\Tests"; Flags: ignoreversion
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
object Form1: TForm1
|
object Form1: TForm1
|
||||||
Left = 478
|
Left = 544
|
||||||
Height = 556
|
Height = 615
|
||||||
Top = 156
|
Top = 169
|
||||||
Width = 556
|
Width = 554
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
Caption = 'Form1'
|
Caption = 'Form1'
|
||||||
ClientHeight = 556
|
ClientHeight = 615
|
||||||
ClientWidth = 556
|
ClientWidth = 554
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '0.9.29'
|
||||||
object ListView1: TListView
|
object ListView1: TListView
|
||||||
Left = 16
|
Left = 16
|
||||||
Height = 520
|
Height = 512
|
||||||
Top = 16
|
Top = 8
|
||||||
Width = 232
|
Width = 232
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
Columns = <
|
Columns = <
|
||||||
@ -41,15 +41,65 @@ object Form1: TForm1
|
|||||||
end
|
end
|
||||||
object Memo1: TMemo
|
object Memo1: TMemo
|
||||||
Left = 272
|
Left = 272
|
||||||
Height = 520
|
Height = 504
|
||||||
Top = 16
|
Top = 16
|
||||||
Width = 264
|
Width = 262
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
Lines.Strings = (
|
Lines.Strings = (
|
||||||
'Memo1'
|
'Memo1'
|
||||||
)
|
)
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
end
|
end
|
||||||
|
object Button1: TButton
|
||||||
|
Left = 16
|
||||||
|
Height = 33
|
||||||
|
Top = 576
|
||||||
|
Width = 520
|
||||||
|
Anchors = [akLeft, akBottom]
|
||||||
|
Caption = 'Button1'
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object Edit1: TEdit
|
||||||
|
Left = 72
|
||||||
|
Height = 27
|
||||||
|
Top = 536
|
||||||
|
Width = 176
|
||||||
|
Anchors = [akLeft, akBottom]
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 24
|
||||||
|
Height = 18
|
||||||
|
Top = 536
|
||||||
|
Width = 35
|
||||||
|
Anchors = [akLeft, akBottom]
|
||||||
|
Caption = 'Filter:'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object SearchIn: TComboBox
|
||||||
|
Left = 344
|
||||||
|
Height = 29
|
||||||
|
Top = 534
|
||||||
|
Width = 192
|
||||||
|
ItemHeight = 0
|
||||||
|
ItemIndex = 0
|
||||||
|
Items.Strings = (
|
||||||
|
'Tags, Name, Author'
|
||||||
|
'Name'
|
||||||
|
'Tags'
|
||||||
|
'Author'
|
||||||
|
)
|
||||||
|
TabOrder = 5
|
||||||
|
Text = 'Tags, Name, Author'
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 272
|
||||||
|
Height = 18
|
||||||
|
Top = 536
|
||||||
|
Width = 53
|
||||||
|
Caption = 'Filter by:'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
object ImageList1: TImageList
|
object ImageList1: TImageList
|
||||||
left = 80
|
left = 80
|
||||||
top = 272
|
top = 272
|
||||||
|
@ -36,7 +36,12 @@ type
|
|||||||
{ TForm1 }
|
{ TForm1 }
|
||||||
|
|
||||||
TForm1 = class(TForm)
|
TForm1 = class(TForm)
|
||||||
|
Button1: TButton;
|
||||||
|
SearchIn: TComboBox;
|
||||||
|
Edit1: TEdit;
|
||||||
ImageList1: TImageList;
|
ImageList1: TImageList;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
ListView1: TListView;
|
ListView1: TListView;
|
||||||
Memo1: TMemo;
|
Memo1: TMemo;
|
||||||
MenuItem1: TMenuItem;
|
MenuItem1: TMenuItem;
|
||||||
@ -79,6 +84,8 @@ var
|
|||||||
ss: TSimbaScript;
|
ss: TSimbaScript;
|
||||||
LI: TListItem;
|
LI: TListItem;
|
||||||
strarr: TStringArray;
|
strarr: TStringArray;
|
||||||
|
b: TButton;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if not s.ListKeys('Scripts/ScriptList', strarr) then
|
if not s.ListKeys('Scripts/ScriptList', strarr) then
|
||||||
writeln('ListKeys returned false');
|
writeln('ListKeys returned false');
|
||||||
|
@ -78,13 +78,12 @@ type
|
|||||||
ScriptName : string;//The name of the currently opened/saved file.
|
ScriptName : string;//The name of the currently opened/saved file.
|
||||||
ScriptDefault : string;//The default script e.g. program new; begin end.
|
ScriptDefault : string;//The default script e.g. program new; begin end.
|
||||||
ScriptChanged : boolean;//We need this for that little * (edited star).
|
ScriptChanged : boolean;//We need this for that little * (edited star).
|
||||||
ScriptThread : TMThread;//Just one thread for now..
|
// ScriptThread : TMThread;//Just one thread for now..
|
||||||
FScriptState : TScriptState;//Stores the ScriptState, if you want the Run/Pause/Start buttons to change accordingly, acces through Form1
|
// FScriptState : TScriptState;//Stores the ScriptState, if you want the Run/Pause/Start buttons to change accordingly, acces through Form1
|
||||||
procedure undo;
|
procedure undo;
|
||||||
procedure redo;
|
procedure redo;
|
||||||
procedure HandleErrorData;
|
procedure HandleErrorData;
|
||||||
procedure MakeActiveScriptFrame;
|
procedure MakeActiveScriptFrame;
|
||||||
procedure ScriptThreadTerminate(Sender: TObject);
|
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
{ public declarations }
|
{ public declarations }
|
||||||
end;
|
end;
|
||||||
@ -582,11 +581,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TScriptFrame.ScriptThreadTerminate(Sender: TObject);
|
|
||||||
begin
|
|
||||||
FScriptState:= ss_None;
|
|
||||||
SimbaForm.RefreshTab;
|
|
||||||
end;
|
|
||||||
procedure AddKey(const SynEdit : TSynEdit; const ACmd: TSynEditorCommand; const AKey: word;const AShift: TShiftState);
|
procedure AddKey(const SynEdit : TSynEdit; const ACmd: TSynEditorCommand; const AKey: word;const AShift: TShiftState);
|
||||||
begin
|
begin
|
||||||
with SynEdit.KeyStrokes.Add do
|
with SynEdit.KeyStrokes.Add do
|
||||||
@ -612,7 +606,7 @@ begin
|
|||||||
ScriptDefault:= StartText;
|
ScriptDefault:= StartText;
|
||||||
ScriptName:= 'Untitled';
|
ScriptName:= 'Untitled';
|
||||||
ScriptChanged := false;
|
ScriptChanged := false;
|
||||||
FScriptState:= ss_None;
|
|
||||||
ScriptErrorLine:= -1;
|
ScriptErrorLine:= -1;
|
||||||
OwnerSheet.Caption:= ScriptName;
|
OwnerSheet.Caption:= ScriptName;
|
||||||
SynEdit.Highlighter := SimbaForm.CurrHighlighter;
|
SynEdit.Highlighter := SimbaForm.CurrHighlighter;
|
||||||
|
@ -48,7 +48,7 @@ uses
|
|||||||
CastaliaSimplePasPar, v_AutoCompleteForm, PSDump;
|
CastaliaSimplePasPar, v_AutoCompleteForm, PSDump;
|
||||||
|
|
||||||
const
|
const
|
||||||
SimbaVersion = 702;
|
SimbaVersion = 704;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -396,6 +396,7 @@ type
|
|||||||
Picker: TMColorPicker;
|
Picker: TMColorPicker;
|
||||||
Selector: TMWindowSelector;
|
Selector: TMWindowSelector;
|
||||||
OnScriptStart : TScriptStartEvent;
|
OnScriptStart : TScriptStartEvent;
|
||||||
|
FScriptState: TScriptState;
|
||||||
{$ifdef mswindows}
|
{$ifdef mswindows}
|
||||||
ConsoleVisible : boolean;
|
ConsoleVisible : boolean;
|
||||||
procedure ShowConsole( ShowIt : boolean);
|
procedure ShowConsole( ShowIt : boolean);
|
||||||
@ -410,6 +411,7 @@ type
|
|||||||
function SaveCurrentScriptAsDefault : boolean;
|
function SaveCurrentScriptAsDefault : boolean;
|
||||||
function CanExitOrOpen : boolean;
|
function CanExitOrOpen : boolean;
|
||||||
function ClearScript : boolean;
|
function ClearScript : boolean;
|
||||||
|
procedure ScriptThreadTerminate(Sender: TObject);
|
||||||
procedure RunScript;
|
procedure RunScript;
|
||||||
procedure PauseScript;
|
procedure PauseScript;
|
||||||
procedure StopScript;
|
procedure StopScript;
|
||||||
@ -852,13 +854,21 @@ end;
|
|||||||
|
|
||||||
//{$ENDIF}
|
//{$ENDIF}
|
||||||
|
|
||||||
|
procedure TSimbaForm.ScriptThreadTerminate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
mDebugLn('Thread terminated');
|
||||||
|
ScriptState := ss_None;
|
||||||
|
CurrThread := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSimbaForm.RunScript;
|
procedure TSimbaForm.RunScript;
|
||||||
begin
|
begin
|
||||||
with CurrScript do
|
with CurrScript do
|
||||||
begin
|
begin
|
||||||
if ScriptState = ss_Paused then
|
if ScriptState = ss_Paused then
|
||||||
begin;
|
begin;
|
||||||
ScriptThread.Resume;
|
CurrThread.Resume;
|
||||||
|
// ScriptThread.Resume;
|
||||||
ScriptState := ss_Running;
|
ScriptState := ss_Running;
|
||||||
Exit;
|
Exit;
|
||||||
end else
|
end else
|
||||||
@ -867,13 +877,13 @@ begin
|
|||||||
FormWritelnEx('The script hasn''t stopped yet, so we cannot start a new one.');
|
FormWritelnEx('The script hasn''t stopped yet, so we cannot start a new one.');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
InitalizeTMThread(scriptthread);
|
InitalizeTMThread(CurrThread);
|
||||||
ScriptThread.CompileOnly:= false;
|
CurrThread.CompileOnly:= false;
|
||||||
ScriptThread.OnTerminate:=@ScriptThreadTerminate;
|
CurrThread.OnTerminate:=@ScriptThreadTerminate;
|
||||||
ScriptState:= ss_Running;
|
ScriptState:= ss_Running;
|
||||||
FirstRun := false;
|
FirstRun := false;
|
||||||
//Lets run it!
|
//Lets run it!
|
||||||
ScriptThread.Resume;
|
CurrThread.Resume;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -884,14 +894,14 @@ begin
|
|||||||
if ScriptState = ss_Running then
|
if ScriptState = ss_Running then
|
||||||
begin;
|
begin;
|
||||||
{$ifdef MSWindows}
|
{$ifdef MSWindows}
|
||||||
ScriptThread.Suspended:= True;
|
CurrThread.Suspended:= True;
|
||||||
ScriptState:= ss_Paused;
|
ScriptState:= ss_Paused;
|
||||||
{$else}
|
{$else}
|
||||||
mDebugLn('Linux users are screwed, no pause button for u!');
|
mDebugLn('Linux users are screwed, no pause button for u!');
|
||||||
{$endif}
|
{$endif}
|
||||||
end else if ScriptState = ss_Paused then
|
end else if ScriptState = ss_Paused then
|
||||||
begin;
|
begin;
|
||||||
ScriptThread.Resume;
|
CurrThread.Resume;
|
||||||
ScriptState := ss_Running;
|
ScriptState := ss_Running;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -905,20 +915,20 @@ begin
|
|||||||
ss_Stopping:
|
ss_Stopping:
|
||||||
begin //Terminate the thread the tough way.
|
begin //Terminate the thread the tough way.
|
||||||
mDebugLn('Terminating the Scriptthread');
|
mDebugLn('Terminating the Scriptthread');
|
||||||
mDebugLn('Exit code terminate: ' +inttostr(KillThread(ScriptThread.Handle)));
|
mDebugLn('Exit code terminate: ' +inttostr(KillThread(CurrThread.Handle)));
|
||||||
WaitForThreadTerminate(ScriptThread.Handle, 0);
|
WaitForThreadTerminate(CurrThread.Handle, 0);
|
||||||
ScriptThread.Free;
|
CurrThread.Free;
|
||||||
ScriptState := ss_None;
|
ScriptState := ss_None;
|
||||||
end;
|
end;
|
||||||
ss_Running:
|
ss_Running:
|
||||||
begin
|
begin
|
||||||
ScriptThread.Terminate;
|
CurrThread.Terminate;
|
||||||
ScriptState := ss_Stopping;
|
ScriptState := ss_Stopping;
|
||||||
end;
|
end;
|
||||||
ss_Paused:
|
ss_Paused:
|
||||||
begin
|
begin
|
||||||
ScriptThread.Resume;
|
CurrThread.Resume;
|
||||||
ScriptThread.Terminate;
|
CurrThread.Terminate;
|
||||||
ScriptState:= ss_Stopping;
|
ScriptState:= ss_Stopping;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1136,7 +1146,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
StatusBar.Panels[Panel_ScriptName].Text:= Script.ScriptName;
|
StatusBar.Panels[Panel_ScriptName].Text:= Script.ScriptName;
|
||||||
StatusBar.Panels[Panel_ScriptPath].text:= Script.ScriptFile;
|
StatusBar.Panels[Panel_ScriptPath].text:= Script.ScriptFile;
|
||||||
SetScriptState(Tab.ScriptFrame.FScriptState);//To set the buttons right
|
|
||||||
|
{ XXX: No longer update buttons }
|
||||||
|
// SetScriptState(Tab.ScriptFrame.FScriptState);//To set the buttons right
|
||||||
|
|
||||||
|
|
||||||
if Self.Showing then
|
if Self.Showing then
|
||||||
if Tab.TabSheet.TabIndex = Self.PageControl1.TabIndex then
|
if Tab.TabSheet.TabIndex = Self.PageControl1.TabIndex then
|
||||||
if CurrScript.SynEdit.CanFocus then
|
if CurrScript.SynEdit.CanFocus then
|
||||||
@ -2311,7 +2325,7 @@ begin;
|
|||||||
if CurrScript.ScriptName <> '' then
|
if CurrScript.ScriptName <> '' then
|
||||||
SynExporterHTML.Title:= 'Simba - ' + CurrScript.ScriptName
|
SynExporterHTML.Title:= 'Simba - ' + CurrScript.ScriptName
|
||||||
else
|
else
|
||||||
SynExporterHTML.Title:= 'Cogat - Untitled';
|
SynExporterHTML.Title:= 'Simba - Untitled';
|
||||||
SynExporterHTML.ExportAll(CurrScript.SynEdit.Lines);
|
SynExporterHTML.ExportAll(CurrScript.SynEdit.Lines);
|
||||||
SynExporterHTML.SaveToFile(FileName);
|
SynExporterHTML.SaveToFile(FileName);
|
||||||
end;
|
end;
|
||||||
@ -2622,7 +2636,7 @@ end;
|
|||||||
|
|
||||||
function TSimbaForm.GetScriptState: TScriptState;
|
function TSimbaForm.GetScriptState: TScriptState;
|
||||||
begin
|
begin
|
||||||
result := CurrScript.FScriptState;
|
result := FScriptState;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSimbaForm.GetShowParamHintAuto: boolean;
|
function TSimbaForm.GetShowParamHintAuto: boolean;
|
||||||
@ -2685,7 +2699,7 @@ end;
|
|||||||
|
|
||||||
procedure TSimbaForm.SetScriptState(const State: TScriptState);
|
procedure TSimbaForm.SetScriptState(const State: TScriptState);
|
||||||
begin
|
begin
|
||||||
CurrScript.FScriptState:= State;
|
FScriptState:= State;
|
||||||
with Self.StatusBar.panels[Panel_State] do
|
with Self.StatusBar.panels[Panel_State] do
|
||||||
case state of
|
case state of
|
||||||
ss_Running : begin Text := 'Running'; TB_Run.Enabled:= False; {$ifdef MSWindows}TB_Pause.Enabled:= True; {$endif}
|
ss_Running : begin Text := 'Running'; TB_Run.Enabled:= False; {$ifdef MSWindows}TB_Pause.Enabled:= True; {$endif}
|
||||||
@ -2878,7 +2892,7 @@ begin
|
|||||||
LocalCopy := CurrentSyncInfo;
|
LocalCopy := CurrentSyncInfo;
|
||||||
mDebugLn('Executing : ' + LocalCopy.MethodName);
|
mDebugLn('Executing : ' + LocalCopy.MethodName);
|
||||||
thread:= TMThread(LocalCopy.OldThread);
|
thread:= TMThread(LocalCopy.OldThread);
|
||||||
mmlpsthread.CurrThread:= thread;
|
//mmlpsthread.CurrThread:= thread;
|
||||||
try
|
try
|
||||||
if thread is TPSThread then
|
if thread is TPSThread then
|
||||||
begin
|
begin
|
||||||
@ -2893,7 +2907,7 @@ begin
|
|||||||
raise Exception.Create('ThreadSafeCall not implemented on this client');
|
raise Exception.Create('ThreadSafeCall not implemented on this client');
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
mmlpsthread.CurrThread:= nil;
|
//mmlpsthread.CurrThread:= nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
program new;
|
program new;
|
||||||
{.LoadDLL libsmart}
|
{$Loadlib libsmart}
|
||||||
function IsKeyDown(C:Char): Boolean;
|
function IsKeyDown(C:Char): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := SmartIsKeyDown(ord(c));
|
Result := SmartIsKeyDown(ord(c));
|
||||||
@ -54,11 +54,12 @@ var
|
|||||||
w,h:integer;
|
w,h:integer;
|
||||||
begin
|
begin
|
||||||
SmartSetup('http://world19.runescape.com/', 'plugin.js?param=o0,a1,m0', 765, 503);
|
SmartSetup('http://world19.runescape.com/', 'plugin.js?param=o0,a1,m0', 765, 503);
|
||||||
SetTargetArray(SmartImageArray, 765,503);
|
wait(30000);
|
||||||
|
{ SetTargetArray(SmartImageArray, 765,503);
|
||||||
getclientdimensions(w,h);
|
getclientdimensions(w,h);
|
||||||
writeln(inttostr(w) + ' , ' + inttostr(h));
|
writeln(inttostr(w) + ' , ' + inttostr(h));
|
||||||
if findcolortolerance(w,h,clwhite,0,0,764,502,300) then
|
if findcolortolerance(w,h,clwhite,0,0,764,502,300) then
|
||||||
smartmovemouse(w,h);
|
smartmovemouse(w,h);
|
||||||
Wait(5000);
|
Wait(5000);
|
||||||
savescreenshot(scriptPath + 'smart.bmp');
|
savescreenshot(scriptPath + 'smart.bmp'); }
|
||||||
end.
|
end.
|
||||||
|
@ -188,8 +188,10 @@ type
|
|||||||
procedure AddMethod(meth: TExpMethod); override;
|
procedure AddMethod(meth: TExpMethod); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
threadvar
|
|
||||||
|
var
|
||||||
CurrThread : TMThread;
|
CurrThread : TMThread;
|
||||||
|
|
||||||
var
|
var
|
||||||
PluginsGlob: TMPlugins;
|
PluginsGlob: TMPlugins;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user