SRL Archive - Help and Support

Can anyone help with this?


Waddo

2008-07-30 08:09:05

program smarttools;
{.include SRL/SRL/Misc/SMART.scar}
{.include srl/srl.scar}
var
frmDesign : TForm;
TextBox : TEdit;
SendButton : TButton;
colorselect : TListBox;
EffectSelect : TListBox;
CancelButton : TButton;
ClockBut : TButton;
ACBut : TButton;
Cmbbox : TComboBox;
DirGo : TButton;
UpButton : TButton;
DownButton : TButton;
OkButton : TBitBtn;
CancelButton2 : TBitBtn;
GroupBox1 : TGroupBox;
DegGo : TButton;
degs : TEdit;
PageControl: TPageControl;
Page1, Page2: TtabSheet;
Colour : String;
Effect :string;

Procedure SetupSMART;
Begin
SmartSetupEx(136, false, false, False);
SetTargetDC(SmartGetDC);
If Not (LoggedIn) Then
While Not (SmartGetColor(360, 172) = 13158) Do
Wait(100);
End;

{*******************************************************************************
Procedure Send(sender: TObject);
By: Waddo
Description: Part of S.M.A.R.T Talk, Sends the message
*******************************************************************************}

Procedure Send(sender: TObject);
begin
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
Wait(2000);
if ColorSelect.Items[ColorSelect.ItemIndex]<>'No Colour' then
Colour:=ColorSelect.Items[ColorSelect.ItemIndex]+':';
if EffectSelect.Items[EffectSelect.ItemIndex]<>'No Effect' then
Effect:=EffectSelect.Items[EffectSelect.ItemIndex]+':';
activateclient;
wait(10);
typeSend(Colour+Effect+TextBox.Text);
end;

{*******************************************************************************
Procedure Cancel(sender: TObject);
By: Waddo
Description: Part of S.M.A.R.T Talk,
performed when SmartTalk form is canceled
*******************************************************************************}

Procedure Cancel(sender: TObject);
begin
Writeln('S.M.A.R.T Tools Canceled');
frmDesign.Caption:= frmDesign.Caption + '.';
FindWindowBySize(766,504);
activateclient;
frmDesign.ModalResult:= mrCancel;
end;

Procedure Cancel2(sender: TObject);
begin
Writeln('S.M.A.R.T Tools Canceled');
frmDesign.Caption:= frmDesign.Caption + '.';
FindWindowBySize(766,504);
activateclient;
frmDesign.ModalResult:= mrCancel;
end;

Procedure CamDir(sender: TObject);
begin
activateclient;
wait(200);
Makecompass(left(Cmbbox.Items[Cmbbox.ItemIndex],1));
writeln(Cmbbox.Items[Cmbbox.ItemIndex]);
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

procedure RotCamC(sender: TObject);
begin
activateclient;
wait(200);
keydown(vk_left);
wait(200+random(20));
keyup(vk_left);
GetApplication
FindWindowTitlePart('talk',false);
activateclient;
FindWindowBySize(766,504);
end;

procedure RotCamAC(sender: TObject);
begin
activateclient;
wait(200);
keydown(vk_right);
wait(200+random(20));
keyup(vk_right);
GetApplication
FindWindowTitlePart('talk',false);
activateclient;
FindWindowBySize(766,504);
end;

procedure CamUp(sender: TObject);
begin
activateclient;
wait(200);
keydown(vk_up);
wait(200+random(20));
keyup(vk_up);
GetApplication
FindWindowTitlePart('talk',false);
activateclient;
FindWindowBySize(766,504);
end;

procedure CamDown(sender: TObject);
begin
activateclient;
wait(200);
keydown(vk_down);
wait(200+random(20));
keyup(vk_down);
GetApplication
FindWindowTitlePart('talk',false);
activateclient;
FindWindowBySize(766,504);
end;

procedure CamDeg(sender: TObject);
begin
activateclient;
wait(200);
MakeCompass(inttostr(strtoint(degs.Text)+180));
frmDesign.ModalResult:= mrOk;
end;

{*******************************************************************************
Procedure InitForm;
By: Waddo
Description: S.M.A.R.T Talks Form
*******************************************************************************}

Procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 372;
frmDesign.Top := 128;
frmDesign.Width := 369;
frmDesign.Height := 185;
frmDesign.Caption := 'S.M.A.R.T Talk By Waddo';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := false;
frmDesign.PixelsPerInch := 96;

TextBox := TEdit.Create(frmDesign);
TextBox.Parent := frmDesign;
TextBox.Left := 14;
TextBox.Top := 9;
TextBox.Width := 259;
TextBox.Height := 21;
TextBox.tabOrder := 0;

SendButton := TButton.Create(frmDesign);
SendButton.OnClick:= @send;
SendButton.Parent := frmDesign;
SendButton.Left := 280;
SendButton.Top := 8;
SendButton.Width := 57;
SendButton.Height := 49;
SendButton.Caption := 'Send';
SendButton.tabOrder := 1;

colorselect := TListBox.Create(frmDesign);
colorselect.Parent := frmDesign;
colorselect.Left := 14;
colorselect.Top := 40;
colorselect.Width := 129;
colorselect.Height := 73;
colorselect.ItemHeight := 13;
colorselect.Items.Add('No Colour');
colorselect.Items.Add('Red');
colorselect.Items.Add('Green');
colorselect.Items.Add('White');
colorselect.Items.Add('Cyan');
colorselect.Items.Add('Purple');
colorselect.tabOrder := 10;

EffectSelect := TListBox.Create(frmDesign);
EffectSelect.Parent := frmDesign;
EffectSelect.Left := 152;
EffectSelect.Top := 40;
EffectSelect.Width := 121;
EffectSelect.Height := 73;
EffectSelect.ItemHeight := 13;
EffectSelect.Items.Add('No Effect');
EffectSelect.Items.Add('Flash1');
EffectSelect.Items.Add('Flash2');
EffectSelect.Items.Add('Flash3');
EffectSelect.Items.Add('Scroll');
EffectSelect.Items.Add('Shake');
EffectSelect.Items.Add('Wave');
EffectSelect.Items.Add('Wave2');
EffectSelect.Items.Add('Slide');
EffectSelect.Items.Add('Glow1');
EffectSelect.Items.Add('Glow2');
EffectSelect.Items.Add('Glow3');
EffectSelect.tabOrder := 11;

CancelButton := TButton.Create(frmDesign);
CancelButton.OnClick:= @Cancel;
CancelButton.Parent := frmDesign;
CancelButton.Left := 280;
CancelButton.Top := 64;
CancelButton.Width := 57;
CancelButton.Height := 49;
CancelButton.Caption := 'Cancel';
CancelButton.tabOrder := 12;

PageControl := TPageControl.Create(frmDesign);
PageControl.Parent := frmDesign;
PageControl.Align := alClient;

ClockBut := TButton.Create(frmDesign);
ClockBut.OnClick:= @RotCamC;
ClockBut.Parent := frmDesign;
ClockBut.Left := 150;
ClockBut.Top := 41;
ClockBut.Width := 97;
ClockBut.Height := 33;
ClockBut.Caption := 'Clockwise -->';
ClockBut.TabOrder := 0;

ACBut := TButton.Create(frmDesign);
ACBut.OnClick:= @RotCamAC;
ACBut.Parent := frmDesign;
ACBut.Left := 6;
ACBut.Top := 41;
ACBut.Width := 97;
ACBut.Height := 33;
ACBut.Caption := '<-- Anti Clockwise';
ACBut.TabOrder := 1;

Cmbbox := TComboBox.Create(frmDesign);
Cmbbox.Parent := frmDesign;
Cmbbox.Left := 232;
Cmbbox.Top := 17;
Cmbbox.Width := 63;
Cmbbox.Height := 21;
Cmbbox.ItemHeight := 13;
Cmbbox.ItemIndex := 0;
Cmbbox.TabOrder := 2;
Cmbbox.Text := 'North';
Cmbbox.Items.Add('North');
Cmbbox.Items.Add('East');
Cmbbox.Items.Add('South');
Cmbbox.Items.Add('West');

DirGo := TButton.Create(frmDesign);
DirGo.OnClick:= @CamDir;
DirGo.Parent := frmDesign;
DirGo.Left := 304;
DirGo.Top := 16;
DirGo.Width := 33;
DirGo.Height := 24;
DirGo.Caption := 'Go';
DirGo.TabOrder := 3;

UpButton := TButton.Create(frmDesign);
UpButton.OnClick:= @CamUp;
UpButton.Parent := frmDesign;
UpButton.Left := 102;
UpButton.Top := 9;
UpButton.Width := 49;
UpButton.Height := 33;
UpButton.Caption := 'UP';
UpButton.TabOrder := 4;

DownButton := TButton.Create(frmDesign);
DownButton.OnClick:= @CamDown;
DownButton.Parent := frmDesign;
DownButton.Left := 102;
DownButton.Top := 73;
DownButton.Width := 49;
DownButton.Height := 33;
DownButton.Caption := 'Down';
DownButton.TabOrder := 5;

OkButton := TBitBtn.Create(frmDesign);
OkButton.Parent := frmDesign;
OkButton.Left := 102;
OkButton.Top := 41;
OkButton.Width := 49;
OkButton.Height := 33;
OkButton.TabOrder := 6;
OkButton.Kind := bkOK;

CancelButton2 := TBitBtn.Create(frmDesign);
CancelButton2.OnClick:= @Cancel2;
CancelButton2.Parent := frmDesign;
CancelButton2.Left := 56;
CancelButton2.Top := 105;
CancelButton2.Width := 153;
CancelButton2.Height := 17;
CancelButton2.TabOrder := 7;
CancelButton2.Kind := bkCancel;

GroupBox1 := TGroupBox.Create(frmDesign);
GroupBox1.Parent := frmDesign;
GroupBox1.Left := 240;
GroupBox1.Top := 81;
GroupBox1.Width := 105;
GroupBox1.Height := 41;
GroupBox1.Caption := 'degrees';
GroupBox1.TabOrder := 8;

DegGo := TButton.Create(GroupBox1);
DegGo.OnClick := @CamDeg;
DegGo.Parent := GroupBox1;
DegGo.Left := 64;
DegGo.Top := 12;
DegGo.Width := 33;
DegGo.Height := 24;
DegGo.Caption := 'Go';
DegGo.TabOrder := 0;

degs := TEdit.Create(GroupBox1);
degs.Parent := GroupBox1;
degs.Left := 8;
degs.Top := 13;
degs.Width := 49;
degs.Height := 20;
degs.TabOrder := 1;


Page1 := TTabSheet.Create(frmDesign);
Page1.Caption := 'S.M.A.R.T. Talk';
Page1.PageControl := PageControl;
Page2 := TTabSheet.Create(frmDesign);
Page2.Caption := 'Rotate Cam';
Page2.PageControl := PageControl;

CancelButton.Parent := Page1;
EffectSelect.Parent := Page1;
colorselect.Parent := Page1;
SendButton.Parent := Page1;
TextBox.Parent := Page1;

degs.Parent := GroupBox1;
DegGo.Parent := GroupBox1;
GroupBox1.Parent := Page2;
CancelButton2.Parent := Page2;
OkButton.Parent := Page2;
DownButton.Parent := Page2;
UpButton.Parent := Page2;
DirGo.Parent := Page2;
Cmbbox.Parent := Page2;
ACBut.Parent := Page2;
ClockBut.Parent := Page2;
end;

Procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;

Procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;

Procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;

{*******************************************************************************
Procedure SmartTalk;
By: Waddo
Description: S.M.A.R.T Talk, enables a user to talk in runescape,
with out pausing there script or unblocking S.M.A.R.T.
To use put SmartTalk somewhere in your main loop that will be caled often,
then hold down Ctrl+1 until the window appears.
*******************************************************************************}

Procedure SmartTalk;
begin
if ((isfunctionkeydown(1))and(IsKeyDown('1'))) then
begin
SafeInitForm;
SafeShowFormModal;
end;
end;

begin
setupsrl;
setupsmart;
repeat
smarttalk;
wait(100);
until false;
end.


I believe the problem lies within (typeSend(Colour+Effect+TextBox.Text);)

Nava2

2008-07-30 08:48:42

Whats the issue?

Waddo

2008-07-30 09:08:37

run it
log in to smart
and hold ctrl+1 a box should appear so you can type stuff into smart without pausing script

(it also has a cam rotator but this doesn't work yet either) when ever you try and use it just closes scar =[