Delet this:
Code:
type
YourMessage = String;
Repeats = Integer;
and this after the wait(10)
Change this:
Code:
SendKeys(YourMessage+chr(13));
to
Code:
TypeSend(YourMessage);
And btw your script will type the text repeats times then stop. Maybe that's what you want but I think you want it to write the text always when you hit p.
Anyway it should look something like this:
SCAR Code:
program AutoTyper;
{.include SRL/SRL.scar}
var
i: Integer;
const
YourMessage = 'Selling [item] for'; //Type the message you want repeated.
Repeats = 1; //1 repeat is default.
procedure Idle;
begin
while not IsKeyDown('p') do
Wait(10);
end;
procedure Talk;
begin
i := 0;
repeat
TypeSend(YourMessage);
i := i + 1;//same as Inc(I);
WriteLn('Your message has been repeated '+IntToStr(i)+' times.');
until (i = Repeats);
end;
begin
SetupSRL;
ClearDebug;
//repeat
Idle;
Talk;
//until(false);
WriteLn('Your typing is finished. Terminating.');
end.
Edit: Delete // before the repeat and until if you want it to write always when you pres p