jatex
2012-01-22 23:08:22
Script is still in beta, but it gets the job done (generally speaking.)
Please post any bugs you find, I don't have the time to run the script and watch it.
Start at bank booth in front of the door at Falador East bank with Pickax equipped and nothing in inventory.
Please post any bugs you find, I don't have the time to run the script and watch it.
Start at bank booth in front of the door at Falador East bank with Pickax equipped and nothing in inventory.
program MiningGuild_by_Jatex;
{$DEFINE SMART}
{$DEFINE PAINT}
{$i srl/srl/misc/smart.simba}
{$i SRL/srl.simba}
{$i SRL\SRL\Misc\PaintSmart.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
var
{MSX1,MSY1,MSX2,MSY2,}x,y,i: integer;
OldInv,PlusOne,Ores,AngleHigh,colorz: integer;
//MyTPA: TPointArray;
//MyPoint: TPoint;
WalkingToOres,WalkingToUpLadder: Array[0..3] of integer;
aFound: Extended;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //Account Username
Pass := ''; //Account Password
Pin := ''; //Account Pin (leave blank if not one)
BoxRewards := ['XP','xp','lamp'];
LampSkill := 'Mining';
Active := True;
end;
end;
procedure Antiban;
begin
if(not(LoggedIn))then
Exit;
case Random(500) of
0:
begin
HoverSkill('Mining', false);
wait(1000+Random(200));
end;
10: PickUpMouse;
20: BoredHuman;
30: RandomMovement;
40:
begin
MakeCompass('S');
wait(125+random(100));
MakeCompass('N');
wait(75+random(100));
MakeCompass('N');
FindNormalRandoms;
end;
50: MakeCompass('Random');
end;
end;
procedure MineMithril;
begin
if(InvFull) then
Exit;
repeat
FindNormalRandoms;
MakeCompass('S');
SetAngle(AngleHigh);
Oldinv := InvCount;
PlusOne:= InvCount + 1;
if FindObjCustom(x,y,['ine','ocks'],[7230805,9728626,7096649],10) then
begin
Writeln('Found Mithril Ore..');
colorz:=GetColor(x,y);
Mouse(x,y,4,4,true);
ChooseOption('ine');
Writeln('Mining Mith Ore..');
MarkTime(Ores);
end;
repeat
Wait(500+random(250));
Writeln('Waiting')
Antiban;
Writeln('Antiban');
FindNormalRandoms;
Wait(500+random(300));
//if (OldInv=PlusOne) then
//Writeln('Mithril Count:'+InvCount);
Until(OldInv=PlusOne)or(TimeFromMark(Ores) > 5100+random(250));
Writeln('+1Invy');
//until FindObjCustom(x,y,['ine','ocks'],[7230805,9728626,7096649],10)=False;
until FindColorTolerance(x,y,7230805,MSX1,MSY1,MSX2,MSY2,10)=false or InvFull;
end;
//until (InvFull);
procedure MineCoal;
begin
If(InvFull) then
Exit;
repeat
Antiban;
FindNormalRandoms;
MakeCompass('S');
SetAngle(AngleHigh);
Oldinv := InvCount;
PlusOne:= InvCount + 1;
if FindObjCustom(x,y,['ine','ocks'],[789773,1052945,1316117],5) then
begin
Writeln('Found Coal Ore.. Mining');
//Wait(1000+random(500));
colorz:=GetColor(x,y);
Mouse(x,y,4,4,true);
ChooseOption('ine');
Writeln('Mining Coal Ore..');
MarkTime(Ores);
Writeln('Marking Time');
end;
repeat
Wait(500+random(250));
Writeln('Waiting')
Antiban;
Writeln('Antiban');
FindNormalRandoms;
Wait(500+random(300));
//if (OldInv=PlusOne) then
//Writeln('Mithril Count:'+InvCount);
until(OldInv=PlusOne)or(TimeFromMark(Ores) > 5100+random(250));
Writeln('+1Invy');
until FindObjCustom(x,y,['ine','ocks'],[789773,1052945,1316117],10) or InvFull;
end;
procedure WalkToRocks;
begin
Wait(450+random(125));
ClickNorth(SRL_ANGLE_HIGH);
Wait(1250+random(275));
if FindDTMRotated(WalkingToOres[0],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) then
begin
Writeln('Walking to first DTM');
Mouse(x,y,5,5,True);
FFlag(6);
repeat
Wait(50+Random(25));
until FindDTMRotated(WalkingToOres[1],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) or FindDTMRotated(WalkingToOres[2],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound);
end;
if FindDTMRotated(WalkingToOres[1],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) then
begin
Writeln('Walking to second DTM');
Mouse(x,y,5,5,True);
FFlag(6);
end;
if FindDTMRotated(WalkingToOres[2],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) then
begin
Writeln('Walking to failsafed DTM');
Mouse(x,y,5,5,True);
FFlag(6);
end;
{repeat
Wait(50+Random(25));
until FindDTMRotated(WalkingToOres[1],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound);
end;
if FindDTMRotated(WalkingToOres[1],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) then
begin
Writeln('Walking to second DTM');
Mouse(x,y,5,5,True);
FFlag(6);
end;}
end;
procedure WalkToMine;
begin
if(InvEmpty) then
Writeln('Walking To Mine..');
begin
ClickNorth(SRL_ANGLE_HIGH);
if ObjDTM_WalkPath(['117:55:5:0:7:72:143:1:7:23:80:1:7:26:27:1:7:46:36:0:7:134:87', '114:140:3:1:7:98:33:0:7:124:67:0:7:96:113', '43:114:3:0:7:30:89:0:7:43:133:0:7:67:55'],0,100,80,false, true) then
begin
Wait(1000+random(500));
MakeCompass('W');
if FindObjCustom(x,y,['limb-down','adder'],[4548989,2118252,1787227,2376274],15) then
repeat
Wait(1000+random(500));
Writeln('Found Ladder, climbing down');
//Wait(1000+random(500));
//colorz:=GetColor(x,y);
Mouse(x,y,4,4,false)
ChooseOption('limb');
Wait(500+random(250));
Antiban;
//until FindColorTolerance(x,y,5067905,MSX1,MSY1,MSX2,MSY2,3);
until(IsMoving);
//end else;
//Writeln('Cannot Find Ladder.');
begin
Wait(250+random(225));
WalkToRocks;
//ObjDTM_WalkPath(['129:92:3:5:7:111:97:5:7:142:94:5:7:119:78', '133:86:3:5:7:85:55:5:7:123:48:5:7:100:90'],0,100,80,false,true);
end;
end;
end;
end;
procedure WalkToLadder;
begin
ClickNorth(SRL_ANGLE_HIGH);
Wait(1250+random(275));
if FindDTMRotated(WalkingToUpLadder[0],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) or FindDTMRotated(WalkingToUpLadder[2],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) then
begin
Writeln('Walking to first DTM');
Mouse(x,y,4,4,True);
FFlag(6);
repeat
Wait(50+Random(25));
until FindDTMRotated(WalkingToUpLadder[1],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) or FindDTMRotated(WalkingToUpLadder[3],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound)
end;
if FindDTMRotated(WalkingToUpLadder[1],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) or FindDTMRotated(WalkingToUpLadder[3],x,y,MMX1,MMY1,MMX2,MMY2,-Pi/4,Pi/4,Pi/60,aFound) then
begin
Writeln('Walking to second DTM');
Mouse(x,y,4,4,True);
FFlag(6);
end;
end;
procedure WalkToBank;
begin
if(InvFull) then
begin
WalkToLadder;
end;
//if ObjDTM_WalkPath(['28:76:4:5:7:46:59:5:7:85:62:5:7:77:90:5:7:46:90', '52:105:5:5:7:35:82:5:7:85:63:5:7:104:82:5:7:79:117:5:7:35:112', '38:86:4:5:7:62:70:5:7:96:59:5:7:109:93:5:7:54:86', '33:64:4:5:7:81:59:5:7:104:55:5:7:104:86:5:7:89:82'],0,100,80,false,true) then
begin
if FindObjCustom(x,y,['limb-up','adder'],[3751746,4541776,3226432,4410190],15) then
repeat
//MakeCompass('W');
SetAngle(AngleHigh);
Wait(1000+random(500));
Writeln('Found Ladder, climbing down');
//Wait(1000+random(500));
//colorz:=GetColor(x,y);
Mouse(x,y,4,4,false)
ChooseOption('limb');
Wait(500+random(250));
Antiban;
//until FindColorTolerance(x,y,5067905,MSX1,MSY1,MSX2,MSY2,3);
until(IsMoving);
end;
begin
Wait(1250+random(275));
MakeCompass('N');
ObjDTM_WalkPath(['117:89:3:0:7:38:81:0:7:66:55:0:7:79:101', '54:25:3:0:7:42:97:0:7:29:52:0:7:66:18', '35:59:3:0:7:68:143:0:7:28:124:0:7:91:68'],0,100,80,false,true);
end;
end;
//end;
procedure Banking;
begin
if(InvFull) then
begin
SetAngle(AngleHigh);
repeat
WriteLn('Inventory full, banking.');
OpenBankFast('feb');
if(PinScreen)then
InPin(Players[CurrentPlayer].Pin );
if(BankScreen) then
DepositAll;
CloseBank;
until(InvEmpty);
end;
end;
procedure DeclareDTMs;
begin
WalkingToOres[0] := DTMFromString('mggAAAHicY2MAAlYGhmMsDAx7gPg0lH4OxKeAUoeA+AIQrwbiDUB8FYhdLHUYInR5GMw15Ris9BQYzLXlGBwdPBi4gHLYMCMODAEAaN0MZw==');
WalkingToOres[1] := DTMFromString('mbQAAAHicY2VgYHjGwsBwCIhLgfgtEL8B4kdA8TVAfAWIXwPxeiB2s1ZmcHZ1Z4gy4mb49OULQ2RMNAM7UBwdM2LBYAAABK4OKA==');
WalkingToOres[2] := DTMFromString('mggAAAHicY2NgYNjHwsCQCMTLgXgvEM8G4llA3A+UawLiGCCeA8R5QDwJiN0s1RiidNkYIsPDGF6/+8bw6f17BnMTYwYuoBw2zIgDQwAABfMPlw==');
WalkingToUpLadder[0] := DTMFromString('mggAAAHicY2NgYFjMwsAwF4gnAPEHIN4OxLuBeClQrhGIDwDxbCDeCsT9QOxsocXw/elLBmNNaQZDVSkGExNzhrDwKAYuoBw2zIgDQwAA8YIOTw==');
WalkingToUpLadder[1] := DTMFromString('mbQAAAHicY2VgYOhlYWA4AMXngfgSEK8Gis8E4jNAvAuIVwKxpZ4sw/enLxkM1aUYHBzcGMLCoxi4gOLomBELBgMAt1IM+g==');
WalkingToUpLadder[2] := DTMFromString('mggAAAHicY2NgYNjEwsCwlwVC3wHi00B8HYinA+VWAnECEE8E4kogXgLEHubqDJ8+fWFw0JNhcLN3YYgJi2Cw1pRi4ALKYcOMODAEAAAVOg6n');
WalkingToUpLadder[3] := DTMFromString('mggAAAHicY2NgYJjPwsAwC4h3AfFuIF4JxIeAuAso1wnErUA8C4hnAnEJEDvoyTDE6nAwxIRFMOhraDN8ffcRjLmActgwIw4MAQAnyRAI');
end;
procedure FreeDTMs;
begin;
FreeDTM(WalkingToOres[0]);
FreeDTM(WalkingToOres[1]);
FreeDTM(WalkingToOres[2]);
FreeDTM(WalkingToUpLadder[0]);
FreeDTM(WalkingToUpLadder[1]);
end;
procedure MineRocks;
begin
repeat
MineMithril;
Writeln('Starting Mith Loop');
MineCoal;
Writeln('Starting Coal Loop');
until(InvFull);
end;
//Exit;
procedure Setup;
begin
Smart_Server := 135;
Smart_Members := false;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
ActivateClient;
ObjDTM_Setup;
DeclarePlayers;
end;
procedure WalkingTo;
begin
DeclareDTMs;
WalkToMine;
FreeDTMs;
end;
procedure Walkingback;
begin
if(InvFull) then
begin
Writeln('Time to walk to bank..');
DeclareDTMs;
Writeln('DTMs declared');
WalkToBank;
FreeDTMs;
end;
end;
begin
Setup;
ClearDebug;
if not(LoggedIn) then
LogInPlayer;
repeat
//WalkingTo;
MineRocks;
Walkingback;
Banking;
until(false);
end.