SRL Archive - First Scripts

Clan Promoter


mysterious123

2010-02-28 16:58:11

This script does the following:

*Sets up your clan.
*Promotes your clan.

Features:

*Antiban (At a certain extent)

Though I do not recommend using it for hours…
But works like a charm for me =D
BTW, I tested it for 5 mins, a few people actually joined!!

I decided not to make my first script a leveler, so here it is, a clan promoter.
Please reply, I really need constructive comments if possible so I can improve.

Frement

2010-02-28 17:20:17

I made few changes regarding your talking:

{==============================================================================]
[ -CLAN PROMOTER! By mysterious123- ]
[==============================================================================]
[ Welcome to mysterious123's first script. This script promotes your clan. ]
[ (Don't worry if you haven't set the clan name and such, ]
[ just read the instructions.) ]
[==============================================================================]
[ -Instructions- ]
[==============================================================================]
[ Set Lines 35 To 37 & From 46 To 49. ]
[==============================================================================]
[ -Credits- ]
[==============================================================================]
[ ]
[ * Mixster - Guided me on IRC for hours. ]
[ ]
[==============================================================================}

program ClanPromoter;
{.include srl/srl.scar}
Var
x: Integer;
var TalkTSA: TStringArray;

Const
Runs=7;
Username=''; //Insert the username you wish to promote.
Clanname=''; //Insert the clan name.
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''; //Insert your Username
Pass := ''; //Insert your Password
Nick := ''; //Insert a 3-4 letter nickname
Active := True; //Since it's the only player, leave it True!
end;
end;

Procedure SetAnyonea; // Who can enter chat?
Var
posax,posay:Integer;
begin
Mouse(102,112,10,10,false); // Clicks on Who can enter chat?
GetMousePos(posax,posay);
Mouse(posax,posay+25,10,10,true); // Sets it to Anyone
end;

Procedure SetAnyoneb; // Who can talk in chat?
Var
posbx,posby:Integer;
begin
Mouse(125,152,10,10,false); // Clicks On Who can talk in chat?
GetMousePos(posbx,posby);
Mouse(posbx,posby+25,10,10,true); // Sets it to Anyone
end;

Procedure Setnameofclan; // Sets clan name
begin
Mouse(115,70,40,10,true);
Typesend(Clanname);
end;

Procedure SetUp; // Sets up the clan
Var
x,y:Integer;
begin
Wait(500 + random(1000))
GameTab(tab_Clan);
if FindColor(x,y,6619135,547,206,751,459) then //Checks if you are in a clan or not
begin
Mouse(591,436,20,20,true); // Clicks on Leave/Join
Wait(1000 + random(3000));
Mouse(591,436,20,20,true); // Clicks on Leave/Join
Wait(1000 + random(3000));
TypeSend(Username); // Joins your clan
Wait(1000 + random(3000));
end else
begin
Mouse(591,436,20,20,true); // Clicks on Leave/Join
Wait(1000 + random(3000));
TypeSend(Username);
Wait(1000 + random(3000));
end;
Mouse(682,442,20,20,true)
Wait(2000 + random(5000));
Setnameofclan;
Wait(2000 + random(5000));
SetAnyonea;
Wait(2000 + random(5000));
SetAnyoneb;
Mouse(487,42,3,4,true); //Closes clan setup
end;


Procedure Walk; // Randomly walks
begin
Wait(1000 + random(3000));
Mouse(260,159,50,50,true);
end;

procedure SetupTalk;
begin
TalkTSA := ['Join "' + Username + '" for the best clan!', 'Join "' + Username + '" for the best clan ever!',
'Join "' + Username + '" for the best clan ever!!!!', 'wave2: Join "' + Username + '" for the best clan ever!',
'cyan:shake: Join "' + Username + '" for the best clan ever!', 'Join "' + Username + '" for the best clan ever!',
'Join "' + Username + '" for the best clan ever!!', 'Join "' + Username + '" for the best clan ever!'];
end;

begin
x := 0;
ClearDebug;
SetupSRL;
SetupTalk;
DeclarePlayers;//Calls the procedure.
LoginPlayer;//Logs your player into the game.
SetAngle(True);
SetUp;
Repeat
case Random(13) of
0,9,10,11,12: Walk;
1: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
2: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
3: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
4: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
5: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
6: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
7: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
8: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
end;
Wait(1000 + random(3000))
x:=x+1;
until( x >= Runs );

end.
Saves the trouble of having so many different procedures.

Just some small things how i like to code, space after every comma, and True / False capitalized.

After begin indent for 2 spaces, after end continue as normal. Like this:
//You have:
Procedure Setnameofclan; // Sets clan name
begin
Mouse(115,70,40,10,true);
Typesend(Clanname);
end;

//I would recommend doing like:
Procedure Setnameofclan; // Sets clan name
begin
Mouse(115, 70, 40, 10, True);
Typesend(Clanname);
end;

Also, spaces between operators and conditions, like your until in the main:
until(x >= Runs);

Anyway, fixed up the whole script a little, take a look:
{==============================================================================]
[ -CLAN PROMOTER! By mysterious123- ]
[==============================================================================]
[ Welcome to mysterious123's first script. This script promotes your clan. ]
[ (Don't worry if you haven't set the clan name and such, ]
[ just read the instructions.) ]
[==============================================================================]
[ -Instructions- ]
[==============================================================================]
[ Set Lines 35 To 37 & From 46 To 49. ]
[==============================================================================]
[ -Credits- ]
[==============================================================================]
[ ]
[ * Mixster - Guided me on IRC for hours. ]
[ ]
[==============================================================================}

program ClanPromoter;
{.Include SRL/SRL.scar}

var x: Integer;
TalkTSA: TStringArray;

const Runs=7;
Username=''; //Insert the username you wish to promote.
Clanname=''; //Insert the clan name.

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''; //Insert your Username
Pass := ''; //Insert your Password
Nick := ''; //Insert a 3-4 letter nickname
Active := True; //Since it's the only player, leave it True!
end;
end;

Procedure SetAnyonea; // Who can enter chat?
var posax, posay: Integer;
begin
Mouse(102,112,10,10,false); // Clicks on Who can enter chat?
GetMousePos(posax,posay);
Mouse(posax,posay+25,10,10,true); // Sets it to Anyone
end;

procedure SetAnyoneb; // Who can talk in chat?
var posbx, posby: Integer;
begin
Mouse(125, 152, 10, 10, False); // Clicks On Who can talk in chat?
GetMousePos(posbx, posby);
Mouse(posbx, posby+25, 10, 10, True); // Sets it to Anyone
end;

procedure Setnameofclan; // Sets clan name
begin
Mouse(115, 70, 40, 10, True);
Typesend(Clanname);
end;

procedure SetUp; // Sets up the clan
var x,y:Integer;
begin
Wait(500 + Random(1000));
GameTab(tab_Clan);
if FindColor(x, y, 6619135, 547, 206, 751, 459) then begin //Checks if you are in a clan or not
Mouse(591, 436, 20, 20, True); // Clicks on Leave/Join
Wait(1000 + Random(3000));
Mouse(591, 436, 20, 20, True); // Clicks on Leave/Join
Wait(1000 + Random(3000));
TypeSend(Username); // Joins your clan
Wait(1000 + Random(3000));
end else begin
Mouse(591, 436, 20, 20, True); // Clicks on Leave/Join
Wait(1000 + Random(3000));
TypeSend(Username);
Wait(1000 + Random(3000));
end;
Mouse(682,442,20,20,true)
Wait(2000 + Random(5000));
Setnameofclan;
Wait(2000 + Random(5000));
SetAnyonea;
Wait(2000 + Random(5000));
SetAnyoneb;
Mouse(487, 42, 3, 4, True); //Closes clan setup
end;


Procedure Walk; // Randomly walks
begin
Wait(1000 + Random(3000));
Mouse(260, 159, 50, 50, True);
end;

procedure SetupTalk;
begin
TalkTSA := ['Join "' + Username + '" for the best clan!', 'Join "' + Username + '" for the best clan ever!',
'Join "' + Username + '" for the best clan ever!!!!', 'wave2: Join "' + Username + '" for the best clan ever!',
'cyan:shake: Join "' + Username + '" for the best clan ever!', 'Join "' + Username + '" for the best clan ever!',
'Join "' + Username + '" for the best clan ever!!', 'Join "' + Username + '" for the best clan ever!'];
end;

begin
x := 0;
ClearDebug;
SetupSRL;
SetupTalk;
DeclarePlayers; //Calls the procedure.
LoginPlayer; //Logs your player into the game.
SetAngle(True);
SetUp;
repeat
case Random(13) of
0, 9, 10, 11, 12: Walk;
1: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
2: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
3: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
4: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
5: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
6: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
7: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
8: TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );
end;
Wait(1000 + Random(3000))
Inc(x);
until(x >= Runs);
end.
Also, you had random() instead of Random(), write them as they are meant to write! :)

Anyways, nice script.

rya

2010-02-28 17:23:18

Looks good
A couple of tips reading over the code


x:=x+1;
Could be

Inc(X);
Inc is just adding one to what ever is in the parameters

Every thing seems to be based off blind clicks, it would be better to look for BitMaps or DTM as they are use full for later on when looking for things such as items in a bank

Also you are useing MoveWindMouse i cant remember why i was told not to use it but i think it was because it was too fast to be human or something, so i got told to use MMouse which looking has the same parameters as MoveWindMouse

But a good first script

Edit: Ninja ed
He has better aswell :)

Frement

2010-02-28 17:34:49

From: rya
Looks good
A couple of tips reading over the code


x:=x+1;
Could be

Inc(X);
Inc is just adding one to what ever is in the parameters

Every thing seems to be based off blind clicks, it would be better to look for BitMaps or DTM as they are use full for later on when looking for things such as items in a bank

Also you are useing MoveWindMouse i cant remember why i was told not to use it but i think it was because it was too fast to be human or something, so i got told to use MMouse which looking has the same parameters as MoveWindMouse

But a good first script

Edit: Ninja ed
He has better aswell :)


I dont think blind clicking matters at this kind of script, everything is in the same place everytime you open RS, atleast i think they are. Did not test the script in RS.

Oh and mysterious123, then begin, end else begin, everything on the same line :) Makes reading easier.

rya

2010-02-28 17:52:05

From: Frement
I dont think blind clicking matters at this kind of script, everything is in the same place everytime you open RS, atleast i think they are. Did not test the script in RS.
.

I mean like it makes it habit so you never use blind clicks which i hope you agree is a big No-No in most script
Also useful to know for later on

Frement

2010-02-28 18:05:31

From: rya
I mean like it makes it habit so you never use blind clicks which i hope you agree is a big No-No in most script
Also useful to know for later on


Yes, i strongy advice not to use and i agree with you, but did not mention in my feedback because of the type of the script.

mysterious123

2010-03-01 01:42:10

I thought about using bitmaps for the buttons, but I was told it was better not to in these scripts because not all people will be able to use it.
(Or something like that)

Can you explain this:

TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );

And what does TalkTSA do?

rya

2010-03-01 02:36:01

From: mysterious123
I thought about using bitmaps for the buttons, but I was told it was better not to in these scripts because not all people will be able to use it.
(Or something like that)

Can you explain this:

TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );

And what does TalkTSA do?


I'm not 100% but i thing it uses this Procedure
procedure SetupTalk;
begin
TalkTSA := ['Join "' + Username + '" for the best clan!', 'Join "' + Username + '" for the best clan ever!',
'Join "' + Username + '" for the best clan ever!!!!', 'wave2: Join "' + Username + '" for the best clan ever!',
'cyan:shake: Join "' + Username + '" for the best clan ever!', 'Join "' + Username + '" for the best clan ever!',
'Join "' + Username + '" for the best clan ever!!', 'Join "' + Username + '" for the best clan ever!'];
end;

This sets the var for TalkTSA so now we know TalkTSA is a var

TypeSend( TalkTSA[ Random( High( TalkTSA ) ) ] );

So TypeSend('') sends text right
() In here you put what you want to say
but we we have TalkTSA all ready set with what to say but as there are a couple of sayings set in TalkTSA,so we want a random one to say, done by Random and all (High(TalkTSA) is it takes the highest TalkTSA as the highest number that can come out of random

So TalkTSA[] = var thats a string you can call with [Random] to pick a saying set earler

Sorry if that sounds like blabal i just woke up