SRL Archive - SRL Suggestions

function LodestoneTeleport(Where :String) :Boolean;


Home

2012-03-18 13:29:21

Lodestone Teleport function.
Please see Example how to use, I did not add If Cast('Home') then..
Because it's up to scripter what kind of spellbook they are using currently.
It doesn't close Window even if it didn't teleport because I find it extremely Bot like. Scripter can do this
Ex.
If not LodestoneTeleport('Varrock') then CloseWindow; 


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

.. code-block:: pascal

function BankScreen: Boolean;

Finds LodestoneScreen. Returns true if Found.

.. note::

Author: Home

Example:

.. code-block:: pascal

If LodestoneScreen then
WriteLn('Lodestone Network screen is open!');
*)
function LodestoneScreen :Boolean;
begin
Result := CountColor(12378347, 172, 26, 345, 42) > 500;
end;


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

.. code-block:: pascal

function LodestoneTeleport(Where :String) :Boolean;

Teleports you to chosen location via Lodestone teleport.

.. note::

Author: Home

Example:

.. code-block:: pascal

If CastHomeTeleport then
Lodestoneteleport('Lumbridge');
*)
function LodestoneTeleport(Where :String) :Boolean;
var
TPA :TPointArray;
TSA :TStringArray;
Box :TBox;
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 WaitFindColors(TPA, 11447982, MSX1, MSY1, MSX2, MSY2, 0, 3000) then
If Length(TPA) <> 0 then
begin
Box := GetTPABounds(TPA);
If FindTextTPAMulti(12378347, 0, Box.X1, Box.Y1, Box.X2, Box.Y2, ['Click', 'to', 'teleport', 'this'], smallChars, Nothing) then
begin
ClickMouse2(Mouse_Left);
Result := True;
end;
end;
end;

ColorToleranceSpeed(CTS);
end;


~Home

momotron

2012-03-18 13:46:05

Nice man! :O This lodestone business has made scripting much easier :)
oh and just a observation, how're you not a SRL Developer yet? :O

Gu3st...

2012-03-18 14:22:36

The only problem I see is that in the case of where you something in the Where variable that is not a part of the string array, then it will set the ColorToleranceSpeed to 0

Other than that: Good job :)

Home

2012-03-18 14:28:36

From: Zyt3x
The only problem I see is that in the case of where you something in the Where variable that is not a part of the string array, then it will set the ColorToleranceSpeed to 0

Other than that: Good job :)


Damn sorry my bad. I did this in a little bit rush. I will fix it :)

Edit: Fixed.

~Home

begginer

2012-03-18 14:35:08

This suggestion should be considerate and approve.

Coh3n

2012-03-18 15:43:09

Does the window close automatically if you teleport?

Home

2012-03-18 16:08:04

From: Coh3n
Does the window close automatically if you teleport?


Yes it does.


~Home

Olly

2012-03-18 18:22:29

Nice work this will be alot better than the one im currently unseeing that I made from mouse boxes :P

Flight

2012-03-18 21:07:08

Nice indeed. It should surely be added to the library.

Coh3n

2012-03-25 03:37:21

http://villavu.com/forum/showthread.php?t=78301