SRL Archive - Research & Development Lounge

S.M.A.R.T. Talk


Waddo

2008-05-28 20:59:52

This allows you to talk in runescape while using S.M.A.R.T. without having to pause your script and unblock S.M.A.R.T.

To use you must save in includes and define it the same way as a normal include,
then call it with SmartTalk; somewhere in your main loop that will be called often.

T run press and hold Ctrl+1.


var
frmDesign : TForm;
TextBox : TEdit;
SendButton : TButton;
colorselect : TListBox;
EffectSelect : TListBox;
CancelButton : TButton;
Colour : String;
Effect :string;

{*******************************************************************************
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:=''
else Colour:=ColorSelect.Items[ColorSelect.ItemIndex]+':';
if EffectSelect.Items[EffectSelect.ItemIndex]='No Effect' then
Effect:=''
else Effect:=EffectSelect.Items[EffectSelect.ItemIndex]+':';
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 Talk Canceled');
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrCancel;
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 := 376;
frmDesign.Height := 161;
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 := 288;
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 := 288;
CancelButton.Top := 64;
CancelButton.Width := 57;
CancelButton.Height := 49;
CancelButton.Caption := 'Cancel';
CancelButton.TabOrder := 12;
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;

save it in includes folder and try this script out to test it.

program New;
{.include srl/srl.scar}
{.include Smart talk.scar}
begin
repeat
smarttalk;
until false;
end.

From: Dan Cardin
[02:16]<DanCardin> yea, its nifty

From: mixster
though yours has the edge on awesomeness

mixster

2008-05-28 21:04:05

Nice, though I can do the same thing much easier with a Readln :p
Of course, it doesn't look as cool ;)
Maybe look it into Inter Messaging which would make it much cooler IMO as you could just have it running in a separate Scar rather than hold down ctr + 1 :)
Edit:

if isfunctionkeydown(1) and IsKeyDown('1') then
TypeSend(Readln('Say what?:'));
:)

Waddo

2008-05-28 21:07:55

interscar messaging to advanced + needs another scar window = more lag
and stop trying to make me look bad you have to criticise everything i do and this is the most original usefull thing i done =]

mixster

2008-05-28 21:10:22

Scar Inter Messaging is actually very simple - it's just like sending a text to another phone :)
Anyway, simplicity is most effective IMO, though yours has the edge on awesomeness :p
Not to mention I didn't criticise anything I think…

Waddo

2008-05-28 21:22:11

hmm i supose you didnt.
I wonder if this could get put into the next srl =] would be good to get put in the smart.scar folder then it would be auto called with smart =]

Edit:Ty mixster for the thing bout brackets i always do that. =]

tarlcabot1

2008-05-28 21:37:52

thanks I was looking for different ways to use forms. I'll be digesting this one for the rest of the week i think :garfield:

Waddo

2008-05-29 06:22:31

I'm glad you like it.

Waddo

2008-05-29 11:56:50

How do i do the image.