SRL Archive - First Scripts

First Script: PhatAlcher


PhatSound

2013-01-24 00:37:02

Hey there everyone, in my welcome post I said I had a script already uploaded and was waiting for a mod to approve it, either something went wrong or it wasn't approved so sorry about the delay!

Here is my First Script: PhatAlcher
It is a high/low alcher that currently notices when you run out of items to alch and know when you run out of runes, and includes antiban! Currently no amount has been set to alch, so you have to stop it manually, or run out of things and there is no proggy.

Intructions:
Have the items you are alching in the first inventory slot, and your nature runes anywhere else. The only problem is the nature runes sometimes get covered up by the cast high alchemy pop up so to be safe try only the first row.

That should about cover everything, So let's hear some feedback!

The Killer

2013-02-04 11:34:29

Just had a quick read, few things I would change
   for i := 1 to 1 do
repeat
if ExistsItem(i) then
MarkTime(Time);
begin
Writeln('There is something to alch');
Exit;
end;
until ExistsItem(i) or (TimeFromMark(Time)>2000);
is the main criticism, you have quite a few unnecessary code in there.
MarkTime(Time);
repeat
if ExistsItem(1) then
begin
Writeln('There is something to alch');
Exit;
end;
until TimeFromMark(Time)>2000;
For starters, you don't need the for…to..do loop as you only wish to loop in once.
Secondly, if you have until ExistsItem(i) and it finds the item then it will leave the loop and execute the next bit of code which is
Writeln('No items Third try, shutting down');
Wait(1000 + Random(500));
EndScript;
which will terminate your script even though it has found the item.

repeat
MainLoop;
until AllPlayersInactive;
is an infinitive loop as you never change players. And therefore the player will never be Inactive.


You could also add 6 hour support :), you could do this by adding:
SRL_SixHourFix := True;
SMART_FixSpeed := True;
in setup
and adding
If not loggedIn Then LoginPlayer;
in different places of your script.