SCAR Code:
{*--------------*--------------*--------------*--------------*----------------*}
{* _ _ ____ _ _ ____ ____ ____ _ ____ ____ _ _ ___ *}
{* |_/ |__| | | |___ [__ |__| | |__/ |__| |\ | | \ *}
{* | \_ | | \/ |___ ___] | | | | \ | | | \| |__/ *}
{* ____ ____ ____ ___ _ _ ___ ____ ____ ____ ___ ____ ____ *}
{* |___ |__| |__/ | |__| | |__/ |__| |___ | |___ |__/ *}
{* |___ | | | \ | | | |___ | \ | | | | |___ | \ *}
{*--------------*--------------*--------------*--------------*----------------*}
{*This script will go from Falador East Bank, with ess, to the Air Altar, *}
{*craft them, and then return. Also, it will now go from Varrock East Bank, *}
{*with ess, to the Earth Altar, craft them, and then return. Only help I had *}
{*on this was looking at Alex's Air Crafter to get an idea of how it should *}
{*work and a few things I point out in the code. *}
{*--------------*--------------*--------------*--------------*----------------*}
{* _ _ _ __ ___ *}
{* | | | | (_) / | / | *}
{* | | | | ___ _ __ ___ _ ___ _ __ `| | / /| | *}
{* | | | |/ _ \ '__/ __| |/ _ \| '_ \ | | / /_| | *}
{* \ \_/ / __/ | \__ \ | (_) | | | | _| |_\___ | *}
{* \___/ \___|_| |___/_|\___/|_| |_| \___(_) |_/ *}
{* *}
{*--------------*--------------*--------------*--------------*----------------*}
{* +-+-+-+ +-+-+-+-+-+-+ +-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+ *}
{* |R|U|N| |S|C|R|I|P|T| |W|I|T|H| |T|H|E|S|E| |P|A|R|A|M|E|T|E|R|S| *}
{* +-+-+-+ +-+-+-+-+-+-+ +-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+ *}
{* ESSENCE IN ANY TOP BANK SLOT *}
{* BE WEARING A TIARA *}
{* AT 32 BIT COLOR *}
{* ON LOW DETAIL *}
{*--------------*--------------*--------------*--------------*----------------*}
program Air_and_Earth_Crafter;
{.include SRL\SRL.scar}
{.include SRL\SRL\extended\xBitMap.scar}
{.include SRL\SRL\skill\RuneCrafting.scar}
var
MSMystery,EarthAltar,AirAltar,Rune,Tree,MessedUp,Level:Integer;
i,x,y,UsedEss,EssToDo,RunesMade,RunesPerEss,Cur:Integer;
ExpPlus,ExpPerEss:Extended;
RuneToCraft:String;
const
YourSRLID = '0000'; //SRL STATS ID
YourSRLPassword = '0000'; //SRL STATS PASSWORD
Procedure DeclarePlayers;
begin
HowManyPlayers :=1; //How many players total are you using?
NumberOfPlayers(HowManyPlayers); //DONT TOUCH!
CurrentPlayer:=0; //What character to start on
Players[0].Name :='1234'; //Character name
Players[0].Pass :='1234'; //Character password
Players[0].Nick :='234'; //3-4 letters of name
Players[0].Pin := 1234; //Bank Pin
Players[0].Loc :='In Bank'; //DONT TOUCH!
Players[0].Integers[0] := 112; //Amount of essence to use
Players[0].Strings[0] := 'Air' //Rune Type('Air','Earth')
Players[0].Active := True; //Using this player?
end;
procedure DeclareIMG;
begin
//DTMs
Rune := DTMFromString('78DA63CC60606068674001D121210CFF81342' +
'310FF0702C6324C3510591809A4A38044070135E940620A013585' +
'40A29A809A22203191809A1820D18F5F0D00E2FF0CB6');
Tree := DTMFromString('78DA634C66626088634001A19E120CFF81342' +
'310FF0702C624A09A585435CE990A609A11CA674C21524D3CA65D' +
'286A9230D55839C9A2AA4926C29C6422DC9384E977AC6E26A0060' +
'09C1F12A0');
//BMPs
MSMystery := BitmapFromString2(False, 'a744F378DA8D8E4112C' +
'4200804BF841066F4A889F9FF93764CB2A93D2E962D058D6AF68D' +
'0921CBB158E3CDAB35917D553836112357DEFCED46AEBCC45C1CC' +
'EC404B523A9738389962470A2DEAF85F9E1F5AA43262E6743E1B6' +
'661FC765F5089983644167A563286B88C7E901AD8B9E1EE5540F0' +
'8A6ACC7F1E9FA9437F5ED9ED56D86A60FD51FA739CB5966D93154' +
'4F7606F69BF6777C00796');
EarthAltar := BitmapFromString2(False, 'a9855A78DA7D504B72C' +
'5200CBB126099CF32F092FB1FE9490E6DD24D9941F60859B64929' +
'E55213CF29B425749CC46A4BE85DCC94C4BA783FFBC3BF94A5438' +
'C2BF74B3EB5A80AC395B74C6C43549B52D6F081075FD6C3BF94B9' +
'999C8FC38655CB4811CFC060EE9C3C238CF16397752BC88C47DC6' +
'6AA6E3B0F44055030D15973A0DB0553DDC66C8B15833E956AF55D' +
'F2865E0640CDD8B9B16FA793FA4F6A3B3E18F0ADF91F9D5507D52' +
'5E6D41E8137BF736AD97792CB9C39DBDCC80EB1E18733BE907356' +
'4ED3E8B9DEFEDBE766B479A2CE196FBCF5DA62FE5651BF67509F4' +
'9C5493E9077FDE0E663EBF85B0F05FE28F5930FC3D72F274');
//FROM ALEX'S AIR CRAFTER
AirAltar := BitmapFromString(8, 10, 'z78DA658E510E03210844' +
'AF4414D8EDAF35BDFF910A1D14DCC6F024300C0809F1B078F1C59' +
'D7BFF58BCFBB0D0A046A5B5D966554283EE31A5F9A03F898DB9D7' +
'D8D9B3C5AB9024DE6336DCCA14C167F3D8181E43496E110B32168' +
'7FF3B7103F43FAABA6A3E2A2BDFB41F1CBB7E4E65C5E89778EE7A' +
'5CB5BAF0A9FAF48CFBEFF429DBA15174BF253E63E5');
end;
//WT-Fakawi
procedure FindRandoms;
var
i: Integer;
begin
Status('Finding Randoms...');
for i := 1 to 11 do
begin
case i of
1: FindTalk;
2: FindDead;
3: FindMod;
4: FindMime;
5: FindMaze;
6: FindQuiz;
7: FindDemon;
8: FindTalk;
9: FindLamp('runecrafting');
10: if FindBox then
begin
if not(SolveBox) then GambleBox;
end;
11: if FindFight then
begin
RunAwayDirection('N');
Wait(10000 + random(2000));
RunBack;
end;
end;
wait(10);
end;
end;
procedure Report;
begin
if not(LoggedIn) then exit;
ClearDebug;
SRLRandomsReport;
WriteLn('<>--------------------<>--------------------<> ');
WriteLn(' Kaves Air and Earth Crafter ');
WriteLn(' Running Time: ' +(TimeRunning)+ ' ');
WriteLn(' Essence Used: ' +(IntToStr(UsedEss))+ ' ');
WriteLn(' '+RuneToCraft+'s Crafted: '+(IntToStr(RunesMade))+' ');
WriteLn(' My Location Is: ' +Players[CurrentPlayer].Loc+ ' ');
WriteLn(' Banked ' +IntToStr(Players[0].Banked)+ ' times. ');
WriteLn(' Gained ' +IntToStr(Level)+ ' levels. ');
WriteLn(' Experience Gained: ' +(FloatToStr(ExpPlus))+ ' ');
WriteLn(' Runecrafting Level: '+(IntToStr(Players[0].Level[7]))+ '');
WriteLn('<>--------------------<>--------------------<> ');
end;
//SRL team i suppose, i just added InPin to it :P
function OpenMyBank: Boolean;
var
x, y, f: Integer;
begin
Status('Openning Bank...');
if not(LoggedIn) then exit;
Flag;
Wait(350 + random(150));
if not BankScreen then
repeat
if FindObjCustom(x, y, ['ank', 'ooth', 'booth'], [864829,4086384], 5) then
Mouse(x, y, 4, 4, False);
Wait(250);
if (ChooseOption('Use-quickly')) then
begin
FFlag(0);
wait(1000);
if(PinScreen) then
repeat
Wait(500);
InPin(IntToStr(Players[CurrentPlayer].Pin));
Inc(f);
until (BankScreen) or (f > 5);
end;
until (BankScreen) or (PinScreen);
Result := BankScreen;
end;
//XcanadamanX (from is awesome Al Kharid Smelter)
function CountItemDtm(dtm: Integer): Integer;
var
i, x, y: Integer;
TB: Tbox;
begin
if not(LoggedIn) then exit;
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
if FindDtm(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
Inc(Result);
end;
end;
function FindMiniColor(var x, y: Integer; Color, tol: Integer; Spiral: Boolean):
Boolean;
begin
if not(LoggedIn) then exit;
if Spiral then
Result := FindColorSpiralTolerance(x, y, Color, 570, 10, 720, 160, tol)
else
Result := FindColorTolerance(x, y, Color, 570, 10, 720, 160, tol);
end;
procedure MyLevel;
begin
Status('Getting Level...');
if not(LoggedIn) then exit;
Players[0].Level[7] := GetSkillLevel('runecrafting');
case Lowercase(RuneToCraft) of
'air':
begin
ExpPerEss := 5;
if (Players[0].Level[7] = 99) then
RunesPerEss := 10
else if (Players[0].Level[7] >= 88) then
RunesPerEss := 9
else if (Players[0].Level[7] >= 77) then
RunesPerEss := 8
else if (Players[0].Level[7] >= 66) then
RunesPerEss := 7
else if (Players[0].Level[7] >= 55) then
RunesPerEss := 6
else if (Players[0].Level[7] >= 44) then
RunesPerEss := 5
else if (Players[0].Level[7] >= 33) then
RunesPerEss := 4
else if (Players[0].Level[7] >= 22) then
RunesPerEss := 3
else if (Players[0].Level[7] >= 11) then
RunesPerEss := 2
else if (Players[0].Level[7] < 11) then
RunesPerEss := 1;
end;
'earth':
begin
ExpPerEss := 6.5;
if (Players[0].Level[7] >= 78) then
RunesPerEss := 4
else if (Players[0].Level[7] >= 52) then
RunesPerEss := 3
else if (Players[0].Level[7] >= 26) then
RunesPerEss := 2
else if (Players[0].Level[7] < 26) then
RunesPerEss := 1;
end;
else
begin
WriteLn('You didnt enter a correct rune.');
Players[CurrentPlayer].Loc := 'No Rune';
Players[CurrentPlayer].Active := False;
end;
end;
end;
procedure InBank;
begin
Status('Finding Booth...');
if not(LoggedIn) then exit;
FindRandoms;
wait(250);
if(OpenMyBank) then
begin
Inc(Players[0].Banked);
ReportVars[3] := Players[0].Banked;
DepositAll;
FixBank;
Wait(100+random(50));
if FindDTM(Rune,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
Mouse(x,y,1,1,false);
ChooseOption('All');
end;
Wait(300+random(50));
CloseBank;
FindRandoms;
SetRun(True);
ReportVars[0] := CountItemDtm(Rune);
Wait(200+random(50));
Players[CurrentPlayer].Loc := 'To Altar';
Wait(200+random(50));
end
else
begin
WriteLn('Bankscreen not found. Logging out...');
Players[CurrentPlayer].Loc := 'No Bankscreen';
Players[CurrentPlayer].Active := False;
end;
end;
procedure ToAltar;
var
f,r:Integer;
begin
Status('Walking to Mysterious Ruins...');
if not(LoggedIn) then exit;
r := random(4);
case Lowercase(RuneToCraft) of
'air':
begin
if RadialRoadWalk(FindFallyRoadColor, 250, 260, 70, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindFallyRoadColor, 160, 200, 60, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindFallyRoadColor, 160, 200, 60, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindRoadColor, 160, 200, 60, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindRoadColor, 180, 220, 60, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindRoadColor, 205, 230, 40, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindRockColor, 300, 320, 60, 1, 1) then FindRandoms;
wait(100);
if DTMRotated(Tree, x, y, MMX1, MMY1, MMX2, MMY2) then i:=GetColor(x,y);
if RadialRoadWalk(i, 255, 280, 70, 1, 1) then FindRandoms;
wait(100);
Mouse(150+r,80+r,0,0,true);
wait(100);
end;
'earth':
begin
if FindMiniColor(x,y,239,20,True) then i := GetColor(x,y) else exit;
if RadialRoadWalk(i, 320, 370, 50, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindVarrockRoadColor, 80, 110, 50, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindVarrockRoadColor, 75, 100, 60, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindVarrockRoadColor, 350, 385, 60, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindVarrockRoadColor, 5, 30, 68, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindVarrockRoadColor, 70, 120, 60, 1, 1) then FindRandoms;
wait(100);
if FindSymbol(x,y,'tree') then Mouse(x+r,y+r,0,0,true) else exit;
FFlag(0);
wait(300);
end;
else
begin
WriteLn('You didnt enter a correct rune.');
Players[CurrentPlayer].Loc := 'No Rune';
Players[CurrentPlayer].Active := False;
end;
end;
FindRandoms;
Status('Searching for Mysterious Ruins...');
repeat
repeat
wait(500+random(300));
Inc(f);
until FindBitMapTol(x, y, MSMystery, MSX1, MSY1, MSX2, MSY2) or (f > 10);
MMouse(x,y,0,0);
until IsUpTextMulti('yst','ter','une') or (f > 10);
if IsUpTextMulti('yst','ter','une') then
begin
Mouse(x+r,y+r,0,0,true);
FindRandoms;
FFlag(0);
Players[CurrentPlayer].Loc := 'In Altar';
wait(800 + random(300));
end
else
begin
WriteLn('Cant find altar... Logging Out');
Players[CurrentPlayer].Loc := 'No Altar';
Players[CurrentPlayer].Active := False;
end;
end;
procedure InAltar;
var
color:array of Integer;
begin
if not(LoggedIn) then exit;
Status('Finding Altar...');
wait(700+random(300));
SetRun(False);
case Lowercase(RuneToCraft) of
'air':
begin
color := [7905960,7774119,6853276];
if FindBitMapTol(x, y, AirAltar, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x,y,0,0,true);
FFlag(0);
end;
end;
'earth':
begin
color := [5668488,8762810,9486533,5142144,9486533,4944765,8433588];
repeat
repeat
wait(300+random(200));
Mouse(270+random(20),20+random(20),0,0,true);
FFlag(0);
until FindBitMapTol(x, y, EarthAltar, MSX1, MSY1, MSX2, MSY2);
MMouse(x,y,0,0);
until IsUpTextMulti('tar','lta','ltar');
GetMousePos(x,y);
Mouse(x,y,0,0,false);
ChooseOption('Craft-rune');
FFlag(0);
end;
else
begin
WriteLn('You didnt enter a correct rune.');
Players[CurrentPlayer].Loc := 'No Rune';
Players[CurrentPlayer].Active := False;
end;
end;
FindRandoms;
wait(1000+random(500));
Status('Searching for Portal...');
repeat
repeat
wait(300+random(200));
FindRandoms;
Mouse(270-random(20),320-random(20),0,0,true);
FFlag(0);
until FindObjCustom(x, y, ['ort','tal'],color,10);
Mouse(x,y,0,0,false);
until ChooseOption('Use');
FindRandoms;
MyLevel;
UsedEss := UsedEss + ReportVars[0];
ReportVars[1] := (ReportVars[0] * RunesPerEss);
RunesMade := RunesMade + ReportVars[1];
ReportVars[2] := Trunc((ReportVars[1]/RunesPerEss) * ExpPerEss);
ExpPlus := ExpPlus + ReportVars[2];
Level := Players[0].Level[7] - Cur;
Players[CurrentPlayer].Loc := 'To Bank';
Report;
FFlag(0);
end;
procedure ToBank;
var
f,r:Integer;
begin
if not(LoggedIn) then exit;
Status('Walking to Bank...');
r := random(4);
wait(1200 + random(200));
case Lowercase(RuneToCraft) of
'air':
begin
if RadialRoadWalk(FindRoadColor, 100, 135, 50, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindRoadColor, 25, 50, 60, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindRoadColor, 340, 360, 70, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindRoadColor, 340, 360, 48, 1, 1) then FindRandoms;
wait(100);
//Logs out here for some reason...
if RadialRoadWalk(FindFallyRoadColor, 340, 365, 68, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindFallyRoadColor, 340, 365, 68, 1, 1) then FindRandoms;
wait(100);
end;
'earth':
begin
if RadialRoadWalk(FindVarrockRoadColor, 190, 200, 70, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindVarrockRoadColor, 230, 260, 72, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindVarrockRoadColor, 170, 210, 70, 1, 1) then FindRandoms;
wait(100);
if RadialRoadWalk(FindVarrockRoadColor, 235, 270, 70, 1, 1) then FindRandoms;
wait(100);
RadialRoadWalk(FindVarrockRoadColor, 260, 280, 70, 1, 1);
end;
else
begin
WriteLn('You didnt enter a correct rune.');
Players[CurrentPlayer].Loc := 'No Rune';
Players[CurrentPlayer].Active := False;
end;
end;
Status('Finding Bank Symbol...');
repeat
wait(200);
FindRandoms;
Inc(f);
until (FindColorTolerance(x,y,6082797,MMX1,MMY1,MMX2,MMY2,50)) or (f > 10);
if not(f > 10) then
begin
Mouse(x,y + 8,0,0,true);
FindRandoms;
FFlag(0);
Players[CurrentPlayer].Loc := 'In Bank';
Wait(500+random(50));
end
else
begin
WriteLn('Cant find bank... Logging Out');
Players[CurrentPlayer].Loc := 'No Bank';
Players[CurrentPlayer].Active := False;
end;
end;
begin
ClearDebug;
SetupSRL;
ScriptID := '288';
SRLID:=YourSRLID;
SRLPassword:=YourSRLPassword;
FindWindowBySize(766, 504);
ActivateClient;
DeclarePlayers;
DeclareIMG;
if not(LoggedIn) then Loginplayer;
repeat
RuneToCraft := Players[CurrentPlayer].Strings[0];
EssToDo := Players[CurrentPlayer].Integers[0];
Cur := GetSkillLevel('runecrafting');
UsedEss := 0;
Level := 0;
ExpPlus := 0;
SetScreenName(Players[CurrentPlayer].Nick);
HighestAngle;
MyLevel;
repeat
begin
if not(LoggedIn) then exit;
If not(Players[CurrentPlayer].Loc = 'To Bank') then ClearDebug;
WriteLn(Players[CurrentPlayer].Loc);
MakeCompass('N');
case Players[CurrentPlayer].Loc of
'In Bank':InBank;
'To Altar':ToAltar;
'In Altar':InAltar;
'To Bank':ToBank;
else
begin
WriteLn('What the hell did you do? It said DONT TOUCH!');
Players[CurrentPlayer].Loc := 'Dumbass';
Players[CurrentPlayer].Active := False;
end;
end;
end;
until(UsedEss >= EssToDo) or (not(Players[CurrentPlayer].Active));
if not(Players[CurrentPlayer].Active) then
begin
Inc(MessedUp);
ReportVars[4] := MessedUp;
end;
Report;
LogOut;
wait(1000);
NextPlayer(Players[CurrentPlayer].Active);
until (false);
end.