SRL Archive - First Scripts

First Ever Script


souppy

2007-12-05 21:30:27

Hey guys, this is my first ever script. It is a basic auto-talker. Any hints or feedback would be extremely appreciated.

//Souppy's first auto talker
program Autotalker;
{.include SRL\SRL.scar}

const
NumberOfMessages = 3; // Number of Messages
Message1 = ('...'); // Type your 1st message here
Message2= ('...') // Type your 2nd message here (Only fill in if you need)
;Message3 = ('...'); // Type your 3rd message here (Only fill in if you need)
Time1 = 1000; // Wait time between each message (in Milliseconds)

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
program Auto;
{.include SRL/SRL.scar}
procedure DoAntiRandoms;
begin
FindTalk;
FindNormalRandoms;
if (FindFight = true) then
begin
RunAwayDirection('N');
Wait(1000+random(2000));
RunBack;
end;

procedure Write;
begin
repeat
Wait (Time1+random(2000))
TypeSend(Message1)
if NumberOfMessages = 2 then
begin
TypeSend(Message1)
Wait(Time1+random(2000))
TypeSend(Message2)
Wait (Time1+random(2000))
end;
if NumberOfMessages = 3 then
begin
TypeSend(Message1)
Wait(Time1+random(2000))
TypeSend(Message2)
Wait(Time1+random(2000))
TypeSend(Message3)
Wait(Time1+random(2000))
end;
until (False)
end;

begin;
SetupSRL;
Writeln ('Please do remember this is my first script')
Write;
end.

ss23

2007-12-05 23:19:53

You have program Auto; + program Autotalker;
As far as I knew, you cant have two in one program. My scar cant compile this either. What version of scar do you have?

souppy

2007-12-06 07:26:58

I have 3.12. I'll check and see if it works since I added one thing.

Sanjuro

2007-12-06 07:38:39

looks decent ill try it out later =]

souppy

2007-12-06 07:46:52

Thanks Sanj. I'm going to be fixing bugs and tweaking it later today.

Sir R. M8gic1an

2007-12-06 10:58:38


//Souppy's first auto talker
program Autotalker;
{.include SRL\SRL.scar}

const
NumberOfMessages = 3; // Number of Messages
Message1 = ('...'); { no need for the '(' and ')' }
Message2= ('...') {the ';' should be here}
;Message3 = ('...'); {!! the ';' should be on the line before }

Time1 = 1000; // Wait time between each message (in Milliseconds)

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
program Auto; {i'll put standards in, and also you don't need to rename the program }
{.include SRL/SRL.scar} {you already included this }
procedure DoAntiRandoms; {these aren't anti randoms, they're random solvers}
begin
FindTalk;
FindNormalRandoms;
if (FindFight = true) then
begin
RunAwayDirection('N');
Wait(1000+random(2000));
RunBack;
end;
{end; you need an end here}

procedure Write;
begin
repeat
Wait (Time1+random(2000))
TypeSend(Message1) {sending message }
if NumberOfMessages = 2 then
begin
TypeSend(Message1) {sending message 1 again! }
Wait(Time1+random(2000))
TypeSend(Message2)
Wait (Time1+random(2000))
end;
if NumberOfMessages = 3 then
begin
TypeSend(Message1) {sending message 1 again! }
Wait(Time1+random(2000))
TypeSend(Message2)
Wait(Time1+random(2000))
TypeSend(Message3)
Wait(Time1+random(2000))
end;
until (False) //you should never have an unbreakable loop

{we could shorten this, here's my suggestion:
repeat
if NumberOfMessages >= 1 then
begin
Wait (Time1+random(2000))
TypeSend(Message1)
end;
if NumberOfMessages >= 2 then
begin
TypeSend(Message2)
Wait (Time1+random(2000))
end;
if NumberOfMessages >= 3 then
begin
TypeSend(Message3)
Wait(Time1+random(2000))
end;
until (TimesWanted)
}

{
i also suggest you learn about Arrays, they look like message[0], message[1]
and that you you could use a for to do loop, or some other kind
of loop to make it say all the messages.
}
end;

begin;
SetupSRL;
Writeln ('Please do remember this is my first script')
Write;
end.

{ RMagician :) }

Commented ;) not bad for a first script :)
~RMagician

XRaye

2007-12-06 12:57:28

wow it even runs away if your in a fight?

XRaye

2007-12-06 12:58:44

and yea i would say that is very good for a first script

freedox

2007-12-07 13:12:14

Good script for start:)
Now you have learned the basic and you can make harder scripts now:)

Ollie A

2007-12-08 04:42:10

Well done, good script

Rs-Gp-4U

2007-12-08 10:00:25

You've got program twice? Shouldn't one be procedure?

cartoon

2007-12-09 13:41:45

Very good first script. im thinking of making an auto talker seems difficult. since im new at this