SRL Archive - SRL Bugs

LodeStoneTeleport Failing [Fix]


Mat

2012-08-08 20:00:45

Hey I have fixed and modified these.
( I didn't know where to Post Sorry!)

(*
LodestoneScreen
~~~~~~~~~~~~~~~

.. code-block:: pascal

function BankScreen: Boolean;

Finds LodestoneScreen. Returns true if Found.

.. note::

Author: Home /Updated Mat

Example:

.. code-block:: pascal

If LodestoneScreen then
WriteLn('Lodestone Network screen is open!');
*)
function LodestoneScreen: Boolean;
begin
Result := CountColorTolerance(10269641,185, 171-50, 240, 200-50,15) > 500;
end;


(*
LodestoneTeleport
~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function LodestoneTeleport(Where: String): Boolean;

Teleports you to chosen location via Lodestone teleport.

.. note::

Author: Home / Update Mat

Example:

.. code-block:: pascal

If CastHomeTeleport then
Lodestoneteleport('Lumbridge');
*)
function LodestoneTeleport(Where: String): Boolean;
var
TPA: TPointArray;
TSA: TStringArray;
CTS, I: Integer;
begin
If not LoggedIn then Exit;
If not LodestoneScreen then Exit;

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'];

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)];

for I := 0 to 14 do
if Capitalize(Where) = TSA[I] then
begin
MMouse(TPA[I].X, TPA[I].Y, 2, 2);

if (WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400)) then
begin
ClickMouse2(Mouse_Left);
Result := true;
end else
begin
ClickMouse2(Mouse_Right);
if (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))then
Result := true;
end;
end;

ColorToleranceSpeed(CTS);
end;
On LodestoneScreen I added a Tolerance and change where it searched.
On LodestoneTeleport I added a fail safe to Right click and choose Option if it can't read the up text.
Thanks
Mat

Nebula

2012-08-08 20:07:49

      if (WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400)) then
begin
ClickMouse2(Mouse_Left);
Result := true;
end else
begin
ClickMouse2(Mouse_Left);
if (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))then
Result := true;
end;

Shouldn't the second ClickMouse2 be a right click?

Mat

2012-08-08 20:08:42

Ow My Bad :D
Yea I changed it :P
Thank
Mat

putonajonny

2012-08-08 20:11:58

 if (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))then
Result := true;
Could just be:
Result := WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400);

Mat

2012-08-08 20:12:44

I just did what Home did but for the else.
But yea you could :)
Mat

Nebula

2012-08-08 20:29:55

Well if you wanted to get really picky you could just completely shorten it all to this:


result := (((WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400)) and (ClickMouse2(true))) or ((ClickMouse2(Mouse_Right)) and (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))));

There's probably a parentheses issue in there somewhere but yeah haha. Just shows how condensed stuff can get.

Mat

2012-08-08 20:34:10

And Messy stuff can get.
Mat

Nebula

2012-08-08 20:35:22

From: Mat
And Messy stuff can get.
Mat


Not messy complex :)

Mat

2012-08-08 20:37:55

Messy…
That Looks Messy.
Let, stop..
All I did was fix it and add a fail safe, I not going to change stuff, just because you can.
Mat

putonajonny

2012-08-08 20:38:20

From: Nebula
Well if you wanted to get really picky you could just completely shorten it all to this:


result := (((WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400)) and (ClickMouse2(true))) or ((ClickMouse2(Mouse_Right)) and (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))));

There's probably a parentheses issue in there somewhere but yeah haha. Just shows how condensed stuff can get.


I don't think ClickMouse2() is a function, so this wouldn't work… :/

If it is it would be:
result := (WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400) and ClickMouse2(true)) or (ClickMouse2(Mouse_Right) and WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400));

Mat

2012-08-08 20:39:38

ClickMouse2(True);
Click's Left and False Right.
But you also can use Mouse_*
Mat
*but no I don't thing it returns anything. I miss read :D