Page 1 of 1

teleport follow userfunction

Posted: Thu Apr 12, 2012 10:07 pm
by lisa
This userfunction is for following something using teleport.

Code: Select all

function telefollow(_dist,address)
It is designed to "follow" something when the function is called, by follow I mean teleport to it, so if you want it to repeatedly be that distance from the "something" then you need to do a loop.


"_dist" You must specify a distance value.
"address" If no address speficied then it will use your current target.


--=== Usage examples ===--

1. Follow party member 1 until player icon is set to 2

Code: Select all

repeat
telefollow(50, GetPartyMemberAddress(1))
yrest(500)
until player:GetPartyIcon() == 2
2. some event thingy

Code: Select all

while (true) do
player:target(player:findNearestNameOrId(105476))
telefollow(50) -- follows target
yrest(500)
end
3. teleport behind mob before using skill (melee), in Profile.

Code: Select all

<onPreSkillCast>
target = player:getTarget();
if target.Type == PT_MONSTER then
telefollow(50,target.Address)
end
</onPreSkillCast>

--=== Notes ===--
You need Rock5's teleport userfunction
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2721

Examples are untested but will probably work.
Has no arguments to alter Y value, it will be same height as what you are "following"



Please test it and play around and post any issues you find, I don't even log on to RoM anymore, so I don't do any testing myself.

Re: teleport follow userfunction

Posted: Thu Mar 21, 2024 7:16 am
by ThulsaDoom
Hi;
I have realized that the function

Code: Select all

function telefollow(_dist,address)
Does not work. When you call it it doesn't teleport you, it just doesn't do anything.

What could it be due to, any change in memory addresses?

Thanks

Re: teleport follow userfunction

Posted: Thu Mar 21, 2024 3:19 pm
by Administrator
I just tested this out myself. As far as I can tell, it works just fine.

To test, I first got the address of monster. Then, I just plugged it into the function like so:

Code: Select all

	local followtgt = 0x4B747800;
	telefollow(10, followtgt);
When ran, my character continually teleported a few steps forward until reaching the position of the monster.


What may have happened, though, is that you used the copy of
userfunction_teleport.lua
from here. This is an older version, and probably won't work. If you did download that file and replace it, please revert back.
For your convenience, you can just copy and paste it from here: https://raw.githubusercontent.com/Solar ... leport.lua

Re: teleport follow userfunction

Posted: Sat Mar 23, 2024 12:15 pm
by ThulsaDoom
That was the problem, not updated.

Thank you so much