PDA

View Full Version : Noob to semi-pro



Sir R. M8gic1an
09-11-2007, 06:07 PM
From Noob to semi-Pro

Hi, I'm Rasta Magician
and this is my first tut, hope it helps someone out ;)


Ok, I decided to make this tutorial based on an auto-talker. Many people make auto-talkers as first scripts, because they are rather simple and easy to make;
And with so many of them running around it’s easy to pick up on how to do it.

to those who don’t know anything about scripting yet, you'd be better off checking a first script tutorial first ;)


I went to First Scripts section and wrote a similar script to the ones over there.


//To use this program simply replace the text with your own phrases.
//Press Go
//Hope you talk like a bloody parrot :)

program Parrotizer;
{.include SRL/SRL.scar}
Const
Message1 ='Please Replace This With Your Own Text!';
Message2 ='Please Replace This With Your Own Text!';
Message3 ='Please Replace This With Your Own Text!';
Message4 ='Please Replace This With Your Own Text!';
Message5 ='Please Replace This With Your Own Text!';

begin
repeat
TypeSend (Message1);
TypeSend (Message2);
TypeSend (Message3);
TypeSend (Message4);
TypeSend (Message5);
until (isfkeydown(12));
end.



Easy right? ;) First thing to becoming a better scripter and that is super easy to learn is standarts.

begin
-->repeat
----->TypeSend (Message1);
----->TypeSend (Message2);
----->TypeSend (Message3);
----->TypeSend (Message4);
----->TypeSend (Message5);
-->until (isfkeydown(12));
end.


notice how repeat and until are aligned? That makes it easier on the eye to find out where it starts repeat and where it stops. Also notice that they’re a lil more forward than “begin” and “end”, this means they’re inside this procedure, dependant of it.

Now let’s imagine I want to add a sixth message…that wouldn’t take me much work on this small script, but imagine a big script like many of those around here… a total pain in the bottom :S
I wish it was way easier...and it can be!
Use an array, an x variable and a loop and our problem is fixed! :)
//the x array is already included in srl.

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

var
mensagem array[0..2] of string;
// mensagem array[0..3] of string;
{ the comment above is what you'd change the line to if
you wanted to add another message }
const
howManyMessages = 3;

procedure setMessages;
begin
mensagem[0] := 'my first message';
mensagem[1] := 'Another Message';
mensagem[2] := 'One More';
// mensagem[3] := 'this is how you'd add another message';
end;


begin // main loop
repeat
begin
for x := 0 to howManyMessages-1 do
begin
typeSend(mensagem[x]);
end;
end;
until(isFKeyDown(12));
end.

*mensagem is the portuguese word for message, i used it because apparently "message" has a preset meaning for scar.

ok, so this way we can easily add more messages. Yey! :D
You might have noticed the use of “Const howManyMessages = 3” but the array is only 0 – 2.. well 0 counts as a message too, and in the main loop we have howManyMessages –1 to match it with the array.

We have a little detectability problem here, basically this will repeat all the messages one after the other, non-stop until you press F12…
Well you’ll look like a crazy person who can’t stop typing, nothing wrong with that, right? WRONG.
Let’s add a little wait there, to look more natural

for x := 0 to howManyMessages do
-->begin
---->typeSend(mensagem[x]);
---->wait(1000+Random(500)); //miliseconds
-->end;

why the Random(500) there? Because if you always waited 1sec before typing again you’re a machine. Not a single person could wait exactly a second each time, so the random 500 makes it a little more human.

Well now we can talk as much as we want, say as many thigns as we want and our script looks nice :) not bad huh? if you got his far you can pat yourselves on the back ;)

but is this semi-pro? No, not even close to it :o this would be the work of an ok noob. still better than the first script we had, but it's just a basic auto talker.

How will we get this to semi-pro level? well we keep on upgrading! we can have typing speeds, typos, say the messages in random order. We could start to turn it into a real p to p merchant!

And if we do turn it into a player to player merchant then that would most likely meet the minimums for srl membership!

And here i'll try to teach you exactly how to do it ;)
but if i do get to teach all the steps, don't bother submitting it, because then anyone who read this tut would be able to do one.

here's the different speeds part
procedure SendKeysWait(Text: string; tWait, tRandom: Integer);

Let’s add:

program SpeedTyping;
Const
speed = 5; //1 is humanish, 5 is super fast
var
wait: integer;

procedure getspeed;
begin
case speed of
1: wait := 100;
2: wait := 50;
3: wait := 25;
4: wait := 14;
5: wait := 5;
end;
end;

begin
ClearDebug;
getspeed;
SendKeysWait('lets see how fast I can go!', wait, 5);
end.



I’m still writing the rest,
~RMagician :D

Sir R. M8gic1an
09-11-2007, 06:09 PM
reserved

shaunthasheep
09-11-2007, 06:32 PM
You don't have standards quite down.... it would be:

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

var
mensagem array[0..2] of string;
const
howManyMessages = 3;

procedure setMessages;
begin
mensagem[0] := 'my first message';
mensagem[1] := 'Another Message';
mensagem[2] := 'One More';
end;

// to add more messages do mensagem[NUMBHERE] and change message array[0..2] to the desired number
// also change the constant

begin // main loop
repeat
for x := 0 to howManyMessages-1 do
begin
typeSend(mensagem[x]);
end;
until(isFKeyDown(12));
end.

Sir R. M8gic1an
09-11-2007, 06:39 PM
thank you :) i'll correct that ;)
edit: just added the speed part, I'll add any needed explanation to it later/ tomorow

HyperSecret
09-11-2007, 07:30 PM
another thing is that you dont have Var x: integer; actually defined so that wouldnt work at all...lol :duh:

and also you should add how to put a 4th message to the array also. explain that it needs to be

var[next#] and all that and also add that you have to edit the var of the array [0..2] also and go into that

b/c your not
ok, so this way we can easily add more messages. Yey! all your doing is making it an array and condensing it alittle

Sir R. M8gic1an
09-11-2007, 08:02 PM
another thing is that you dont have Var x: integer; actually defined so that wouldnt work at all...lol :duh:


when i added var x:integer; it told me it was a double identifier. so i took it out and it compiled. therefore i assumed x was already declared in srl. which btw i left as a comment right over the scar box where that script is :)
tkx for the other suggestion.

edit:
did you mean this?

// to add more messages do mensagem[NUMBHERE] and change message array[0..2] to the desired number
// also change the constant

do you think i should make that clearer? because it's been there since the beginning, but you seem to have overlooked it..

re-edit: made it clearer. :) (i hope :P)

~RM