Element17
2012-02-19 21:42:10
program WildyMiner;
//{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
Const
SERVER = 61; // Enter "0" to pick a random server.
MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
Version= '1.0'; //NO TOUCHY!
Var
TooLong:Integer;
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];
with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;
end;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
Function CheckAndClick(X,Y:Integer):Boolean;
Begin
MMouse(x, y, 5, 5);
{Wait(100 + Random(50));
If CountUpColor('B', 41, 5, 86, 24, 70, 140) Then}
If WaitUpTextMulti(['Mine','ine'], 150) Then
Begin
Result:=True;
GetMousePos(x, y);
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;
Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Mining', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;
Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_commit;
Terminatescript;
End;
function OreColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.44);
if not (FindColorsTolerance(arP, 2305354, MSX1, MSY1, MSX2, MSY2, 12)) then
begin
//Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
Function MineOre: Boolean;
Var
X, Y, PlusOne, OreCounter: Integer;
Begin
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
X:=MSCX;
Y:=MSCY;
If FindObjTPA(X, Y, OreColor, 5, 1, 25, 25, 350, ['Min']) Then
Begin
StatsGuise('We found ore');
GetMousePos(X, Y);
Case Random(2) of
0: Mouse(X, Y, 5, 5, True);
1: Begin
Mouse(X, Y, 5, 5, False);
WaitOption('Mine', 500);
End;
End;
Flag;
MarkTime(OreCounter);
If (TimeFromMark(Toolong) > 25000) Then
FailSafe('Could not find ore');
Repeat;
If (TimeFromMark(Toolong) > 25000) Then
FailSafe('Could not find ore');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(100);
If InvCount=PlusOne Then
Writeln('Ore mined');
Until (InvCount=PlusOne) or (TimeFromMark(OreCounter) > 5000)
End;
End;
Procedure DropOre;
Var
X, Y, OreDTM, I:Integer;
Slotbox:Tbox;
OrePattern:TIntegerArray;
Begin
MarkTime(TooLong);
OreDTM := DTMFromString('m1gAAAHic42JgYHBmYmCwAGI7IHYCYg8gDgRiHyC2B2JjKNZhZGBQBWJZIFYEYnkg1gRiEyC2gtLaQGwkKwo0lYkITBxgJBIjAAA1UATS');
OrePattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
StatsGuise('Dropping Ore:' + IntToStr(I));
For I:=0 To 27 Do
Begin
SlotBox:=InvBox(OrePattern[I]);
If FindDTm(OreDTM, X, Y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
FindNormalRandoms;
MouseItem(OrePattern [I],Mouse_Right);
ChooseOption('Dro');
End;
End;
MarkTime(TooLong);
End;
begin
SetupSRL;
DeclarePlayers;
Repeat
MineOre;
DropOre;
Until(false);
end.You guys see anything wrong in there? Anything I can fix/add? I got a lot of information and used some of YoHoJo stuff from his mining script. I got my own DTM and found my own ore color with ACA. When I run the script it just moves the mouse all over the ground and never clicks anywhere and when it drops ore it drops it and then tries to drop on the same spot again. Any suggestions? Thank you in advance and thank you to YoHoJo for your videos they helped a lot so far.