SCAR Code:
Heres my script:
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 = 3297479;//Furnace color
FurnaceMM = 157428;//Furnace color on the minimap
BankSymbol = 3196640;//color of the bank symbol
BankBooth = 923672;//bankbooth color
///////////////////Dont touch this/////////////////
var BarsDone : integer;
Iron : integer;
Coal : integer;
Steel : integer;
Procedure DeclarePlayers;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='EL_TYCHO';
Players[0].Pass :='';
Players[0].Nick :='ukh';
Players[0].Active :=True;
end;
Procedure FreeDTMs;
begin
Iron := DTMFromString('78DA6314616060106440013E7A4A609A11CA6' +
'7940412520C688011558D00909027A0868D0873988184080135AC' +
'40828F801A903D1C04D42802092E026A6489708F2261F70000032' +
'C0238');
Coal := DTMFromString('78DA63146260601060400116E66A609A11CA6' +
'7E40312B20C688011558D14901027A0460148701350230324D808' +
'A8110312CC04D480E47988502341408D1C90E023A0868770F8000' +
'0F2B30216');
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 (FindObj(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;
if FindDTM(Iron, x, y, 76, 60, 442, 94)then
begin
Wait(500+random(500));
Mouse(x,y,2,2,false);
Wait(500+random(500));
ClickOption('X', 1);
Wait(1000+random(500));
TypeSend('9');
end;
if FindDTM(Coal, x, y, 76, 60, 442, 94)then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
Wait(1000+random(500));
ClickOption('ll', 1);
end;
MouseBox(478, 33, 494, 49, 1);
end;
///////////////////////Walks to the furnace/////////////////
Procedure GoToFurnace;
Begin
FindMMColorTol(x,y,FurnaceMM,25);
Mouse( x, y, 5, 5,true);
Wait(2000+random(1000));
End;
/////////////////////Smelt the ores/////////////////////
Procedure SmeltOres;
var mins: Integer;
skill: string;
Begin
wait(3000+random(1000));
repeat
FindMSColorTol(x,y,Furnace,15);
wait(50+random(10));
Mouse(x,y,5,8,false);
wait(50+random(10));
until(ClickOption('Smelt', 1)=true);
begin
Wait(1000+random(500));
MouseBox(240, 395, 268, 418, 2);
ClickOption('10', 3);
Wait(1000+random(3000))
HitKeys(true);
Wait(500+random(500));
FindFastRandoms;
Wait(10000+random(5000));
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
FindMMColorTol(x,y,bANKsYMBOL,25);
Mouse( x, y, 5, 5,true);
Mouse(x,y,1,1,true);
Wait(3000+random(2000));
FindFastRandoms;
end;
////////////////////////deposit the ores///////////////////
Procedure ChangeBarsForOres;
var i : integer;
Begin
MakeCompass('s');
Lowestangle;
i:=0;
repeat
i:= + 1;
if (FindObj(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;
if FindDTM(Steel, x, y, 568, 216, 715, 325)then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
Wait(500+random(500));
ClickOption('ll', 2);
QuickFixBank;
end;
if FindDTM(Iron, x, y, 76, 60, 442, 94)then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
ClickOption('X', 1);
Wait(1000+random(500));
TypeSend('9');
end;
if FindDTM(Coal, x, y, 76, 60, 442, 94)then
begin
Wait(1000+random(500));
Mouse(x,y,2,2,false);
Wait(1000+random(500));
ClickOption('ll', 1);
end;
MouseBox(478, 33, 494, 49, 1);
FindFastRandoms;
HighestAngle;
end;
//////////////////////Main Loop////////////////////////
Begin
SetupSRL;
DeclarePlayers;
if (not(LoggedIn)) then
LoginPlayer;
FreeDTMs;
BarsDone:=0
MakeCompass('s');
WithdrawOres;
Repeat
MakeCompass('n');
GoToFurnace;
SmeltOres;
GoToBank;
ChangeBarsForOres;
Until (BarsDone >= Bars)or(Not(LoggedIn));
end.