Auto Follow Xenobot

1,203 Followers, 300 Following, 11 Posts - See Instagram photos and videos from abdou now online (@abdoualittlebit). Originally Posted by Solis. Need a hotkey that auto follows (or maybe reach should be better) x person but when he attacks a creature it kills it first before putting reaching or follow again, possible? This would help me alot. Local main = 'Eternal Oblivion'. Local distance = 3.

05-18-2020, 04:03 AM
As the title says, this is the old advanced Xenobot follow, only translated to OTCv8, credits to whoever made the xeno script, cheers.
Script auto follow xenobotIt might still have bugs (not 100% tested) so be careful if you plan to use it to bot 2 characters with it.
UI.Separator()
local followThis = tostring(storage.followLeader)
FloorChangers = {
Ladders = {
Up = {1948, 5542, 16693, 16692},
Down = {432, 412, 469, 1949, 469}
},
Holes = {
Up = {},
Down = {293, 294, 595, 4728, 385, 9853}
},
RopeSpots = {
Up = {386,},
Down = {}
},
Stairs = {
Up = {16690, 1958, 7548, 7544, 1952, 1950, 1947, 7542, 855, 856, 1978, 1977, 6911, 6915, 1954, 5259, 20492, 1956, 1957, 1955, 5257},
Down = {482, 414, 413, 437, 7731, 469, 413, 434, 469, 859, 438, 6127, 566, 7476, 4826}
},
Sewers = {
Up = {},
Down = {435}
},
}
local target = followThis
local lastKnownPosition
local function goLastKnown()
if getDistanceBetween(pos(), {x = lastKnownPosition.x, y = lastKnownPosition.y, z = lastKnownPosition.z}) > 1 then
local newTile = g_map.getTile({x = lastKnownPosition.x, y = lastKnownPosition.y, z = lastKnownPosition.z})
if newTile then
g_game.use(newTile:getTopUseThing())
delay(math.random(300, 700))
end
end
end
local function handleUse(pos)
goLastKnown()
local lastZ = posz()
if posz() lastZ then
local newTile = g_map.getTile({x = pos.x, y = pos.y, z = pos.z})
if newTile then
g_game.use(newTile:getTopUseThing())
delay(math.random(400, 800))
end
end
end
local function handleStep(pos)
goLastKnown()
local lastZ = posz()
if posz() lastZ then
autoWalk(pos)
delay(math.random(400, 800))
end
end
local function handleRope(pos)
goLastKnown()
local lastZ = posz()
if posz() lastZ then
local newTile = g_map.getTile({x = pos.x, y = pos.y, z = pos.z})
if newTile then
useWith(3003, newTile:getTopUseThing())
delay(math.random(400, 800))
end
end
end
local floorChangeSelector = {
Ladders = {Up = handleUse, Down = handleStep},
Holes = {Up = handleStep, Down = handleStep},
RopeSpots = {Up = handleRope, Down = handleRope},
Stairs = {Up = handleStep, Down = handleStep},
Sewers = {Up = handleUse, Down = handleUse},
}
local function checkTargetPos()
local c = getCreatureByName(target)
if c and c:getPosition().z posz() then
lastKnownPosition = c:getPosition()
end
end
local function distance(pos1, pos2)
local pos2 = pos2 or lastKnownPosition or pos()
return math.abs(pos1.x - pos2.x) + math.abs(pos1.y - pos2.y)
end
local function executeClosest(possibilities)
local closest
local closestDistance = 99999
for _, data in ipairs(possibilities) do
local dist = distance(data.pos)
if dist < closestDistance then
closest = data
closestDistance = dist
end
end
if closest then
closest.changer(closest.pos)
end
end
local function handleFloorChange()
local c = getCreatureByName(target)
local range = 2
local p = pos()
local possibleChangers = {}
for _, dir in ipairs({'Down', 'Up'}) do
for changer, data in pairs(FloorChangers) do
for x = -range, range do
for y = -range, range do
local tile = g_map.getTile({x = p.x + x, y = p.y + y, z = p.z})
if tile then
if table.find(data[dir], tile:getTopUseThing():getId()) then
table.insert(possibleChangers, {changer = floorChangeSelector[changer][dir], pos = {x = p.x + x, y = p.y + y, z = p.z}})
end
end
end
end
end
end
executeClosest(possibleChangers)
end
local function targetMissing()
for _, n in ipairs(getSpectators(false)) do
if n:getName() target then
return n:getPosition().z ~= posz()
end
end
return true
end
macro(500, 'Advanced Follow', ', function(macro)
local c = getCreatureByName(target)
if g_game.isFollowing() then
if g_game.getFollowingCreature() ~= c then
g_game.cancelFollow()
g_game.follow(c)
end
end
if c and not g_game.isFollowing() then
g_game.follow(c)
elseif c and g_game.isFollowing() and getDistanceBetween(pos(), c:getPosition()) > 1 then
g_game.cancelFollow()
g_game.follow(c)
end
checkTargetPos()
if targetMissing() and lastKnownPosition then
handleFloorChange()
end
end)
UI.Label('Follow Player:')
addTextEdit('playerToFollow', storage.followLeader or 'Trala', function(widget, text)
storage.followLeader = text
target = tostring(text)
end)
The following 1 user Likes MrTrala's post:1 user Likes MrTrala's post
Vithrax

Users browsing this forum: 3 Guest(s)Minecraft
Scripts
Thread / AuthorRepliesViewsRatingLast Post[asc]
045
  • 0 Vote(s) - 0 out of 5 in Average
Yesterday, 10:34 AM
Last Post: scripterr
Exchange medicine pouches on NPC channel
0261
  • 0 Vote(s) - 0 out of 5 in Average
06-21-2021, 11:15 AM
Last Post: Odyn
0557
  • 0 Vote(s) - 0 out of 5 in Average
06-14-2021, 06:30 PM
Last Post: Kasgosc
Sorcerer Scripts 860 #2
0439
  • 0 Vote(s) - 0 out of 5 in Average
06-14-2021, 06:25 PM
Last Post: Kasgosc
0481
  • 0 Vote(s) - 0 out of 5 in Average
06-14-2021, 06:22 PM
Last Post: Kasgosc
Party bot(auto inv)
0406
  • 0 Vote(s) - 0 out of 5 in Average
06-13-2021, 08:32 PM
Last Post: bratomo96
0320
  • 0 Vote(s) - 0 out of 5 in Average
06-04-2021, 02:18 PM
Last Post: juNex
Xenobot Follow Script
86,052
  • 0 Vote(s) - 0 out of 5 in Average
06-02-2021, 07:36 AM
Last Post: ava
116,373
  • 2 Vote(s) - 3 out of 5 in Average
06-01-2021, 05:29 AM
Last Post: ava
Witam
0414
  • 0 Vote(s) - 0 out of 5 in Average
05-19-2021, 06:07 PM
Last Post: Matiego1923
0412
  • 0 Vote(s) - 0 out of 5 in Average
05-18-2021, 02:20 PM
Last Post: Trampek
Withdrawing and Checksupplies
0327
  • 0 Vote(s) - 0 out of 5 in Average
05-12-2021, 05:12 AM
Last Post: suntrick
0311
  • 0 Vote(s) - 0 out of 5 in Average
05-07-2021, 02:24 PM
Last Post: JrMendes023
Script Ring for Paladins Please?
0459
  • 0 Vote(s) - 0 out of 5 in Average
05-06-2021, 03:58 AM
Last Post: Oclin
0487
  • 0 Vote(s) - 0 out of 5 in Average
05-04-2021, 12:00 PM
Last Post: Oclin
Anti-KS [Supplication :cry:]
0289
  • 0 Vote(s) - 0 out of 5 in Average
05-03-2021, 10:31 PM
Last Post: Edberg
0364
  • 0 Vote(s) - 0 out of 5 in Average
05-02-2021, 11:42 AM
Last Post: Oclin
Separate BP loot from gold
0319
  • 0 Vote(s) - 0 out of 5 in Average
05-01-2021, 09:28 PM
Last Post: JrMendes023
1809
  • 0 Vote(s) - 0 out of 5 in Average
04-17-2021, 10:30 AM
Last Post: jacob
Combobot release
55,392
  • 0 Vote(s) - 0 out of 5 in Average
04-13-2021, 09:01 PM
Last Post: Frosty

No New Posts
Contains Posts by You
Closed Thread

Auto Follow Free


Auto Follow Xenobot Minecraft