I suppose a public Granite miner script would be nice...
Still not skilled enough to make it myself.
Edit, I'm resurrecting Flight's script.
I suppose a public Granite miner script would be nice...
Still not skilled enough to make it myself.
Edit, I'm resurrecting Flight's script.
Last edited by satkan; 09-11-2012 at 03:37 PM.
Activity
Going asian on University College Ghent.
No time for anything atm.
Yeah, right after i posted this request, i saw Flight's.
I'm trying to resurrect it, by using the pascal knowledge i have.
(Making it less complicated, and just removing the summoning part.)
I bet Flight wouldn't want me to post the resurrection after I've done it, i guess.
Activity
Going asian on University College Ghent.
No time for anything atm.
Ask him, he may agree?
Here is a working version of Flight's script. I commented out all of the SMART and PaintSmart errors. That was all that needed to be done. I PMed Flight and will remove it at his request.
Simba Code:{/////////////////////////////////////////
// Granite Pro //
// //
// Version: 1.0 //
/////////////////////////////////////////}
program GranitePro;
{$DEFINE SRL5}
{$DEFINE SMART}
{$i SRL/srl.simba}
//{$i SRL/SRL/misc/paintsmart.simba}
{$i SRL/SRL/skill/summoning.simba}
Const
//SRL Stats
SRLStats_Username = '';
SRLStats_Password = '';
//General settings
UseFamiliar = False; //Using a familiar?
FamiliarName = 'Lava titan'; //Obsidian golem or Lava titan? (MUST be spelled correctly!)
DosesToDrink = 2; //# of summoning potion DOSES to drink (I recommend 2)
SwitchWorlds = False; //Switch worlds after a break?
//Break settings
BreakIn = 600; //How long before we take a break? (minutes)
BreakFor = 5; //How long will we break for? (minutes)
Bir = 7; //Random minutes to add/subtract from how long until we break
Bfr = 3; //Random minutes to add/subjtract from break duraction
Var
Version: String;
DoFSearch: Boolean;
RockCols: TIntegerArray;
MineTimer,MineXP,MineXP_C,
ReportTime,CommitTime,FType: Integer;
//Break variables
w,x,y,z,RealBTime,CurrentBTime,
BreakRounds,TotalBreaks: Integer;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
BoxRewards := ['XP','xp','lamp'];
//LampSkill := 'Mining';
Active := True;
end;
end;
Procedure LoadVars;
begin
Version := '1.0';
MarkTime(ReportTime);
MarkTime(CommitTime);
MineTimer := 1000;
MouseSpeed := RandomRange(13, 18);
if UseFamiliar then
DoFSearch := True;
case LowerCase(FamiliarName) of
'obsidian','obsidian golem': FType := 1;
'lava','lava titan': FType := 2;
end;
RockCols := [7052226, 7183813, 7447243, 7710931];
w := (BreakIn * 60000);
x := (BreakFor * 60000);
y := RandomRange(-Bir * 60000, Bir * 60000);
z := RandomRange(-Bfr * 60000, Bfr * 60000);
end;
Procedure Report;
begin
//ClearDebug;
WriteLn('=-=-=-=-=-=-= Granite Pro by Flight =-=-=-=-=-=');
WriteLn('Time Running: '+TimeRunning);
WriteLn('Exp gained: '+IntToStr(MineXP));
WriteLn('Breaks: '+IntToStr(TotalBreaks));
WriteLn('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=');
MarkTime(ReportTime);
end;
Procedure OnScreen;
var
XPH,TTB: Integer;
begin
XPH := Round((MineXP * 3600) / (GetTimeRunning / 1000));
TTB := (((w) + (y) + BreakRounds)-GetTimeRunning);
//SMART_DrawTextMulti(True, True, ['Granite Pro '+Version+' by Flight','',
//''+MsToTime(GetTimeRunning, Time_Abbrev),'',
//'Mining XP: '+IntToStr(MineXP)+' ('+IntToStr(XPH)+' / hour)'],
//Point(10, 260), SmallCharsNS, 16777215);
//SMART_DrawTextMulti(False, True, ['Time till break: '+MsToTime(TTB,Time_Bare)], Point(570, 445), SmallCharsNS, 65280);
end;
Procedure Commit;
begin
stats_IncVariable('Mining EXP (Gained)', MineXP_C);
Stats_Commit;
MineXP_C := 0;
MarkTime(CommitTime);
end;
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y,X2,Y2,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(A*MP), eX+(A*MP));
Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
WindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := A;
end;
Procedure HumanRandomMouse;
var
randSpeed: extended;
x, y, firstSpeed: integer;
begin
case(Random(10)) of
2..8:
begin
firstSpeed := mouseSpeed;
mouseSpeed := RandomRange(5,10);
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
GetMousePos(x, y);
WindMouse(x, y, RandomRange(x - 75, x + 75), RandomRange(y - 75, y + 75),
30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
mouseSpeed := firstSpeed;
end;
end;
end;
Function IsMoving_F: Boolean;
begin
Result := PixelShift(IntToBox(MMCX-30, MMCY-30, MMCX+30, MMCY+30), 200) > 200;
end;
Function Mining: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 400);
end;
Function Antiban: Boolean;
var
i: Integer;
begin
if not LoggedIn then Exit;
i := Random(450);
case i of
1..45:
begin
HumanRandomMouse;
Result := True;
end;
46:
begin
HoverSkill('Mining', False);
Result := True;
end;
47..450: Exit;
end;
end;
Function DrinkUp: Boolean;
var
I,C: Integer;
begin
Result := False;
If Not LoggedIn then Exit;
if InvEmpty then Exit;
for i := 3 to 28 do
begin
FindNormalRandoms;
if ExistsItem(i) then
begin
InvMouse(i, mouse_move);
if WaitUpTextMulti(['se V','Vial'], 500) then
begin
ClickMouse2(False);
WaitOptionMulti(['Drop','op V'], 300);
Wait(RandomRange(705, 815));
end;
if WaitUpTextMulti(['rink','ummoning','Potion'], 500) then
begin
ClickMouse2(True);
Wait(RandomRange(705, 815));
Inc(C);
if (C = DosesToDrink) then
begin
Result := True;
Exit;
end;
end;
if (i = 28) then
Exit;
end;
end;
end;
Function RenewFamiliar: Boolean;
var
I,T: Integer;
TextCheck: TStringArray;
begin
Result := False;
If not LoggedIn then Exit;
if InvEmpty then Exit;
if not DrinkUp then Exit;
if (FType = 1) then {Obsidian golem}
TextCheck := ['bsidi','idian','golem']
else if (FType = 2) then {Lava titan}
TextCheck := ['Lava','va ti','titan p'];
for i := 3 to 28 do
begin
FindNormalRandoms;
if ExistsItem(i) then
begin
InvMouse(i, mouse_move);
if WaitUpTextMulti(TextCheck, 500) then
begin
ClickMouse2(False);
WaitOption('Summon', 400);
MarkTime(T);
repeat
FindNormalRandoms;
if (TimeFromMark(T) > 5000) then
Exit;
if UsingFamiliar then
break;
until(False)
end;
if UsingFamiliar then
begin
Result := True;
Exit;
end;
if (i = 28) then
Exit;
end;
end;
end;
Procedure FastDropSlot(Slot: Integer);
Var
X,Y: Integer;
TB: TBox;
begin
Case Slot of
1: TB := IntToBox(564,214,598,244);
2: TB := IntToBox(606,214,640,244);
end;
MouseSpeed := RandomRange(26,39);
MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, mouse_right);
GetMousePos(X, Y);
MMouse(X, (Y+61), 20, 3);
Wait(RandomRange(20, 75));
ClickMouse2(True);
end;
Procedure ReturnValues(colors: TIntegerArray; var HueMods, SatMods: Extended; var color, Tolerance: Integer);
Var
h, s, t: Extended;
I,II : integer;
HSLColor : Array[1..3] of Extended;
HSL : Array[0..1] of Array[1..3] of Extended;
begin;
For I:= 1 to 3 do
begin;
HSL[0][i] := 255;
end;
For I:= 0 to High(Colors) do
begin;
ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
For II:= 1 to 3 do
begin;
HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
end;
end;
H := (HSL[1][1] - HSL[0][1]);
S := (HSL[1][2] - HSL[0][2]);
T := (HSL[1][3] - HSL[0][3]);
try
HueMods := (H/T);
SatMods := (S/T);
Tolerance := Round(t);
except
HueMods := 0;
SatMods := 0;
Tolerance := Round(0.0);
end;
Color := HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2);
end;
Function FindRockNear(Var X,Y: Integer): Boolean;
var
B: TBox;
TPA,TPA2: TPointArray;
Hmod,Smod: Extended;
L,i,Tol,CTS,Col: Integer;
ATPA: T2DPointArray;
begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9095162, 165, 125, 345, 230, 3);
if (Length(TPA) < 1) then
begin
ColorToleranceSpeed(CTS);
Exit;
end;
ATPA := TPAToATPAEx(TPA, 30, 30);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
L := High(ATPA);
SetArrayLength(ATPA, L+1);
for i := 0 to L do
begin
B := GetTPABounds(ATPA[i]);
with B do
begin
ColorToleranceSpeed(2);
ReturnValues(RockCols, Hmod, Smod, Col, Tol);
SetColorSpeed2Modifiers(Hmod, SMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, Col, B.X1, B.Y1, B.X2, B.Y2, Tol)
ColorToleranceSpeed(CTS);
if (Length(TPA2) > 0) then
begin
MiddleTPAEx(ATPA[i], X, Y);
Result := True;
HumanMMouse(X, Y, 5, 5);
if WaitUpTextMulti(['Mine','Rocks'], 555) then
begin
Result := True;
GetMousePos(X, Y);
Exit;
end else
Result := False;
end;
end;
end;
end;
Function FindRock(Var X,Y: Integer): Boolean;
var
B: TBox;
TPA,TPA2: TPointArray;
Hmod,Smod: Extended;
L,i,Tol,CTS,Col: Integer;
ATPA: T2DPointArray;
begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9095162, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(TPA) < 1) then
begin
ColorToleranceSpeed(CTS);
Exit;
end;
ATPA := TPAToATPAEx(TPA, 30, 30);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
L := High(ATPA);
SetArrayLength(ATPA, L+1);
for i := 0 to L do
begin
B := GetTPABounds(ATPA[i]);
with B do
begin
ColorToleranceSpeed(2);
ReturnValues(RockCols, Hmod, Smod, Col, Tol);
SetColorSpeed2Modifiers(Hmod, SMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, Col, B.X1, B.Y1, B.X2, B.Y2, Tol)
ColorToleranceSpeed(CTS);
if (Length(TPA2) > 0) then
begin
MiddleTPAEx(ATPA[i], X, Y);
Result := True;
HumanMMouse(X, Y, 5, 5);
if WaitUpTextMulti(['Mine','Rocks'], 555) then
begin
Result := True;
GetMousePos(X, Y);
Exit;
end else
Result := False;
end;
end;
end;
end;
Procedure WhileMining;
var
XPS,XPE,T: Integer;
begin
XPS := Round(GetXPBarTotal);
case Random(3) of
0..2: HumanMMouse(615, 225, 30, 30);
end;
Marktime(T);
repeat
FindNormalRandoms;
ClickToContinue;
if (TimeFromMark(T) > MineTimer) then
Exit;
if (ExistsItem(1) or ExistsItem(2)) then
break;
if Mining then
begin
Antiban;
Marktime(T);
Wait(1);
end;
until(false)
FastDropSlot(1);
if ExistsItem(2) then
FastDropSlot(2);
XPE := Round(GetXPBarTotal);
IncEx(MineXP, XPE-XPS);
IncEx(MineXP_C, XPE-XPS);
OnScreen;
end;
Function CheckForOre: Boolean;
begin
Result := (ExistsItem(1) or ExistsItem(2));
end;
Procedure MineRocks;
var
X,Y: Integer;
label
Start;
begin
if DoFSearch then
if not UsingFamiliar then
if not RenewFamiliar then
DoFSearch := False;
Start:
MouseSpeed := RandomRange(17, 26);
if FindRockNear(X, Y) then
begin
ClickMouse2(True);
if not DidRedClick then
goto Start;
if FlagPresent then
FFlag(0)
else
While IsMoving_F do
Wait(1);
WhileMining;
end else if FindRock(X, Y) then
begin
ClickMouse2(True);
if not DidRedClick then
goto Start;
if FlagPresent then
FFlag(0)
else
While IsMoving_F do
Wait(1);
WhileMining;
end else if ((not FindRockNear(X, Y) and (not FindRock(X, Y)))) then
begin
Writeln('No rocks, waiting');
FindNormalRandoms;
Antiban;
Wait(RandomRange(750, 1275));
end;
end;
Function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
Var
h,m,s: integer;
begin
if not LoggedIn then Exit;
if (HowManyPlayers = 1) then
begin
if (GetTimeRunning < ((w) + (y) + BreakRounds)) then Exit
else
if (GetTimeRunning > ((w) + (y) + BreakRounds)) then
begin
RealBTime := ((x+z)/60000);
Writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
Logout;
MarkTime(CurrentBTime);
repeat
Wait(21000);
ConvertTime((x+z)-TimeFromMark(CurrentBTime), h, m, s);
//ClearDebug;
Writeln('Breaktime left: '+IntToStr(h)+':'+IntToStr(m)+':'+IntToStr(s));
until(TimeFromMark(CurrentBTime)>(x+z));
Writeln('Logging in.');
OnScreen;
if SwitchWorlds then
if LoginPlayerToLob then
ChangeWorld(RandomWorld(True, False))
else
LoginPlayer;
Wait(4000);
Result := LoggedIn;
ClickNorth(SRL_ANGLE_HIGH);
IncEx(BreakRounds, (w) + (x));
Inc(TotalBreaks);
Writeln('The next break will occur in about ' + IntToStr(BreakIn) + ' minutes.');
w := (BreakIn * 60000);
x := (BreakFor * 60000);
y := RandomRange(-Bir * 60000, Bir * 60000);
z := RandomRange(-Bfr * 60000, Bfr * 60000);
end;
end;
end;
begin
//Smart_Server := 86;
//Smart_Members := True;
//Smart_Signed := True;
//Smart_SuperDetail := False;
setupSRL();
DeclarePlayers;
LoadVars;
SetupSRLStats(524, SRLStats_Username, SRLStats_Password);
if not LoggedIn then
begin
LoginPlayer;
ClickNorth(SRL_ANGLE_HIGH);
end;
ToggleXPBar(True);
//Smart_ClearCanvas;
Wait(RandomRange(300, 500));
OnScreen;
Repeat
if not LoggedIn then
begin
LoginPlayer;
ClickNorth(SRL_ANGLE_HIGH);
end;
BreakHandler(BreakIn,BreakFor,Bir,Bfr);
if (TimeFromMark(CommitTime)>=30000) then
Commit;
if (TimeFromMark(ReportTime)>=5000) then
Report;
FindNormalRandoms;
MineRocks;
until(AllPlayersInactive)
end.
By the way, I don't use the summoning feature so I can't say how well it will work. I just know that this script will mine and drop granite. I did 85-99 with this script.
I kinda had this going on :
Same as you, but i removed the summoning.
As with you, If Flight wants this removes, I'll be kind to do so.
Simba Code:{/////////////////////////////////////////
// Granite Pro //
// //
// Version: 1.0 //
/////////////////////////////////////////}
program GranitePro;
{$DEFINE SRL5}
{$DEFINE SMART}
{$i SRL/srl.simba}
{$i SRL/SRL/Misc/SmartGraphics.Simba}
Const
//SRL Stats
SRLStats_Username = 'Anonymous';
SRLStats_Password = 'Anonymous';
//General settings
SwitchWorlds = False; //Switch worlds after a break?
//Break settings
BreakIn = 999; //How long before we take a break? (minutes)
BreakFor = 15; //How long will we break for? (minutes)
Bir = 13; //Random minutes to add/subtract from how long until we break
Bfr = 7; //Random minutes to add/subjtract from break duraction
Var
Version: String;
DoFSearch: Boolean;
RockCols: TIntegerArray;
MineTimer,MineXP,MineXP_C,
ReportTime,CommitTime,FType: Integer;
//Break variables
w,x,y,z,RealBTime,CurrentBTime,
BreakRounds,TotalBreaks: Integer;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '13imabot';
Pass := 'zbtqyr3';
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Slayer;
Active := True;
end;
end;
Procedure LoadVars;
begin
Version := '1.0';
MarkTime(ReportTime);
MarkTime(CommitTime);
MineTimer := 1000;
MouseSpeed := RandomRange(13, 18);
RockCols := [7052226, 7183813, 7447243, 7710931];
w := (BreakIn * 60000);
x := (BreakFor * 60000);
y := RandomRange(-Bir * 60000, Bir * 60000);
z := RandomRange(-Bfr * 60000, Bfr * 60000);
end;
Procedure Report;
begin
ClearDebug;
WriteLn('=-=-=-Granite Pro Ressurection By Satkan-=-=-=');
WriteLn('Time Running: '+TimeRunning);
WriteLn('Exp gained: '+IntToStr(MineXP));
WriteLn('Breaks: '+IntToStr(TotalBreaks));
WriteLn('=-=-=-=-=-=-=-=Original by Flight=-=-=-=-=-=-=-=');
MarkTime(ReportTime);
end;
Procedure OnScreen;
var
XPH,TTB: Integer;
begin
XPH := Round((MineXP * 3600) / (GetTimeRunning / 1000));
TTB := (((w) + (y) + BreakRounds)-GetTimeRunning);
SMART_DrawTextMulti(True, True, ['Granite Pro '+Version+' Ressurection','',
''+MsToTime(GetTimeRunning, Time_Abbrev),'',
'Mining XP: '+IntToStr(MineXP)+' ('+IntToStr(XPH)+' / hour)'],
Point(10, 260), SmallCharsNS, 16777215);
SMART_DrawTextMulti(False, True, ['Time till break: '+MsToTime(TTB,Time_Bare)], Point(570, 445), SmallCharsNS, 65280);
end;
Procedure Commit;
begin
stats_IncVariable('Mining EXP (Gained)', MineXP_C);
Stats_Commit;
MineXP_C := 0;
MarkTime(CommitTime);
end;
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y,X2,Y2,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(A*MP), eX+(A*MP));
Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
WindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := A;
end;
Procedure HumanRandomMouse;
var
randSpeed: extended;
x, y, firstSpeed: integer;
begin
case(Random(10)) of
2..8:
begin
firstSpeed := mouseSpeed;
mouseSpeed := RandomRange(5,10);
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
GetMousePos(x, y);
WindMouse(x, y, RandomRange(x - 75, x + 75), RandomRange(y - 75, y + 75),
30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
mouseSpeed := firstSpeed;
end;
end;
end;
Function IsMoving_F: Boolean;
begin
Result := PixelShift(IntToBox(MMCX-30, MMCY-30, MMCX+30, MMCY+30), 200) > 200;
end;
Function Mining: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 400);
end;
Function Antiban: Boolean;
var
i: Integer;
begin
if not LoggedIn then Exit;
i := Random(450);
case i of
1..45:
begin
HumanRandomMouse;
Result := True;
end;
46:
begin
HoverSkill('Mining', False);
Result := True;
end;
47..450: Exit;
end;
end;
Function DrinkUp: Boolean;
var
I,C: Integer;
begin
Result := False;
If Not LoggedIn then Exit;
if InvEmpty then Exit;
for i := 3 to 28 do
begin
FindNormalRandoms;
if ExistsItem(i) then
begin
InvMouse(i, mouse_move);
if WaitUpTextMulti(['se V','Vial'], 500) then
begin
ClickMouse2(False);
WaitOptionMulti(['Drop','op V'], 300);
Wait(RandomRange(705, 815));
end;
if WaitUpTextMulti(['rink','ummoning','Potion'], 500) then
begin
ClickMouse2(True);
Wait(RandomRange(705, 815));
begin
Result := True;
Exit;
end;
end;
if (i = 28) then
Exit;
end;
end;
end;
Procedure FastDropSlot(Slot: Integer);
Var
X,Y: Integer;
TB: TBox;
begin
Case Slot of
1: TB := IntToBox(564,214,598,244);
2: TB := IntToBox(606,214,640,244);
end;
MouseSpeed := RandomRange(26,39);
MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, mouse_right);
GetMousePos(X, Y);
MMouse(X, (Y+61), 20, 3);
Wait(RandomRange(20, 75));
ClickMouse2(True);
end;
Procedure ReturnValues(colors: TIntegerArray; var HueMods, SatMods: Extended; var color, Tolerance: Integer);
Var
h, s, t: Extended;
I,II : integer;
HSLColor : Array[1..3] of Extended;
HSL : Array[0..1] of Array[1..3] of Extended;
begin;
For I:= 1 to 3 do
begin;
HSL[0][i] := 255;
end;
For I:= 0 to High(Colors) do
begin;
ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
For II:= 1 to 3 do
begin;
HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
end;
end;
H := (HSL[1][1] - HSL[0][1]);
S := (HSL[1][2] - HSL[0][2]);
T := (HSL[1][3] - HSL[0][3]);
try
HueMods := (H/T);
SatMods := (S/T);
Tolerance := Round(t);
except
HueMods := 0;
SatMods := 0;
Tolerance := Round(0.0);
end;
Color := HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2);
end;
Function FindRockNear(Var X,Y: Integer): Boolean;
var
B: TBox;
TPA,TPA2: TPointArray;
Hmod,Smod: Extended;
L,i,Tol,CTS,Col: Integer;
ATPA: T2DPointArray;
begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9095162, 165, 125, 345, 230, 3);
if (Length(TPA) < 1) then
begin
ColorToleranceSpeed(CTS);
Exit;
end;
ATPA := TPAToATPAEx(TPA, 30, 30);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
L := High(ATPA);
SetArrayLength(ATPA, L+1);
for i := 0 to L do
begin
B := GetTPABounds(ATPA[i]);
with B do
begin
ColorToleranceSpeed(2);
ReturnValues(RockCols, Hmod, Smod, Col, Tol);
SetColorSpeed2Modifiers(Hmod, SMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, Col, B.X1, B.Y1, B.X2, B.Y2, Tol)
ColorToleranceSpeed(CTS);
if (Length(TPA2) > 0) then
begin
MiddleTPAEx(ATPA[i], X, Y);
Result := True;
HumanMMouse(X, Y, 5, 5);
if WaitUpTextMulti(['Mine','Rocks'], 555) then
begin
Result := True;
GetMousePos(X, Y);
Exit;
end else
Result := False;
end;
end;
end;
end;
Function FindRock(Var X,Y: Integer): Boolean;
var
B: TBox;
TPA,TPA2: TPointArray;
Hmod,Smod: Extended;
L,i,Tol,CTS,Col: Integer;
ATPA: T2DPointArray;
begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9095162, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(TPA) < 1) then
begin
ColorToleranceSpeed(CTS);
Exit;
end;
ATPA := TPAToATPAEx(TPA, 30, 30);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
L := High(ATPA);
SetArrayLength(ATPA, L+1);
for i := 0 to L do
begin
B := GetTPABounds(ATPA[i]);
with B do
begin
ColorToleranceSpeed(2);
ReturnValues(RockCols, Hmod, Smod, Col, Tol);
SetColorSpeed2Modifiers(Hmod, SMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, Col, B.X1, B.Y1, B.X2, B.Y2, Tol)
ColorToleranceSpeed(CTS);
if (Length(TPA2) > 0) then
begin
MiddleTPAEx(ATPA[i], X, Y);
Result := True;
HumanMMouse(X, Y, 5, 5);
if WaitUpTextMulti(['Mine','Rocks'], 555) then
begin
Result := True;
GetMousePos(X, Y);
Exit;
end else
Result := False;
end;
end;
end;
end;
Procedure WhileMining;
var
XPS,XPE,T: Integer;
begin
XPS := Round(GetXPBarTotal);
case Random(3) of
0..2: HumanMMouse(615, 225, 30, 30);
end;
Marktime(T);
repeat
FindNormalRandoms;
ClickToContinue;
if (TimeFromMark(T) > MineTimer) then
Exit;
if (ExistsItem(1) or ExistsItem(2)) then
break;
if Mining then
begin
Antiban;
Marktime(T);
Wait(1);
end;
until(false)
FastDropSlot(1);
if ExistsItem(2) then
FastDropSlot(2);
XPE := Round(GetXPBarTotal);
IncEx(MineXP, XPE-XPS);
IncEx(MineXP_C, XPE-XPS);
OnScreen;
end;
Function CheckForOre: Boolean;
begin
Result := (ExistsItem(1) or ExistsItem(2));
end;
Procedure MineRocks;
var
X,Y: Integer;
label
Start;
begin
Start:
MouseSpeed := RandomRange(17, 26);
if FindRockNear(X, Y) then
begin
ClickMouse2(True);
if not DidRedClick then
goto Start;
if FlagPresent then
FFlag(0)
else
While IsMoving_F do
Wait(1);
WhileMining;
end else if FindRock(X, Y) then
begin
ClickMouse2(True);
if not DidRedClick then
goto Start;
if FlagPresent then
FFlag(0)
else
While IsMoving_F do
Wait(1);
WhileMining;
end else if ((not FindRockNear(X, Y) and (not FindRock(X, Y)))) then
begin
Writeln('No rocks, waiting');
FindNormalRandoms;
Antiban;
Wait(RandomRange(750, 1275));
end;
end;
Function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
Var
h,m,s: integer;
begin
if not LoggedIn then Exit;
if (HowManyPlayers = 1) then
begin
if (GetTimeRunning < ((w) + (y) + BreakRounds)) then Exit
else
if (GetTimeRunning > ((w) + (y) + BreakRounds)) then
begin
RealBTime := ((x+z)/60000);
Writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
Logout;
MarkTime(CurrentBTime);
repeat
Wait(21000);
ConvertTime((x+z)-TimeFromMark(CurrentBTime), h, m, s);
ClearDebug;
Writeln('Breaktime left: '+IntToStr(h)+':'+IntToStr(m)+':'+IntToStr(s));
until(TimeFromMark(CurrentBTime)>(x+z));
Writeln('Logging in.');
OnScreen;
if SwitchWorlds then
if LoginPlayerToLob then
ChangeWorld(RandomWorld(True, False))
else
LoginPlayer;
Wait(4000);
Result := LoggedIn;
ClickNorth(SRL_ANGLE_HIGH);
IncEx(BreakRounds, (w) + (x));
Inc(TotalBreaks);
Writeln('The next break will occur in about ' + IntToStr(BreakIn) + ' minutes.');
w := (BreakIn * 60000);
x := (BreakFor * 60000);
y := RandomRange(-Bir * 60000, Bir * 60000);
z := RandomRange(-Bfr * 60000, Bfr * 60000);
end;
end;
end;
begin
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
setupSRL();
DeclarePlayers;
LoadVars;
SetupSRLStats(524, SRLStats_Username, SRLStats_Password);
if not LoggedIn then
begin
LoginPlayer;
ClickNorth(SRL_ANGLE_HIGH);
end;
ToggleXPBar(True);
Smart_ClearCanvas;
Wait(RandomRange(300, 500));
OnScreen;
Repeat
if not LoggedIn then
begin
LoginPlayer;
ClickNorth(SRL_ANGLE_HIGH);
end;
BreakHandler(BreakIn,BreakFor,Bir,Bfr);
if (TimeFromMark(CommitTime)>=30000) then
Commit;
if (TimeFromMark(ReportTime)>=5000) then
Report;
FindNormalRandoms;
MineRocks;
until(AllPlayersInactive)
end.
I just was unable to test it becourse i don't have a water talisman yet.
(Was looking to add banking for ze waterskins.)
Last edited by satkan; 09-11-2012 at 08:38 PM.
Activity
Going asian on University College Ghent.
No time for anything atm.
I believe Andres' version would work fine for you. I might be wrong but I believe only the loading of SMART within the script would need to be changed. If it's still broken then it's a matter of updating colors and/or DTMs; no problem at all.
I did state earlier that Granite Pro would be one of the scripts I'd be updating, that holds true and I do plan to give it some upgrades (including banking), but I'm persistent to fix LividFarmer & Barb Fly-fisher. These are my main priorities at the moment so I apologize that Granite Pro isn't updated yet.
If you're having trouble running Granite Pro then take a look at the original thread, if the instructions there don't help then drop me a PM and I'll help what I can.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
There are currently 1 users browsing this thread. (0 members and 1 guests)