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.It 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
• Vithrax
Users browsing this forum: 3 Guest(s)
Scripts | ||||||
Thread / Author | Replies | Views | Rating | Last Post[asc] | ||
0 | 45 |
| Yesterday, 10:34 AM Last Post: scripterr | |||
Exchange medicine pouches on NPC channel | 0 | 261 |
| 06-21-2021, 11:15 AM Last Post: Odyn | ||
0 | 557 |
| 06-14-2021, 06:30 PM Last Post: Kasgosc | |||
Sorcerer Scripts 860 #2 | 0 | 439 |
| 06-14-2021, 06:25 PM Last Post: Kasgosc | ||
0 | 481 |
| 06-14-2021, 06:22 PM Last Post: Kasgosc | |||
Party bot(auto inv) | 0 | 406 |
| 06-13-2021, 08:32 PM Last Post: bratomo96 | ||
0 | 320 |
| 06-04-2021, 02:18 PM Last Post: juNex | |||
Xenobot Follow Script | 8 | 6,052 |
| 06-02-2021, 07:36 AM Last Post: ava | ||
11 | 6,373 |
| 06-01-2021, 05:29 AM Last Post: ava | |||
Witam | 0 | 414 |
| 05-19-2021, 06:07 PM Last Post: Matiego1923 | ||
0 | 412 |
| 05-18-2021, 02:20 PM Last Post: Trampek | |||
Withdrawing and Checksupplies | 0 | 327 |
| 05-12-2021, 05:12 AM Last Post: suntrick | ||
0 | 311 |
| 05-07-2021, 02:24 PM Last Post: JrMendes023 | |||
Script Ring for Paladins Please? | 0 | 459 |
| 05-06-2021, 03:58 AM Last Post: Oclin | ||
0 | 487 |
| 05-04-2021, 12:00 PM Last Post: Oclin | |||
Anti-KS [Supplication :cry:] | 0 | 289 |
| 05-03-2021, 10:31 PM Last Post: Edberg | ||
0 | 364 |
| 05-02-2021, 11:42 AM Last Post: Oclin | |||
Separate BP loot from gold | 0 | 319 |
| 05-01-2021, 09:28 PM Last Post: JrMendes023 | ||
1 | 809 |
| 04-17-2021, 10:30 AM Last Post: jacob | |||
Combobot release | 5 | 5,392 |
| 04-13-2021, 09:01 PM Last Post: Frosty |
- No New Posts
- Contains Posts by You
- Closed Thread