Infantry001
2008-08-18 10:10:59
I'm running a script for SMART (works perfectly, btw :)), and I decided to put in a ChatBox (so I can type while SMART is still enabled). These are the procedures I have used so far:
I call up the form right after I setup my characters and such. However, when I type something in and press the button, both SCAR and SMART crash.
Any possible reasons for this? Was it a mistake on my behalf (I haven't been around for a while, so… yeah), or can SCAR just not handle the multi-tasking?
procedure SmartType(sender : TObject);
var
text : string;
begin
text := TextBox.Text;
if ((text <> '') or (text <> 'Type Here')) then
TypeSend(Text);
TextBox.Text := '';
end;
procedure InitForm;
begin
ChatBox := CreateForm;
with ChatBox do
begin
Left := 356;
Top := 186;
BorderStyle := bsToolWindow;
Caption := 'SMART ChatBox';
ClientHeight := 65;
ClientWidth := 346;
Color := clTeal;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
PixelsPerInch := 96;
end;
TextBox := TEdit.Create(ChatBox);
with TextBox do
begin
Parent := ChatBox;
Left := 8;
Top := 8;
Width := 329;
Height := 21;
ParentShowHint := False;
ShowHint := False;
TabOrder := 8;
Text := 'Type Here';
end;
TypeButton := TButton.Create(ChatBox);
with TypeButton do
begin
Parent := ChatBox;
Left := 128;
Top := 32;
Width := 75;
Height := 25;
Caption := 'Go!';
OnClick := @SmartType;
TabOrder := 9;
end;
end;
procedure SafeInitForm;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('InitForm', V);
end;
procedure ShowInitForm;
begin
ChatBox.Show;
end;
procedure SafeShowInitForm;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowInitForm', V);
end;I call up the form right after I setup my characters and such. However, when I type something in and press the button, both SCAR and SMART crash.
Any possible reasons for this? Was it a mistake on my behalf (I haven't been around for a while, so… yeah), or can SCAR just not handle the multi-tasking?