SRL Archive - First Scripts

2 New functions for the community =]


Drakan

2008-05-09 20:13:32

Well I don't want to be a leecher, so I made two pretty handy dandy functions for srl. Unfortunately the place I am supposed to submit these isnt open to Registered users.:duh: So I decided to place them where they will be tested and reviewed by people, so I chose here =]

Anyway please note, these are all my work, and I don't want them leeched or posted anywhere else w/o my permission. Thanks =]

This first function I don't even know if one existed. I looked but I didn't really see anything. (I didn't look that hard :p). This function will return the number of Active players if any. It will return 0 if there is none and writeln that there are no more active users. I'm sure there is one out there but meh. I been learning about 'for' statements and this really put what I learned to the test.
{*******************************************************************************
function ActivePlayers: integer;
By: The[Cheese] and HyperSecret
Description: Finds out how many players are currently active. If none, then
returns zero and debugs 'All Players Inactive!'.
*******************************************************************************}
function ActivePlayers: integer;
var
i, HowManyActive: integer;
begin
HowManyActive := 0;
for i:=0 to High(Players) do
if (Players[i].active) then
Inc(HowManyActive)
else WriteLn('All Players Inactive!');

Result := HowManyActive;
WriteLn('There are ' + inttostr(HowManyActive) + ' players active.');
end;

This next one is a great little tool for mining scripts that bank. I'm almost positive there isn't one of these ;). What this does is go through (using my handy dandy 'for' statements i've been learning) and check to see if a slot has an item. It will then mouse over to check if its a pick or not. If its not, then it will deposit all of that item. Basically it deposits everything but your picks.
{*******************************************************************************
procedure MinersDeposit;
By: The[Cheese]
Description: This aMaZiNg funtion will deposit everything but your picks. It
will deposit broken picks too.
*******************************************************************************}
procedure MinersDeposit;
var i: integer;
begin
for i := 1 to 28 do
begin
if(ExistsItem(i))then
begin
MMouseItem(i);
if(IsUpTextMultiCustom(['roken', 'Brok']))then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, false);
wait(150 + Random(200));
ChooseOption('All');
wait(150 + Random(200));
end;
if not(IsUpTextMultiCustom(['pic', 'ick', 'pick', 'pickaxe', 'kaxe', 'axe'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, false);
wait(150 + Random(200));
ChooseOption('All');
wait(150 + Random(200));
end;
wait(500 + Random(250));
end;
end;
end;


Please tell me what you think, and post any errors. Thanks!

~[Cheese]

smithsps

2008-05-09 20:45:05

I'm sure the bottom one has been made. But the top one I'm not sure.

But VERY NICE SCRIPTS!
I probably couldn't do better.

HyperSecret

2008-05-09 20:45:45

the first one is used in many scripts already ;)

shortened and made alittle faster :D


function ActivePlayers: integer;
var
i, HowManyActive: integer;
begin
HowManyActive := 0;
for i:=0 to High(Players) do
if (Players[i].active) then
Inc(HowManyActive)
else WriteLn('All Players Inactive!');

Result := HowManyActive;
WriteLn('There are ' + inttostr(HowManyActive) + ' players active.');
end;

andrewrox424

2008-05-09 21:12:36

From: HyperSecret
the first one is used in many scripts already ;)


Good work for trying though. If you didn't take these and put your name on it :p.

Drakan

2008-05-09 21:15:30

Thanks for the input, and for the update Hyper =]
creds to you :D

BTW is ActivePlayers actualy in the SRL includes? Because I couldnt find it.

Nava2

2008-05-10 21:40:16

{*******************************************************************************
function DepositAllBut(Title: Array of Strings);
By: The[Cheese] and Nava2
Description: This aMaZiNg funtion will deposit everything but items specified. It will deposit broken picks too.
*******************************************************************************}
procedure DepositAllBut;
var i: integer;
begin
for i := 1 to 28 do
begin
if(ExistsItem(i))then
begin
MMouseItem(i);
if not(IsUpTextMultiCustom([Title])) then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, false);
wait(150 + Random(200));
ChooseOption('All');
wait(150 + Random(200));
end;
wait(500 + Random(250));
end;
end;
end;

Edited into a procedure which will be useful to any; not sure if it compiles but yeah :)

The array of Strings allows someone to put in any uptext to search for… I doubt that procedure works but yeah its a start and more customizable. :D

Nava2