SRL Archive - First Scripts

my lame auto talker! soon to be with colors and atachments.=)


fingerband

2008-07-06 14:20:46

:f: ok so here is my lame talker lol i wanted to figure out how to make it use colors and junk like for example 'red:wave: auto talker!'. but it will only keep doing it in the stupid box on scar.=/ so im still learning this script is from a guide i had read im working on a awsome auto talker like i said before and i hope you like my first script that even a 2 year old could make ^-^ thanks fingerband

Mohism

2008-07-09 03:33:21

Worked alright, add colours ;)

The_Shermanator

2008-07-09 18:59:20

Good first script, you should add the colors/text movements and mabye make it so you could say more than one thing.

Keep it up tho:D

miny noob

2008-07-10 01:40:20

simple is best.

to make your autotalker type in runescape maybe you should try the command

TypeSend(Message1); {this says Talker}

jakestr

2008-07-10 08:46:38

nice, id much rather use something else considering its annoying to autotalk useing scar

Ashur2Good

2008-07-10 09:03:29

{
This a script in scar that will say
My talker!
Fixed by Ashur2Good
}


program newb;
{.include SRL/SRL.scar}

var
i : integer;
const
Message1='My talker!'; // First message to send
Message2='My talker!'; // Second message to send
messagestosend=2; // How many messages to send
messages = 100; // How many messages to completely send

procedure Talker;
begin
wait(100) // Waits for lag...
if(messagestosend = 0) then // If the messages = 0 then..
begin
Writeln(' Please enter a valid Number'); // A fail safe
TerminateScript;
end;
if (Message1 = ' ') then
begin
Wait(100);
Writeln('Please enter a valid Message');
TerminateScript;
end;
if(messagestosend > 1) then // If it's more then one message...
begin
Wait(500) // Waits for lag...
TypeSend(Message2); // Sends the first message
i:=i + 1;
end;
if(messagestosend > 2) then // If it's more then two messages...
begin
Wait(500) // Waits for lag...
TypeSend(Message2); // Sends the second message
i:=i + 1;
end;
end;


begin
repeat
Talker;
until(messages = i)
end.

Fixed a few things :)

First thing i did was add some more constants

Message1='My talker!'; // First message to send
Message2='My talker!'; // Second message to send
messagestosend=2; // How many messages to send
messages = 100; // How many messages to completely send

Read the comments for more :)

I also added some vars:
var
i : integer;

The integer will be used after to help us determine when to stop sending the messages :)

wait(100)  // Waits for lag...
if(messagestosend = 0) then // If the messages = 0 then..
begin
Writeln(' Please enter a valid Number'); // A fail safe
TerminateScript;
end;

I changed the wait to 100, 5 seconds is a pain :p
And also a fail safe, it checks if how many messages to send is 0, cause then it would do nothing. So it terminates the script and debugs a comment to the user.

if (Message1 = ' ') then
begin
Wait(100);
Writeln('Please enter a valid Message');
TerminateScript;
end;

This was the fail safe for the message, if it was nothing then it will say that. So this fail safe also terminates the script and debugs a message.


 if(messagestosend > 1) then   // If it's more then one message...
begin
Wait(500) // Waits for lag...
TypeSend(Message2); // Sends the first message
i:=i + 1;
end;

Now it checks the number of messages and sends it. See the :

  i:=i + 1;

Remember the integer? Well it's used here but also increases, you could just use inc but i like to the use the original way :)


  if(messagestosend > 2) then  // If it's more then two messages...
begin
Wait(500) // Waits for lag...
TypeSend(Message2); // Sends the second message
i:=i + 1;


This is the same as the previous bit but is the second message. Not much explaining here.

And now your Main Loop:

begin
repeat
Talker;
until(messages = i)
end.

See the:

 until(messages = i)

That integer that we kept adding on will be used here. When it's done enough messages that the user wished, it will stop. Before you had it going on for ever, that was a NO GO.

And also, one main thing you forgot at the top.

{.include SRL/SRL.scar}

What's the point of going to the SRL forums if you don't include the SRL include? :p

Hope that helped

-Ashur