SRL Archive - S.M.A.R.T.

(Suggestion) SMART Text Box


mercvii

2008-07-27 16:59:07

When I auto I like to keep an eye on my characters to keep them from getting into trouble. For most scripts I disable autoresponder and do the typing myself.

I was wondering whether it would be possible to add a text line to SMART where you could type and hit enter, and you would be talking, like in other clients? And if it is possible, would others use it and make it worth the effort?

Thanks for reading,

MercVII

noidea

2008-07-27 17:22:22

I dont really understand your question…

Holey FAUK!!!!!!!!!!! WOOOOT 200th post!!!!!!!!!!!!! Can I use avatar now please? Just kidding.

jakeyboy29

2008-07-27 17:35:47

^^ spam, its a good idea i no what you mean.

noidea

2008-07-27 18:25:02

LOL sorry if I did not put enough into that post up there. I really have noidea as to what he is talking about (Sorry I Didn't remeber your name thread creator)

noidea

King of Knives

2008-07-27 18:44:54

Funny enough, you just did it again.

Timer

2008-07-27 19:18:42

Something like…

This..?

Wizzup?

2008-07-27 20:21:32

You could make a Form in SCAR, load it on Script Start, and add a text box and button.
On Button click, do SmartSendKeys(textbox.test) and clear the text box.

lordsaturn

2008-07-27 21:16:32

Or you could just hit 'Disable Smart' for a second, type what you need to type, then enable it again.

mercvii

2008-07-28 21:22:53

oh is that what that does lol? I always wondered what the buttons on the bottom, and the slider on the side, do

n3ss3s

2008-07-30 05:57:09

Enabling SMART allows SCAR to use SMART without hijacking your mouse, disabling allows you to play RuneScape yourself.

Enabling graphics shows the RuneScape screen, disabing makes it a white block which lowers CPU usage but the script still works.

Enable debug, you can draw on the debug screen, which I don't recommend because Ben didn't build in a ClearDebugCanvas.

Slider bar, the "FPS bar", allows you to control the Frames Per Second of RuneScape, the lower, the lower CPU usage.

Waddo

2008-07-30 06:38:02

Erm I have already produced this it just does not work properly yet it also allows you to adjust the camera angle i just need to fix it a bit.

Edit: and i think wizzup may have just made me realise my error, (i was using send keys instead of SMARTSendKeys as i thought smart auto overwrote them.)

Freddy1990

2008-07-30 07:03:43

This isn't such a bad idea actually…

Waddo

2008-07-30 07:50:15

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.

that's what I have, but it doesn't work, I think its something to do with the typesend.

NightBlade

2008-08-10 12:11:48

Yeah this would be great for responding to other people and such to carry on a conversation.. which auto responders fail to do and would greatly reduce reporting.

TViYH

2008-08-10 16:32:21

I think you have to use SendKeys instead of TypeSend, Waddo..

randy marsh

2008-08-10 19:26:59

If waddos makes it work, can this be put into the svn checkout folder?

TViYH

2008-08-10 22:36:31

Well. I don't see why it couldn't.

Skitzo

2008-08-13 07:37:16

That's a damn good idea. Is it possible? I don't know.

mixster

2008-08-13 18:53:52

I have an idea and will be developing it when I get my pc back up. Basically you add a procedure and call it where it would be "safe" to talk as the problem with stopping it where ever is that it could disrupt the script especially with timings. Not only that, but it can be left open and it would only run commands on submission of it, but it can be closed.