SRL Archive - OSR Help

Teleporting Help.


Ilya

2012-04-30 17:05:43

Is there a simple way to make the script teleport using the "Home Teleport" option and then selecting a location?
If not how would I make it select the magic tab and click the home teleport spell?
Thanks in advance!
-Ilya

nickrules

2012-04-30 17:14:37

(*
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;

it's in mapwalk.simba

and here's a list of possible locations:

['Lunar Isle', 'Yanille', 'Ardougne', 'Seers Village', 'Catherby', 'Taverley',
'Burthorpe', 'Edgeville', 'Falador', 'Port Sarim', 'Draynor Village', 'Lumbridge',
'Varrock', 'Al Kharid', 'Bandit Camp'];

putonajonny

2012-04-30 17:16:14

Look at the Magic.Simba file, include it in your script, you'll need to "Cast" the spell then wait for the "LodestoneScreen" then cast the "LodestoneTeleport", I can't be clearer than that without just making the function for you


From: nickrules
(*
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;

it's in mapwalk.simba

and here's a list of possible locations:

['Lunar Isle', 'Yanille', 'Ardougne', 'Seers Village', 'Catherby', 'Taverley',
'Burthorpe', 'Edgeville', 'Falador', 'Port Sarim', 'Draynor Village', 'Lumbridge',
'Varrock', 'Al Kharid', 'Bandit Camp'];


Just be aware this function doesn't cast the spell, it just clicks on the symbol on the lodestone screen

Ilya

2012-04-30 17:34:09

I got this far:


function TeleEdge(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 then
begin
MMouse(TPA.X, TPA.Y, 2, 2);

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

ColorToleranceSpeed(CTS);
end;


How do I make it tele to edge?
if i am having it tele to edge and back to varrock do i need to put the function in there twice, or just once and make it tele differently in the mainloop?
Thanks again, I know i'm a n00b.

nickrules

2012-04-30 18:25:11

From: Ilya
I got this far:


function TeleEdge(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 then
begin
MMouse(TPA.X, TPA.Y, 2, 2);

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

ColorToleranceSpeed(CTS);
end;


How do I make it tele to edge?
if i am having it tele to edge and back to varrock do i need to put the function in there twice, or just once and make it tele differently in the mainloop?
Thanks again, I know i'm a n00b.


Oh dear, i think I've mislead you :p

To teleport to edgeville:

If CastHomeTeleport then
Lodestoneteleport('Edgeville');


That's it. That's all you have to do. The function is in SRL, so you don't need to copy/paste it in to your script or anything. All you have to do is call the function in the script, like I did right there.

putonajonny

2012-04-30 18:29:04

From: nickrules
Oh dear, i think I've mislead you :p

To teleport to edgeville:

If CastHomeTeleport then
Lodestoneteleport('Edgeville');


That's it. That's all you have to do. The function is in SRL, so you don't need to copy/paste it in to your script or anything. All you have to do is call the function in the script, like I did right there.


I don't think CastHomeTeleport is a real procedure… he has to make that one

Ilya

2012-04-30 19:22:02

I'm lost.
I'll look at it tomorrow.
Head doesn't work.

nickrules

2012-04-30 21:37:14

From: putonajonny
I don't think CastHomeTeleport is a real procedure… he has to make that one


Oh. I just copy and pasted the example, lol.

@OP when you revisit this tomorrow, remember that the Lodestoneteleport function is in SRL already. Just like Mouse() is already in SRL.

Notice how you don't need to copy and paste all the code for the Mouse procedure. This is because it's included in the code. Same thing for Lodestoneteleport.

Ilya

2012-04-30 22:50:06

so how would i include it in my script?
can i simply have
Lodestoneteleport('Edgeville');
in my main loop to make it tele edge?

J J

2012-05-01 04:14:47

From: Ilya
so how would i include it in my script?
can i simply have
Lodestoneteleport('Edgeville');
in my main loop to make it tele edge?

It does only select the desired lodestone, it doesn't click home teleport.

This is a simple example of an own made procedure that casts home teleports, and click on the edgeville lodestone.

procedure NavigateToShop;
var
X, Y: integer;

begin;
if GetCurrentTab = (tab_Magic) then
begin
WriteLn('Current tab is the magic tab, correct!')
end else
begin
FTab(tab_Magic);
WriteLn('Changed tab to the magic tab')
end;
MouseBox(562, 217, 585, 240, 1); //HOME TELEPORT
Wait(500 + Random(500));
MouseBox(272, 136, 311, 175, 1); //EDGEVILLE LODESTONE
Wait(16500 + Random(500));
end;

The teleporting time is around 16.5 seconds = 16500 ms
You just need to edit the Mousebox of the edgeville lodestone to your own lodestone. Unless you want to teleport to edgeville, ofcourse.

Use the color picker to get the top left co-ordinate of the box, and then use it again to get the bottom right co-ordinate of the box.

Example: Top/left = 50, 10
Bottom/right = 75, 25

Mousebox would be (50, 10, 75, 25) and the last part is what the mouse should do, in this case its a left click which is 1

So it would look like this:
Mousebox(50, 10, 75, 25, 1);

ssshhhaaa

2012-05-01 04:17:25

Check out this thread : http://villavu.com/forum/showthread.php?t=80329

nickrules

2012-05-01 06:28:11

From: Ilya
can i simply have
Lodestoneteleport('Edgeville');
in my main loop to make it tele edge?


Yes, because it is a part of SRL, just like Mouse(). You don't need anything else.

Ilya

2012-05-01 12:54:13

From: nickrules
Yes, because it is a part of SRL, just like Mouse(). You don't need anything else.


Tried it, didn't work.
Trying what was stated by JJ.
Will get back.



Alright check this out.

begin
FTab(tab_Magic);
WriteLn('Changed tab to the magic tab')
end;
MouseBox(562, 217, 585, 240, 1); //HOME TELEPORT
Wait(5000 + Random(500)); <———–this works but i feel it's unreliable
MouseBox(272, 136, 311, 175, 1); //EDGEVILLE LODESTONE
Wait(16500 + Random(500));
end;





begin
FTab(tab_Magic);
WriteLn('Changed tab to the magic tab')
end;
MouseBox(562, 217, 585, 240, 1); //HOME TELEPORT
Wait(5000 + Random(500));
Lodestoneteleport('Edgeville');<————————this selects edgeville, but doesn't click it??
//MouseBox(272, 136, 311, 175, 1); //EDGEVILLE LODESTONE
//Wait(16500 + Random(500));
end;

so now my question is how do i make the mouse click in it's current position?

Ilya

2012-05-01 13:19:55

From: J J
It does only select the desired lodestone, it doesn't click home teleport.

This is a simple example of an own made procedure that casts home teleports, and click on the edgeville lodestone.

procedure NavigateToShop;
var
X, Y: integer;

begin;
if GetCurrentTab = (tab_Magic) then
begin
WriteLn('Current tab is the magic tab, correct!')
end else
begin
FTab(tab_Magic);
WriteLn('Changed tab to the magic tab')
end;
MouseBox(562, 217, 585, 240, 1); //HOME TELEPORT
Wait(500 + Random(500));
MouseBox(272, 136, 311, 175, 1); //EDGEVILLE LODESTONE
Wait(16500 + Random(500));
end;

The teleporting time is around 16.5 seconds = 16500 ms
You just need to edit the Mousebox of the edgeville lodestone to your own lodestone. Unless you want to teleport to edgeville, ofcourse.

Use the color picker to get the top left co-ordinate of the box, and then use it again to get the bottom right co-ordinate of the box.

Example: Top/left = 50, 10
Bottom/right = 75, 25

Mousebox would be (50, 10, 75, 25) and the last part is what the mouse should do, in this case its a left click which is 1

So it would look like this:
Mousebox(50, 10, 75, 25, 1);




Working great!! Thanks for your help.
Next question I have: how would I use minimap icons to walk?

Ilya

2012-05-02 00:10:30

Thanks Everyone for your help.
I got it working flawlessly.
Thread can be closed.