SCAR Code:
Program PortPhasmatysSmelter;
//by EL_TYCHO
{.include SRL/SRL.scar}
{.include SRL/SRL/extended/xbank.scar}
///////////Change this if needed///////////////////
Const Bars = 100 ;//Number of loads to do
Furnace = 3684413;//Furnace color
FurnaceMM = 2851583;//Furnace color on the minimap
BankSymbol = 5890811;//color of the bank symbol
BankBooth = 1984064;//bankbooth color
///////////////////Dont touch this/////////////////
var BarsDone : integer;
Iron : integer;
Coal : integer;
Steel : integer;
Procedure FreeBitmaps;
begin
Iron := BitmapFromString(13, 10, 'z78DA75D25B0E83201005D02D' +
'316FFC44C4FD2FA9D84BD369B49ADC4C081E0747DBB58938EB29E' +
'166241575B92E92C2F346CD414E45820B6D72B051D76BADE79DCB' +
'D94CA57937971DF583D6A993408383848C3D4B3B6DBE2FE75D13A' +
'641FED39BF34E2327FA09B65D4BB4696BA81D4A0F1A9CDC5BE3CE' +
'25273A89C355BD8A6F5A613E68E95BAD7EE00C1ECCC8082F2A709' +
'6F696EF5AFE56776DCE6F4676AAF99C30EAACE9A64556B7FF9C1F' +
'0D4EF5433BF29FB6CC74BAA59908C772B2D6FCD4919F45DA75D68' +
'EA97D56BE0E567227F75412BBF6ABF2C0BF9D279E13A77801392D' +
'A15F');
Coal := BitmapFromString(14, 9, 'z78DA7592510EC4200844AF243' +
'0A07EAA75EF7FA4B5E207CD6E359934545F19A6F932C0D2BD4812' +
'AFEDCF3C78D0741516E6245994559A34CE0FDD75BFE55AC42A4A6' +
'4A222094E25D25E987E928C2C5D34D69652ECC278639E7AA44D99' +
'5C5D1FB4ADBC165969F6C18C0457252CFF36D4A41F7260C6930F6' +
'6E54A8FB7A0BB1F5580A7A92E13197A817EBF18271F5D47E66275' +
'1AA7B74DF30E4B32438E9CA827CDEDD7693E25EE77052685B3558' +
'534A765D68EF496609CF9F9371E39F2E474FC6E9A7DB4CAE5AE8B' +
'5A477B63FEA67966D8A4738DBD392D674B9098E01F665989896B9' +
'CC91776469AA3');
Steel := DTMFromString('78DA630C626060706040011505F90CFF81342' +
'310FF0702C64820C393010D302291403A1848F811501300247C09' +
'A87107125E44A87126A0C60BD35F186A40EEB521A006143E9604D' +
'480C2C79A809A5820614B404D02116E8E01126E04D4C4010917FC' +
'6A006F840EBA');
end;
Function FindFastRandoms: Boolean;
var
i: Integer;
begin
for i:=1 to 12 do
begin
case I of
1: If FindDead then
Result := True;
2: If FindMod then
Result := True;
3: If FindMime then
Result := True;
4: If FindMaze then
Result := True;
5: If FindQuiz then
Result := True;
6: If FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Logout;
Exit;
end;
end;
8: begin
if InBlack then
begin
Result := True;
Logout;
Exit;
end;
end;
9: begin
if(DetectFrogCave) then SolveFrogSwamp;
end;
10: begin
if(FindFight) then
begin
RunAwayDirection('W');
Wait(10000 + Random(2000));
RunBack;
end;
end;
11: begin
FindLamp('Prayer');
end;
12: begin
if findname or findtalk then
begin
FindNormalRandoms;
end
end;
end;
Wait(1);
end;
end;
///////////////////////opens the bank and withdraws the ores only for the first time//////////////////
Procedure WithdrawOres;//based it on the bank opening proces by ThickAsBlood
var i:integer;
Begin
i:=0
if not (BankScreen) then
repeat
i:= + 1;
if(FindColorTolerance(x, y, BankBooth,MSX1, MSY1, MSX2, MSY2,5))and
(IsUpText('bank')) then
Mouse(x,y,0,0,false);
Wait(1000+random(500));
ClickOption('ickl', 1);
Wait(3000+random(1000));
until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
if (i >= 10) then
TerminateScript;
QuickFixBank;
If(FindBitmap(Iron,x,y)) then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
ClickOption('x', 1);
TypeSend('18');
end;
If(FindBitmap(Coal,x,y)) then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
ClickOption('All', 1);
end;
MouseBox(478, 33, 494, 49, 1);
FindFastRandoms;
end;
///////////////////////Walks to the furnace/////////////////
Procedure GoToFurnace;
Begin
FindColor(x,y,FurnaceMM,mmx1,mmy1,mmx2,mmy2)
Wait(1000+random(500));
Mouse(x,y,1,1,true);
Wait(5000+random(1000));
FindFastRandoms;
end;
/////////////////////Smelt the ores/////////////////////
Procedure SmeltOres;
var mins: Integer;
skill: string;
Begin
if(FindColorTolerance(x, y, Furnace,MSX1, MSY1, MSX2, MSY2,5))
and(IsUpText('elt furn'))then
begin
MMouse(x,y,0,0);
Mouse(x,y,0,0,true);
Wait(2000+random(1000));
MouseBox(258, 712, 286, 738, 2);
ClickOption('x', 1);
Wait(1000+random(3000))
HitKeys(true);
FindFastRandoms;
Wait(10000+random(5000));
FindFastRandoms;
begin
if ((TimeFromMark(HoverMark) / 1000) / 60 >= mins) then //Used the one out of the xAntiBan by Dankness
begin
MarkTime(HoverMark);
HoverSkill(Skill, False);
end;
end;
wait(20000+random(2000));
Barsdone:= Barsdone + 19;
end;
end;
//////////////////////back to the bank////////////////////
Procedure GoToBank;
begin
FindColor(x,y,BankSymbol,mmx1,mmy1,mmx2,mmy2)
Wait(500+random(500));
Mouse(x,y,1,1,true);
Wait(3000+random(2000));
FindFastRandoms;
end;
////////////////////////deposit the ores///////////////////
Procedure ChangeBarsForOres;
var i : integer;
Begin
MakeCompass('s');
Lowestangle;
1:=0;
repeat
i:= + 1;
if (FondObj(x,y,'ank boot',BankBooth,10))then
Mouse(x,y,0,0,false);
Wait(1000+random(500));
ClickOption('ickl', 1);
Wait(3000+random(1000));
until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
if (i >= 10) then
TerminateScript;
end;
if FindDTM(Steel, x, y, 568, 216, 715, 325)then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
ClickOption('All', 2);
QuickFixBank;
end;
If(FindBitmap(Iron,x,y)) then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
ClickOption('x', 1);
TypeSend('18');
end;
If(FindBitmap(Coal,x,y)) then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
ClickOption('All', 1);
end;
MouseBox(478, 33, 494, 49, 1);
FindFastRandoms;
HighestAngle;
end;
//////////////////////Main Loop////////////////////////
Begin
SetupSRL;
FreeBitmaps;
BarsDone:=0
MakeCompass('s');
WithdrawOres;
Repeat
MakeCompass('n');
GoToFurnace;
SmeltOres;
GoToBank;
ChangeBarsForOres;
Until (BarsDone >= Bars)
end.