Marpis, Cast() isn't working.
Made a few changes. Progress report is right now (you had the experience flip flopped), changed the wait as it gave false reports, and made a simple function to replace Cast().
program Alcher;
{$Define SMART}
{$i SRL/SRL.scar}
{$i SRL/SRL/skill/Magic.scar}
{
INSTRUCTIONS
o Works with both runes and staff
o Set up asked information below
o Don't leave the script alone before seeing it works
o Inventory slot numbering below
1 2 3 4
5 6 7 8
9 .......
..........
........28
o To avoid useless mouse movements, please have your alched items in
the bottom half of the inventory, for example in the slot 23.
}
const
CastsBeforeChange = 250; // Casts before changing players?
procedure DeclarePlayers;
begin
NumberOfPlayers(1); // Number of players?
SMART_Server := 64; // World number?
SMART_Signed := True; // Signed? False will cause lag.
SMART_Members := True;
SMART_SuperDetail := False;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Booleans[0] := True; // True = High-alch, False = Low-alch
Integers[1] := 1; // Inventory item to alch
Integers[2] := 5000; //Casts to do
end;
{
with Players[1] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Booleans[0] := True; // True = High-alch, False = Low-alch
Integers[1] := 1; // Inventory item to alch
Integers[2] := 5000; //Casts to do
end;
with Players[2] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Booleans[0] := True; // True = High-alch, False = Low-alch
Integers[1] := 1; // Inventory item to alch
Integers[2] := 5000; //Casts to do
end;
}
end;
// Do not change anything below.
function MyCast(Spell: String): Boolean;
begin
Result := False;
case Spell of
'high level alchemy': begin
if(GetColor(698, 351) = 5561068)then
begin
MouseBox(684, 339, 705, 356, 1);
Result := True;
Exit;
end;
end;
'low level alchemy': begin
if(GetColor(617, 279) = 5561068)then
begin
MouseBox(616, 270, 631, 285, 1);
Result := True;
Exit;
end;
end;
end;
end;
function CastAlch: Boolean;
var
AlchLevel: string;
begin
FindNonInventoryRandoms;
if (Players[CurrentPlayer].Booleans[0]) then
AlchLevel := 'high level alchemy'
else
AlchLevel := 'low level alchemy';
if MyCast(AlchLevel) then
begin
Inc(Players[CurrentPlayer].Integers[0]);
if (not ExistsItem(Players[CurrentPlayer].Integers[1])) then
Exit;
MouseItem(Players[CurrentPlayer].Integers[1], True);
Wait(1500 + Random(250));
Result := True;
end;
end;
procedure ProgressReport;
var
xph: integer;
begin
ClearDebug;
WriteLn('~ SRL - Alcher 1.0 ~');
with Players[CurrentPlayer] do
begin
WriteLn(' Exp per cast : '+FloatToStr(Extendeds[0]));
WriteLn(' Casted : '+IntToStr(Integers[0]));
WriteLn(' Total xp : '+FloatToStr(Extendeds[0] * Integers[0]));
xph := Round((Extendeds[0] * Integers[0]) / (GetTimeRunning / 3600000.0));
WriteLn(' XP per hour : '+IntToStr(xph));
WriteLn(' Time running : '+TimeRunning);
end;
WriteLn('~ by: marpis ~');
end;
begin
DeclarePlayers;
SetupSRL;
SetSpellMode(True, True, True, True);
SortBook(BookSort_Level);
if Players[CurrentPlayer].Booleans[0] then // Experience points
Players[CurrentPlayer].Extendeds[0] := 65.0
else
Players[CurrentPlayer].Extendeds[0] := 31.0;
if not LoggedIn then LoginPlayer;
SetAngle(True);
repeat
if not CastAlch then
begin
WriteLn('Player '+IntToStr(CurrentPlayer)+'Worked for '+TimeRunning);
if (HowManyPlayers > 1) then
NextPlayer(False)
else
begin
LogOut;
TerminateScript;
end;
end;
if (HowManyPlayers > 1) and (Players[CurrentPlayer].Integers[0] mod CastsBeforeChange = 0) then
NextPlayer(True);
ProgressReport;
until Players[CurrentPlayer].Integers[0] >= Players[CurrentPlayer].Integers[2];
end.
Short proggy.
~ SRL - Alcher 1.0 ~
Exp per cast : 65
Casted : 8
Total xp : 520
XP per hour : 66409
Time running : 28 Seconds
~ by: marpis ~
Successfully executed.
And the xp per hour is wrong because I had the waits a lot longer. Changed them to be shorter. :)