PDA

View Full Version : Updated LodeStone



Element17
06-26-2013, 04:35 AM
I just added the new points to the my include. Should work. I tested it and it worked for me. Not sure if anyone else updated this yet.



function LodestoneTeleport(Where: String): Boolean;
var
TPA: TPointArray;
TSA: TStringArray;
CTS, I: Integer;
begin
if not LoggedIn then Exit;
if not LodestoneScreen then
if not OpenLodestoneScreen then
Exit;
Wait(RandomRange(400, 1000));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);

TSA := ['Lunar Isle', 'Yanille', 'Ardougne', 'Seers Village', 'Catherby', 'Taverley',
'Burthorpe', 'Edgeville', 'Falador', 'Port Sarim', 'Draynor Village', 'Lumbridge',
'Varrock', 'Al Kharid', 'Bandit Camp', 'Fremennik Province', 'Eagles Peak', 'Tirannwn',
'Ooglog', 'Karmaja', 'Wilderness', 'Canifis'];

TPA := [Point(45, 78), Point(160, 262), Point(167, 211), Point(192, 158), Point(223, 181),
Point(253, 180), Point(251, 145), Point(293, 160), Point(278, 206), Point(276, 249), Point(308, 211),
Point(327, 243), Point(345, 182), Point(362, 229), Point(326, 297), Point(199, 120), Point(102, 180), Point(98, 225),
Point(150, 300), Point(220, 255), Point(311, 120), Point(401, 175)];

for I := 0 to 22 do
if Capitalize(Where) = TSA[I] then
begin
Mouse(TPA[I].X, TPA[I].Y, 2, 2, mouse_left);
Result := True;
end;

ColorToleranceSpeed(CTS);
end;

The Mayor
06-26-2013, 04:47 AM
Nice. This should be added to the next SRL update.

loragnor
06-27-2013, 09:41 PM
I just added the new points to the my include. Should work. I tested it and it worked for me. Not sure if anyone else updated this yet.



function LodestoneTeleport(Where: String): Boolean;
var
TPA: TPointArray;
TSA: TStringArray;
CTS, I: Integer;
begin
if not LoggedIn then Exit;
if not LodestoneScreen then
if not OpenLodestoneScreen then
Exit;
Wait(RandomRange(400, 1000));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);

TSA := ['Lunar Isle', 'Yanille', 'Ardougne', 'Seers Village', 'Catherby', 'Taverley',
'Burthorpe', 'Edgeville', 'Falador', 'Port Sarim', 'Draynor Village', 'Lumbridge',
'Varrock', 'Al Kharid', 'Bandit Camp', 'Fremennik Province', 'Eagles Peak', 'Tirannwn',
'Ooglog', 'Karmaja', 'Wilderness', 'Canifis'];

TPA := [Point(45, 78), Point(160, 262), Point(167, 211), Point(192, 158), Point(223, 181),
Point(253, 180), Point(251, 145), Point(293, 160), Point(278, 206), Point(276, 249), Point(308, 211),
Point(327, 243), Point(345, 182), Point(362, 229), Point(326, 297), Point(199, 120), Point(102, 180), Point(98, 225),
Point(150, 300), Point(220, 255), Point(311, 120), Point(401, 175)];

{for I := 0 to 14 do // This will not work anymore since there are more than 14 elements to the TSA}
for I := 0 to High(TSA) do
if Capitalize(Where) = TSA[I] then
begin
Mouse(TPA[I].X, TPA[I].Y, 2, 2, mouse_left);
Result := True;
end;

ColorToleranceSpeed(CTS);
end;

I was just coming in here to do the same thing. :)

Notice the change needed for the for..do loop.

Element17
06-27-2013, 10:52 PM
Thanks for that. I updated the post.

loragnor
06-27-2013, 11:13 PM
Thanks for that. I updated the post.

Just a question: Why do you prefer use a static number in the limit of the for..do loop instead of a dynamic one based on the size of the array being iterated?

Element17
06-28-2013, 01:10 AM
It is a static array, so it never changes.

I also don't think there is any real difference?

loragnor
06-28-2013, 10:04 AM
It is a static array, so it never changes.

LOL. It IS a static array, but a few days ago it changed. :) Using the more dynamic limit on the loop would not require modification no matter if Jagex added 100 more lodestones or reduced the number to one.


I also don't think there is any real difference?

It is merely a technique, but a dynamic limit on a loop is more versatile and, in my eyes anyway, a bit more elegant.

Element17
06-28-2013, 01:37 PM
LOL. It IS a static array, but a few days ago it changed. :) Using the more dynamic limit on the loop would not require modification no matter if Jagex added 100 more lodestones or reduced the number to one.



It is merely a technique, but a dynamic limit on a loop is more versatile and, in my eyes anyway, a bit more elegant.

That maybe true, but to each his own haha. Again thanks for pointing it out in the first place.

loragnor
06-28-2013, 01:53 PM
That maybe true, but to each his own haha. Again thanks for pointing it out in the first place.

NP. Glad for the exchange.