SRL Archive - S.M.A.R.T. Questions and Answers.

User input while SCAR is running


Sinking Poop

2009-05-27 20:23:57

Is it possible to have SMART running a script and allows me to talk. It kind of stinks when someone asks:What is your woodcutting lvl (name here)?
I know it works fine with loading runescape and starting it there, but I just need help allowing me to put user input.
Thanks,
S.P

Frt

2009-05-27 20:24:43

Read up on SendInterScarMessage and ReadInterScarMessage ;)

XcanadamanX

2009-05-28 01:24:57

or pause, "disable SMART", type, "enable SMART", unpause

Da 0wner

2009-05-28 02:41:39

Nadeem's scripts have this capability. By holding F12 it shows a ReadLn box and then it TypeSends that.

Nadeem

2009-05-28 02:45:15

From: Da 0wner
Nadeem's scripts have this capability. By holding F12 it shows a ReadLn box and then it TypeSends that.


ty Da 0wner.

Check my scripts for the functions QuickMessage; or SendMSG;, if you need to see how to do it :)



~NS

Da 0wner

2009-05-28 02:50:27

procedure SendMSG;
var
s : string;
begin
if IsFKeyDown(12) then
begin
s := ReadLn('What do you wish to type?');
if s = '' then
exit;
while IsFKeyDown(12) do
wait(50);
TypeSend(s);
end;
end;
Should be like that.

Naum

2009-05-28 14:39:49

And to call you may have to set a TimeOut,
Or use SRL_Procs[On_RandomCall] :)

Frt

2009-05-29 09:20:59

Why not just do this?

procedure Replier;
begin
if IsFKeyDown(2) then
TypeSend(Readln('What do you want to write?'));
if (not(ReadInterScarMessage('Frt') = '')) then
begin
TypeSend(ReadInterScarMessage('Frt'));
SendInterScarMessage('Frt', '');
end;
end;
Just call this function every now and then and when you want to type something run this script:
program Reply;

begin
SendInterScarMessage('Frt', Readln('What do you want to type?'));
end.

Da 0wner

2009-05-29 09:41:26

Setting a time out is good just make it run every few seconds or something.
Put this procedure in the main script:
procedure ReceiveMessage;
var
s : string;
begin
s := ReadInterSCARMessage('Channel1');
if s <> '' then
begin
Writeln('Received message to type ''' + s + '''.');
TypeSend(s);
SendInterSCARMessage('Channel1', '');
end;
SetTimeOut('ReceiveMessage', 3000);
end;
You don't need the set time out, but it's good :p. You should also remember to set it somewhere in the main loop once.

Another script:
program New;

var
s : string;

begin
repeat
if IsFKeyDown(12) then
begin
s := ReadLn('What do you wish to type?');
if s <> '' then
begin
SendInterSCARMessage('Channel1', s);
Writeln('Sending message to type ''' + s + '''.');
end;
while IsFKeyDown(12) do
wait(1);
end;
until(IsFKeyDown(11));
end.

You can change the FKeys :p. But that works fine, just tested it.