Everyone says they just "whipped this up and tossing it here"
No.. I didn't just whip this up. I put some effort in and tested a while before having to go to work.
I just thought maybe somebody would like to try this out and fix it up, at the moment it has quite a few kinks, but it occasionally does what its supposed to. So here it is. Don't be shy. Just make sure you have SMART up and logged in.
Simba Code:
program new;
{$Define SMART}
{$I SRL/SRL.Simba}
{$i srl/srl/misc/debug.simba}
{$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}
{$i sps/sps.simba}
// JDDivination, by Wu-Tang Clan
const
Which = 'Energy';
// Energy - Convert memories into divine energy
// Experience - Convert memories into divination experience
// Combo - !NOT RECOMMENDED! Combine both energy and memories to get more experience
// When using combo, it is recommended that you use the Energy setting for a while beforehand
function ChatBoxUp: Boolean; // Not in use ATM.. not working correctly
// Inv Full message via chatbox
begin
WriteLn('Hoping for 15723220, we got: ' + IntToStr (getcolor(447,549)));
if (getcolor(447,549) = 12565949) then
begin
KeyDown(32);
Wait(500+Random(100));
Result := True;
end;
end;
function IsDiv: Boolean;
// The divination skill popup is up (collected in last 5 seconds)
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
Writeln('IsDiv;');
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.45, 0.97);
FindColorsSpiralTolerance(399,25,TPA,2892290, 386,11, 411,39,10); // Starts at center coordinates of character in mainscreen and spirals out
ATPA := TPAToATPAEx(TPA, 30, 30); // Splits TPA into ATPA 40x40 boxes
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
if Length(ATPA) = 0 then
begin
Writeln('IsDiv = False');
Exit;
end;
if Length(ATPA) < 3 then
begin
WriteLn('IsDiv = True');
Result := True;
end;
end;
function CheckInv: Boolean;
// Mouses on last inventory slot to see if there is a memory
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
Writeln('CheckInv;');
while (IsDiv) do Wait(1000+Random(500));
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.45, 0.97);
FindColorsSpiralTolerance(754,535,TPA,2892290, 738,526, 770, 550,10); // Starts at center coordinates of character in mainscreen and spirals out
ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
If Length(ATPA) = 0 Then
begin
Writeln('CheckInv = False');
Exit;
end;
For I := 0 To H Do
begin
SortATPASize(ATPA,True);
//SortATPAFrom(ATPA, Point(301,175));
WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
MiddleTPAEx(ATPA[I], X, Y);
MMouse(x,y,4,2);
Clickmouse2(mouse_right);
if OptionsExist(['estroy'], Nothing) then
begin
WriteLn('We have found Memory in last InvSlot!');
Wait(1000+random(500));
Result := True;
end;
end;
//debugatpabounds(atpa);
end;
procedure Walk;
// Walks to Rift via SPS !YOU MAY NOT HAVE SPS PROPERLY SET UP!
var
myPath:TPointArray;
begin
writeLn('Walking to Rift');
SPS_Setup(RUNESCAPE_SURFACE, ['10_9']);
myPath := [Point(4267, 3746)];
SPS_WalkPath(myPath);
end;
procedure FindPale;
// Finds pale wisps and harvests them
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
Writeln('FindPale;');
while (IsDiv) do Wait(1000+Random(500));
if (CheckInv = True) then
begin
Exit;
end;
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.29, 0.29);
FindColorsSpiralTolerance(301,175,TPA,15899741, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
If Length(ATPA) = 0 Then
begin
Exit;
end;
For I := 0 To H Do
begin
//SortATPASize(ATPA,True);
SortATPAFrom(ATPA, Point(301,175));
WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
MiddleTPAEx(ATPA[I], X, Y);
MMouse(x,y,4,2);
Clickmouse2(mouse_right);
if WaitOption('arvest ',500) then
begin
WriteLn('We have found Pale thing!');
Wait(5000+random(500));
break;
end;
end;
//debugatpabounds(atpa);
end;
procedure FindRift;
// Once inventory is full, will find Rift
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
Writeln('FindRift;');
if (CheckInv = True) then
begin
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.21, 0.47);
FindColorsSpiralTolerance(301,175,TPA,4520078, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
ATPA := TPAToATPAEx(TPA, 25, 25); // Splits TPA into ATPA 40x40 boxes
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
If Length(ATPA) = 0 Then
begin
Exit;
end;
For I := 0 To H Do
begin
SortATPASize(ATPA,True);
//SortATPAFrom(ATPA, Point(301,175));
WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
MiddleTPAEx(ATPA[I], X, Y);
MMouse(x,y,4,2);
Clickmouse2(mouse_left);
{if waitOption('onvert',800) then
begin
WriteLn('We have found Rift!');
Wait(1000+random(500));
break;
end;}
end;
//debugatpabounds(atpa);
end;
end;
procedure Convert;
// Depending on which const you used, you will convert your memories/energy in the UI
begin
Writeln('Convert;');
Walk;
FindRift;
Wait(1000+Random(700));
if (GetColor(343,142) = 986895) then
begin
case (Which) of
'Energy':
begin
Mouse(175,199,7,7,Mouse_Left);
Wait(1000);
if (IsDiv) then
repeat
Wait(1000);
until not (IsDiv);
end;
'Experience':
begin
Mouse(296,201,5,5,Mouse_Left);
Wait(1000);
if (IsDiv) then
repeat
Wait(1000);
until not (IsDiv);
end;
'Combo':
begin
Mouse(389,212,7,6,Mouse_Left);
Wait(1000);
if (IsDiv) then
repeat
Wait(1000);
until not (IsDiv);
end;
end;
end;
end;
begin
SetupSRL;
repeat
FindPale;
Wait(2000);
Convert;
Wait(1000+Random(500));
until (False);
end.
Enjoy. I'll be back later and see what I can do.
EDIT: So I posted what I've done a little bit on. At the moment its pretty debug box intensive..
I changed most of the getcolor functions to TPA, but even they tend to be inaccurate. I've changed them multiple times and they usually return false which I'm probably doing wrong. It usually just finds a pale wisp, clicks on it, then returns false for isDiv. After that it walks to the rift, and then clicks on more wisps. It no longer clicks on the rift like its supposed to.
EDIT2: Reached 10 Div... so I changed some stuff and optimized it for flickering. Not much to change though. It works fairly good.
Simba Code:
program new;
{$Define SMART}
{$I SRL/SRL.Simba}
{$i srl/srl/misc/debug.simba}
{$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}
{$i sps/sps.simba}
// JDDivination, by Wu-Tang Clan
const
Which = 'Energy';
// Energy - Convert memories into divine energy
// Experience - Convert memories into divination experience
// Combo - !NOT RECOMMENDED! Combine both energy and memories to get more experience
// When using combo, it is recommended that you use the Energy setting for a while beforehand
var
Dfail,Pfail,Rfail: Integer;
function CheckInv: Boolean;
// Mouses on last inventory slot to see if there is a memory
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.45, 0.97);
FindColorsSpiralTolerance(754,535,TPA,2892290, 738,526, 770, 550,10); // Starts at center coordinates of character in mainscreen and spirals out
ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
If Length(ATPA) = 0 Then
begin
Wait(1500+Random(500));
WriteLn('CheckInv = False');
Exit;
end;
For I := 0 To H Do
begin
SortATPASize(ATPA,True);
//SortATPAFrom(ATPA, Point(301,175));
WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
MiddleTPAEx(ATPA[I], X, Y);
MMouse(x,y,4,2);
Clickmouse2(mouse_right);
if OptionsExist(['estroy'], Nothing) then
begin
WriteLn('We have found Memory in last InvSlot!');
Wait(1000+random(500));
MMouse(111,222,50,60);
Result := True;
end;
end;
//debugatpabounds(atpa);
end;
function IsDiv: Boolean;
// The divination skill popup is up (collected in last 5 seconds)
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.25, 0.25);
FindColorsSpiralTolerance(399,25,TPA,1776411, 386,11, 411,39,5); // Starts at center coordinates of character in mainscreen and spirals out
ATPA := TPAToATPAEx(TPA, 21, 21); // Splits TPA into ATPA 40x40 boxes
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
if Length(ATPA) = 0 then
begin
Wait(1500+Random(500));
Writeln('IsDiv = False');
Inc(Dfail);
Exit;
end;
if Length(ATPA) < 3 then
begin
WriteLn('IsDiv = True');
Result := True;
end;
end;
procedure Walk;
// Walks to Rift via SPS !YOU MAY NOT HAVE SPS PROPERLY SET UP!
var
myPath:TPointArray;
begin
writeLn('Walking to Rift');
SPS_Setup(RUNESCAPE_SURFACE, ['9_7']);
myPath := [Point(3816, 2986)];
SPS_WalkPath(myPath);
end;
procedure FindPale;
// Finds pale wisps and harvests them
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
Writeln('FindPale;');
while (IsDiv = True) do Wait(1000);
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.29, 0.29);
FindColorsSpiralTolerance(301,175,TPA,15899741, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
If Length(ATPA) = 0 Then
begin
Wait(1500+Random(500));
WriteLn('FindPale = False');
Inc(Pfail);
Exit;
end;
For I := 0 To H Do
begin
//SortATPASize(ATPA,True);
SortATPAFrom(ATPA, Point(301,175));
WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
MiddleTPAEx(ATPA[I], X, Y);
MMouse(x,y,4,2);
Clickmouse2(mouse_right);
if WaitOption('arvest ',500) then
begin
WriteLn('We have found Pale thing!');
Wait(5000+random(500));
break;
end;
end;
//debugatpabounds(atpa);
end;
procedure FindRift;
// Once inventory is full, will find Rift
var
TPA: Array of TPoint;
ATPA: T2DPointArray;
Box: TBox;
TheCTS, I, X, Y, H : Integer;
begin
Writeln('FindRift;');
if (CheckInv = True) then
begin
theCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.21, 0.47);
FindColorsSpiralTolerance(301,175,TPA,4520078, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
ATPA := TPAToATPAEx(TPA, 25, 25); // Splits TPA into ATPA 40x40 boxes
SetColorToleranceSpeed(theCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
H := High(ATPA);
If Length(ATPA) = 0 Then
begin
writeln('No points found for FindRift;');
Inc(Rfail);
Exit;
end;
For I := 0 To H Do
begin
SortATPASize(ATPA,True);
//SortATPAFrom(ATPA, Point(301,175));
WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
MiddleTPAEx(ATPA[I], X, Y);
MMouse(x,y,4,2);
Clickmouse2(mouse_left);
if waitOption('onvert',800) then
begin
WriteLn('We have found Rift!');
Wait(1000+random(500));
break;
end;
Wait(1000+Random(500));
end;
//debugatpabounds(atpa);
end;
end;
procedure Convert;
// Depending on which const you used, you will convert your memories/energy in the UI
begin
if (CheckInv = True) then
Writeln('Convert;');
Walk;
Wait(1500+Random(500));
FindRift;
Wait(3000+Random(700));
if (GetColor(343,142) = 986895) then
begin
case (Which) of
'Energy':
begin
Mouse(175,199,7,7,Mouse_Left);
Wait(1000);
if (IsDiv) then
repeat
Wait(1000);
until not (IsDiv);
end;
'Experience':
begin
Mouse(296,201,5,5,Mouse_Left);
Wait(1000);
if (IsDiv) then
repeat
Wait(1000);
until not (IsDiv);
end;
'Combo':
begin
Mouse(389,212,7,6,Mouse_Left);
Wait(1000);
if (IsDiv) then
repeat
Wait(1000);
until not (IsDiv);
end;
end;
end;
end;
procedure FailSafe;
begin
if (Pfail < 5) then
begin
WriteLn('Pfail < 5');
Walk;
end;
if (Rfail < 5) then
begin
WriteLn('Rfail < 5');
Walk;
end;
if (Dfail < 5) then
begin
WriteLn('Dfail < 5');
Walk;
end;
end;
begin
SetupSRL;
repeat
FindPale;
Wait(2000);
Convert;
Wait(1000+Random(500));
Failsafe;
until (False);
end.
I think its not working too bad aside from the fact that it will occasionally deposit memories before a full inv.
EDIT3: Fixed the inventory error I think. Working well at the moment. If you want to use the tier 1 wisps and are unsure of how to get the script I just recently posted, please pm me and I will help you.
Happy divining guys.
@
Justin do you have rights to add a divination section? You're the first person to come to mind.
EDIT4: This could also just get moved to development or wherever you see fit. Just make sure its in the public.