I made one just because I wanted to try out my mage sorting spells;
program new;
{$i srl/srl.simba}
const
// Valid Use:
// 'sapphire' or 'emerald' or 'ruby' or 'diamond' or 'dragon' or 'onyx'
magic_spell_string = '';
ItemsStart = 3; // the first slot in your inventory that isn't occupied by runes to cast the spell.
bankLoc = 'fwb';
{ *** Valid Bank Booth Locations Below ***
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)
'eb' (Edgeville Bank)
'lb' (Lumbridge Bank)
'ctb' (Catherby bank)
'clt' (Camelot bank)
'nab' (North Ardougne bank)
'sab' (South Ardougne bank)
'ynb' (Yanille bank)
'ngb' (North gnome bank)
'sgb' (South gnome bank)
'wgb' (Warrior guild bank)
'fgb' (Fishing guild bank)
*** If using bank chests, see the Players info, DeclarePlayers *** }
var
firstLoop: Integer; // for the first loop.
mXP: Integer; // Mage XP Gained.
itemM: Integer; // Total Items Enchanted/Total Items Made.
rWithdrawArr: Array of Integer; // Used to withdraw a randomized amount.
procedure DeclarePlayers;
begin
HowManyPlayers := 3; // Default max is 100.
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Active := True;
WorldInfo := [True, 85]; // Actual world you login on RS
// Set boolean to TRUE if you want to bank with a chest location instead of
// a banker or booth location.
Booleans[0] := False;
Integers[0] := SRL_BANK_SW;
{* SRL_BANK_SW (Soul Wars Bank)
* SRL_BANK_CW (Castle Wars Bank)
* SRL_BANK_B (Burthrope Bank)}
Banked := 0;
end;
with Players[1] do
begin
Name := '';
Pass := '';
Active := True;
WorldInfo := [True, 85];
Booleans[0] := False;
Integers[0] := SRL_BANK_SW;
Banked := 0;
end;
with Players[2] do
begin
Name := '';
Pass := '';
Active := True;
WorldInfo := [True, 85];
Booleans[0] := False;
Integers[0] := SRL_BANK_SW;
Banked := 0;
end;
end;
procedure SetupGlobals();
begin
rWithdrawArr := [-1, 0, 100];
firstLoop := 0;
end;
procedure SetupScript();
begin
ClearDebug;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Wait(RandomRange(200, 6000));
CompassMovement(30, 150, false);
Wait(RandomRange(100, 1500));
if Players[CurrentPlayer].Booleans[0] then
MakeCompass('W');
FindNormalRandoms;
SetAngle(SRL_ANGLE_HIGH);
Wait(RandomRange(400, 600));
Wait(RandomRange(100, 3000));
ChatsOff;
ExitSquealOfFortune;
waitfunc(@ExitSquealOfFortune, 250, 2500);
end;
// A home brewed function that works in place of a @WaitFunc,
// so we know that the bulk of our items get deposited.
// Example = Deposit all our materials, except for runes..
function MostIsDeposited: boolean;
var
t: integer;
begin
result := false;
MarkTime(t);
while (InvCount > 5) do
begin
if (TimeFromMark(t)>=10000) then
exit;
wait(100+random(1000));
end;
if (InvCount < 5) then
result := true;
end;
function OrganizeSpellBook(Spells:String; FilterOrder:TBoolArray): boolean;
var
i,cc: integer;
indexBool: array of boolean;
begin
result := false;
if not loggedin then
exit;
if (GetCurrentTab <> tab_magic) then
GameTab(tab_magic);
case Spells of
'regular':
begin
if (Length(FilterOrder) <> 4) then
begin
SRL_Warn('OrganizeSpellBook', 'Faulty amount of True/False in TBoolArray', Warn_AllVersions);
exit;
end;
SetLength(indexBool, 4);
for i := 0 to 3 do
begin
cc := CountColorTolerance(16711422, MIX1+35+(i*21), MIY2-31, MIX1+56+(i*21), MIY2-1, 1);
if (inRange(cc, 75, 78)) then
indexBool[i] := True;
if (not FilterOrder[i]) and indexBool[i] then
begin
MouseBox(MIX1+35+(i*21), MIY2-31, MIX1+56+(i*21), MIY2-1, mouse_left);
result := true;
end else
if FilterOrder[i] and (not indexBool[i]) then
begin
MouseBox(MIX1+35+(i*21), MIY2-31, MIX1+56+(i*21), MIY2-1, mouse_left);
result := true;
end;
end;
end;
'lunar':
begin
if (Length(FilterOrder) <> 3) then
begin
SRL_Warn('OrganizeSpellBook', 'Faulty amount of True/False in TBoolArray', Warn_AllVersions);
exit;
end;
SetLength(indexBool, 3);
for i := 0 to 2 do
begin
cc := CountColorTolerance(16711422, MIX1+37+(i*27), MIY2-31, MIX1+64+(i*27), MIY2-1, 1);
if (inRange(cc, 75, 78)) then
indexBool[i] := True;
if (not FilterOrder[i]) and indexBool[i] then
begin
MouseBox(MIX1+37+(i*27), MIY2-31, MIX1+64+(i*27), MIY2-1, mouse_left);
result := true;
end else
if FilterOrder[i] and (not indexBool[i]) then
begin
MouseBox(MIX1+37+(i*27), MIY2-31, MIX1+64+(i*27), MIY2-1, mouse_left);
result := true;
end;
end;
end;
'ancient':
begin
if (Length(FilterOrder) <> 2) then
begin
SRL_Warn('OrganizeSpellBook', 'Faulty amount of True/False in TBoolArray', Warn_AllVersions);
exit;
end;
SetLength(indexBool, 2);
for i := 0 to 1 do
begin
cc := CountColorTolerance(16711422, MIX1+49+(i*36), MIY2-31, MIX1+84+(i*36), MIY2-1, 1);
writeln(cc);
if (inRange(cc, 75, 78)) then
indexBool[i] := True;
if (not FilterOrder[i]) and indexBool[i] then
begin
MouseBox(MIX1+49+(i*36), MIY2-31, MIX1+69+(i*36), MIY2-1, mouse_left);
result := true;
end else
if FilterOrder[i] and (not indexBool[i]) then
begin
MouseBox(MIX1+49+(i*36), MIY2-31, MIX1+69+(i*36), MIY2-1, mouse_left);
result := true;
end;
end;
end;
end;
end;
function ClickStaticSpell(which:string): boolean;
var
aPt: TPoint;
begin
result := false;
if not loggedin then
exit;
if not OrganizeSpellBook('regular', [false,false,true,true]) then
exit;
case which of
'sapphire': aPt := Point(MIX1+50, MIY1+25);
'emerald' : aPt := Point(MIX1+112, MIY1+25);
'ruby' : aPt := Point(MIX1+27, MIY1+48);
'diamond' : aPt := Point(MIX1+99, MIY1+48);
'dragon' : aPt := Point(MIX1+50, MIY1+72);
'onyx' : aPt := Point(MIX1+75, MIY1+72);
else
aPt := Point(-1,-1);
end;
if (aPt.x>1) and (aPt.y>1) then
MMouse(aPt.x, aPt.y, 5, 5);
if WaitUptextMulti(['st Lvl-', 'Enchant', 'Cast Lvl-'], 1000) then
begin
ClickMouse2(mouse_left);
result := true;
end;
end;
procedure antiban();
begin
case Random(1500) of
0..1: PickupMouse;
200: IdleTime(500, 500, 5);
300: SleepAndMoveMouse(1500);
400: RandomRClick;
500: ExamineInv;
end;
end;
function IncSpellXP(which:string): integer;
begin
case which of
'sapphire': result := 18;
'emerald' : result := 37;
'ruby' : result := 59;
'diamond' : result := 67;
'dragon' : result := 78;
'onyx' : result := 97;
end;
end;
function Banking(): boolean;
var
i: integer;
begin
result := false;
if not loggedin then
exit;
antiban();
for i := 0 to 2 do
begin
if Players[CurrentPlayer].Booleans[0] then
begin
OpenBankChest(Players[CurrentPlayer].Integers[0]);
if (BankScreen) or (PinScreen) then
break;
end else
begin
OpenBank(bankLoc, false, false);
if (BankScreen) or (PinScreen) then
break;
end;
end;
antiban();
for i := 0 to 2 do
begin
if (PinScreen) then
InPin(Players[CurrentPlayer].Pin);
if (BankScreen) then
break;
end;
antiban();
if (BankScreen) then
begin
Deposit(5+random(7), 13+random(12), true);
IncEx(Players[CurrentPlayer].Banked, 1);
MostIsDeposited;
FindNormalRandoms;
Withdraw(9,0,rWithdrawArr[random(3)]);
WaitFunc(@CloseBank,100,1000);
result := not BankScreen;
end;
end;
function Twilight_Sparkling(StartSlot:integer): boolean;
var
i, a: integer;
pattern1, pattern2: array of integer;
begin
result := false;
if not loggedin then
exit;
antiban();
if (firstLoop = 0) then
begin
Writeln('Yay we''re sparkling,');
Writeln('Bestest last new twilight movie comes out NEXT MONTH!!!');
Writeln('Imprint, WTF!!!');
end;
for i := StartSlot to 28 do
begin
if ClickStaticSpell(magic_spell_string) then
begin
mouseitem(i, mouse_lefT);
incex(itemM, 1);
incex(mXP, IncSpellXP(magic_spell_string));
wait(750+random(1000));
end;
end;
IncEx(firstLoop, 1);
end;
procedure ProgressReport();
var
xpH, iHr: Int64; // Xp per Hr, Items per Hr
begin
ClearDebug;
xpH := Round((mXP*3600)/(GetTimeRunning/1000));
iHr := Round((itemM*3600)/(GetTimeRunning/1000));
Writeln(' Time Running: '+MsToTime(Integer(GetTimeRunning),time_formal));
Writeln(' Magic XP Gain: '+GroupDigits(mXP,',')+' ('+ToStr(xpH)+' xp/hr)');
Writeln(' Items Done: '+GroupDigits(itemM, ',')+' ('+ToStr(iHr)+' made/hr)');
Writeln(' Current Player:'+ToStr(Players[CurrentPlayer])+' of '
+ ToStr(HowManyPlayers)+'.');
Writeln(' Current Player Times Banked: ' + ToStr(Players[CurrentPlayer].Banked));
end;
// Main Loop for the script!
procedure main_loop;
var
t, Random6hr: integer;
begin
WriteLn('Starting the main loop');
MarkTime(t);
Random6hr := RandomRange(21600000, 22500000);//(6hr, 6hr 15mins)
repeat
if not LoggedIn then
NextPlayer(True);
if (TimeFromMark(t)>=Random6hr) then
exit;
Banking();
Twilight_Sparkling(ItemsStart);
ProgressReport;
until(not loggedin);
end;
procedure ArnoldTerminate();
begin
Writeln('Ciao');
TerminateScript;
end;
begin
{$IFDEF SMART}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
SetupSRL;
SRL_Procs[srl_InNextPlayerLoop] := @ArnoldTerminate;
SRL_Procs[srl_OnNextPlayer] := @SetupScript;
SetupGlobals();
SetupScript();
repeat
main_loop;
if not loggedin then
LoginPlayer;
until(not loggedin);
ArnoldTerminate();
end.
just a simple invent slot 4,5,6…28 type of pattern.
haven't tested it at all, so duno if it's a usable script.
Cheers
Lj