SRL Archive - First Scripts

Simple Autotalker


proalex

2013-07-25 12:57:46

Extremely simple but it works.


program AutoTalker;
{$i SRL\SRL.simba}


var
Text, TextColor, TextEffect: string;
SayTimes, TimeBetween: Integer;

procedure Talk;

var
b: Integer;
begin

SayTimes := 10;
Text := 'Buying 10k lobsters, 400 gp ea!';
TextEffect := 'wave1: ';
TextColor := 'red:';
TimeBetween := 700;

for b := 0 to (SayTimes) do
begin
TypeSend((TextColor)+(TextEffect)+(Text));
Wait (TimeBetween);
end;

end;


begin
SetupSRL;
ActivateClient;
Talk;
end.

What I want to add:

* Multi-messages
* GUI
* Other stuff I can find useful

Le_don

2013-07-25 22:04:18

Try adding your things to constants so it's easier to edit for people:

program AutoTalker;
{$i SRL\SRL.simba}

const
ver = 1.0; //VERSION NUMBER - NO REAL MEANING
WHATTOSAY = ''; //What should we type?
TIMESTOSAY = 10; //how many times should we repeat this?
EFFECT1 = ''; //What effect should we apply to the text?
EFFECT2 = ''; //Secondary effect
REPEATTIME = 1000; //how quickly should we repeat the message in ms? (1000 = 1 second)

var
Text, TextColor, TextEffect: string;
SayTimes, TimeBetween: Integer;

procedure Talk;

var
b: Integer;
begin

SayTimes := TIMESTOSAY;
Text := WHATTOSAY;
TextEffect := EFFECT1;
TextColor := EFFECT2;
TimeBetween := REPEATTIME;

for b := 0 to (SayTimes) do
begin
TypeSend((TextColor)+(TextEffect)+(Text));
Wait (TimeBetween);
end;

end;


begin
SetupSRL;
ActivateClient;
Talk;
end.

Enslaved

2013-07-26 11:39:41

Slightly Cleaner like this:

program AutoTalker;
{$i SRL\SRL.simba}

Const
SayTimes = 10;
Text = 'Buying 10k lobsters, 400 gp ea!';
TextEffect = 'wave1: ';
TextColor = 'red:';
TimeBetween = 700;

procedure Talk;

var
b: Integer;
begin
for b := 0 to (SayTimes) do
begin
TypeSend((TextColor)+(TextEffect)+(Text));
Wait(TimeBetween);
end;
end;


begin
SetupSRL;
ActivateClient;
Talk;
end.
Edit: also use
 tags , as that way, it is formatted for PascalScript

lukase48

2013-07-28 07:47:56

Why this autotalker is typing messages in simba script screen?

Le_don

2013-07-29 01:04:47

From: lukase48
Why this autotalker is typing messages in simba script screen?


Lol, select a different window.

Rich

2013-07-29 18:48:30

From: lukase48
Why this autotalker is typing messages in simba script screen?
This script doesn't use SMART, so you have to open RS in your browser and target the client, unless you add SMART yourself.

@proalex, grats on the first script. I remember my first script was a talker. Keep it up :)

lukase48

2013-08-01 16:23:04

So I can use only one autotalker?

masterBB

2013-08-01 19:04:09

From: lukase48
So I can use only one autotalker?


Just define SMART at the top of the script.