Postado Dezembro 27, 2015 9 anos eai, pedi varias vezes em varios fórums diferentes um script de follow pra xenobot, ngm se quer comentou um "fodase".. então procurei o script de outros bots pra colocar no xenobot que em tese tinha que funcionar ja que lua é lua tem que ser a mesma coisa, porém o script buga quando coloco no xenobot Spoiler ------------------------------------------------- ------------ SCRIPT BY INVALID NAME ------------- ------------------ 17/08/14vs ------------------- --- SE ACHAR QUAISQUER BUGS REPORTE NO TOPICO --- --------- TESTE O SCRIPT ANTES DE USA-LO -------- ------------------------------------------------- local Player = 'Rhesus' -- NOME DO PLAYER EXATO local SafeDistance = 1 -- DISTANCIA PARA MANTER DO PLAYER local SafeWait = 1.5 -- TEMPO EM SEGUNDOS PARA ESPERAR DEPOIS DE SE MOVER A UMA LOCALIZACAO ----------------------------------------------------------------------------- --- NÃO MEXA NADA ABAIXO DESTA LINHA SE VOCÊ NÃO SABE O QUE ESTÁ FAZENDO! --- ----------------------------------------------------------------------------- local stairsUp = ", 1947, 1950, 1952, 1954, 1956, 1958, 1960, 1962, 1964, 1966, 2192, 2194, 2196, 2198, 1969, 1971, 1973, 1975, 1977, 1978, 5257, 5258, 5259, 6909, 6911, 6913, 6915, 855, 856, 7542, 7544, 7546, 7548, 7881, 7887, 7888, 5033, 5035, 5037, 5039, 8657, 8830, 8831," local stairsDown = ", 293, 294, 369, 370, 385, 394, 411, 412, 413, 414, 428, 432, 433, 434, 437, 438, 469, 476, 594, 595, 601, 600, 604, 605, 607, 609, 610, 615, 1156, 482, 483, 484, 485, 566, 567, 1066, 482, 483, 484, 485, 566, 567, 1066, 1067, 1080, 4823, 859, 4825, 4826, 5081, 5544, 5691, 5731, 5763, 6127, 6128, 6129, 6130, 6172, 6173, 6754, 6755, 6756, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 7053, 166, 167, 867, 868, 874, 4824, 7181, 7182, 7476, 7477, 7478, 7479, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 369, 370, 411, 7767, 413, 414, 428, 432, 433, 7768, 967, 7550, 7229, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 7737, 7755, 7767, 7768, 7804, 8104, 8144, 8658, 8690, 8709, 8932," function getDistanceBetween(startX, startY, endX, endY) local distX = math.abs(endX - startX) local distY = math.abs(endY - startY) local dist = distX + distY return dist end function followUp(player) local follow = get_creature_index(player) local posZ = Self.posz() local next_pos = {Self.posx(), Self.posy(), 10} if follow == -1 then return true end for x = -7, 7, 1 do for y = -5, 5, 1 do if string.find(stairsUp, ', ' .. toptileitem(Self.posx()+x, Self.posy()+y) .. ',') then if get_walkability(x,y) then if getDistanceBetween(Self.posx(), Self.posy(), Self.posx()+x, Self.posy()+y) < next_pos[3] then next_pos = {Self.posx()+x, Self.posy()+y, getDistanceBetween(Self.posx(), Self.posy(), Self.posx()+x, Self.posy()+y)} end end end end end if next_pos[3] < 10 then click_left_on_coordinate(next_pos[1], next_pos[2]) for i=1, (SafeWait*10) do if Self.posz() ~= posZ then break else wait(100) end end return true end end function followDown(player) local follow = get_creature_index(player) local posZ = Self.posz() local next_pos = {Self.posx(), Self.posy(), 10} if follow == -1 then return true end for x = -7, 7, 1 do for y = -5, 5, 1 do if string.find(stairsDown, ', ' .. toptileitem(Self.posx()+x, Self.posy()+y) .. ',') then if getDistanceBetween(Self.posx(), Self.posy(), Self.posx()+x, Self.posy()+y) < next_pos[3] then next_pos = {Self.posx()+x, Self.posy()+y, getDistanceBetween(Self.posx(), Self.posy(), Self.posx()+x, Self.posy()+y)} end end end end if next_pos[3] < 10 then click_left_on_coordinate(next_pos[1], next_pos[2]) for i=1, (SafeWait*10) do if Self.posz() ~= posZ then break else wait(100) end end return true end end function followPlayer(player, dist) if isatacking() then return true end local follow = get_creature_index(player) local next_pos = {Self.posx(), Self.posy(), 10} if follow == -1 then return true end local position = {x = monster_on_screen_x(follow), y = monster_on_screen_y(follow), z = monster_on_screen_z(follow)} if position.z ~= Self.posz() then if position.z < Self.posz() then followUp(player) else followDown(player) end return true end for x = position.x - dist, position.x + dist do for y = position.y - dist, position.y + dist do if Self.posx() == x and Self.posy() == y then return true end if (math.abs(position.x-x) == dist or math.abs(position.y-y) == dist) and not (Self.posx() == position.x and Self.posy() == position.y) then if get_walkability(x,y) then if getDistanceBetween(Self.posx(), Self.posy(), x, y) < next_pos[3] then next_pos = {x, y, getDistanceBetween(Self.posx(), Self.posy(), x, y)} end end end end end if next_pos[3] < 10 and monster_on_screen_z(follow) == Self.posz() then click_left_on_coordinate(next_pos[1], next_pos[2]) for i=1, (SafeWait*10) do if Self.posx() == next_pos[1] and Self.posy() == next_pos[2] then break else wait(100) end end return true end end followPlayer(Player, SafeDistance) se alguém conseguir fazer esse script funcionar no xenobot tenho certeza q iria ajudar muita gente, não só a mim. obrigado.
Postado Dezembro 27, 2015 9 anos Esta é uma mensagem automática, este tópico foi movido para a área correta. Regras do fórum: http://www.tibiaking.com/forum/topic/1281-regras-gerais/#comment-7680Este tópico foi movido: De: Suporte OTServ > OTServ > Suporte de Scripts Para: Bots para Tibia > Suporte Bots Não é a mesma coisa bro, a biblioteca de funções é diferente, nunca iria funcionar. Vou checar com alguns amigos que usam XenoBot e vejo se alguém tem um follow maneiro, se eu achar eu edito aqui. Editado Dezembro 27, 2015 9 anos por Wakon (veja o histórico de edições)
Postado Dezembro 27, 2015 9 anos 6 horas atrás, VitinhoMapp disse: eai, pedi varias vezes em varios fórums diferentes um script de follow pra xenobot, ngm se quer comentou um "fodase".. então procurei o script de outros bots pra colocar no xenobot que em tese tinha que funcionar ja que lua é lua tem que ser a mesma coisa, porém o script buga quando coloco no xenobot Mostrar conteúdo oculto ------------------------------------------------- ------------ SCRIPT BY INVALID NAME ------------- ------------------ 17/08/14vs ------------------- --- SE ACHAR QUAISQUER BUGS REPORTE NO TOPICO --- --------- TESTE O SCRIPT ANTES DE USA-LO -------- ------------------------------------------------- local Player = 'Rhesus' -- NOME DO PLAYER EXATO local SafeDistance = 1 -- DISTANCIA PARA MANTER DO PLAYER local SafeWait = 1.5 -- TEMPO EM SEGUNDOS PARA ESPERAR DEPOIS DE SE MOVER A UMA LOCALIZACAO ----------------------------------------------------------------------------- --- NÃO MEXA NADA ABAIXO DESTA LINHA SE VOCÊ NÃO SABE O QUE ESTÁ FAZENDO! --- ----------------------------------------------------------------------------- local stairsUp = ", 1947, 1950, 1952, 1954, 1956, 1958, 1960, 1962, 1964, 1966, 2192, 2194, 2196, 2198, 1969, 1971, 1973, 1975, 1977, 1978, 5257, 5258, 5259, 6909, 6911, 6913, 6915, 855, 856, 7542, 7544, 7546, 7548, 7881, 7887, 7888, 5033, 5035, 5037, 5039, 8657, 8830, 8831," local stairsDown = ", 293, 294, 369, 370, 385, 394, 411, 412, 413, 414, 428, 432, 433, 434, 437, 438, 469, 476, 594, 595, 601, 600, 604, 605, 607, 609, 610, 615, 1156, 482, 483, 484, 485, 566, 567, 1066, 482, 483, 484, 485, 566, 567, 1066, 1067, 1080, 4823, 859, 4825, 4826, 5081, 5544, 5691, 5731, 5763, 6127, 6128, 6129, 6130, 6172, 6173, 6754, 6755, 6756, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 7053, 166, 167, 867, 868, 874, 4824, 7181, 7182, 7476, 7477, 7478, 7479, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 369, 370, 411, 7767, 413, 414, 428, 432, 433, 7768, 967, 7550, 7229, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 7737, 7755, 7767, 7768, 7804, 8104, 8144, 8658, 8690, 8709, 8932," function getDistanceBetween(startX, startY, endX, endY) local distX = math.abs(endX - startX) local distY = math.abs(endY - startY) local dist = distX + distY return dist end function followUp(player) local follow = get_creature_index(player) local posZ = Self.posz() local next_pos = {Self.posx(), Self.posy(), 10} if follow == -1 then return true end for x = -7, 7, 1 do for y = -5, 5, 1 do if string.find(stairsUp, ', ' .. toptileitem(Self.posx()+x, Self.posy()+y) .. ',') then if get_walkability(x,y) then if getDistanceBetween(Self.posx(), Self.posy(), Self.posx()+x, Self.posy()+y) < next_pos[3] then next_pos = {Self.posx()+x, Self.posy()+y, getDistanceBetween(Self.posx(), Self.posy(), Self.posx()+x, Self.posy()+y)} end end end end end if next_pos[3] < 10 then click_left_on_coordinate(next_pos[1], next_pos[2]) for i=1, (SafeWait*10) do if Self.posz() ~= posZ then break else wait(100) end end return true end end function followDown(player) local follow = get_creature_index(player) local posZ = Self.posz() local next_pos = {Self.posx(), Self.posy(), 10} if follow == -1 then return true end for x = -7, 7, 1 do for y = -5, 5, 1 do if string.find(stairsDown, ', ' .. toptileitem(Self.posx()+x, Self.posy()+y) .. ',') then if getDistanceBetween(Self.posx(), Self.posy(), Self.posx()+x, Self.posy()+y) < next_pos[3] then next_pos = {Self.posx()+x, Self.posy()+y, getDistanceBetween(Self.posx(), Self.posy(), Self.posx()+x, Self.posy()+y)} end end end end if next_pos[3] < 10 then click_left_on_coordinate(next_pos[1], next_pos[2]) for i=1, (SafeWait*10) do if Self.posz() ~= posZ then break else wait(100) end end return true end end function followPlayer(player, dist) if isatacking() then return true end local follow = get_creature_index(player) local next_pos = {Self.posx(), Self.posy(), 10} if follow == -1 then return true end local position = {x = monster_on_screen_x(follow), y = monster_on_screen_y(follow), z = monster_on_screen_z(follow)} if position.z ~= Self.posz() then if position.z < Self.posz() then followUp(player) else followDown(player) end return true end for x = position.x - dist, position.x + dist do for y = position.y - dist, position.y + dist do if Self.posx() == x and Self.posy() == y then return true end if (math.abs(position.x-x) == dist or math.abs(position.y-y) == dist) and not (Self.posx() == position.x and Self.posy() == position.y) then if get_walkability(x,y) then if getDistanceBetween(Self.posx(), Self.posy(), x, y) < next_pos[3] then next_pos = {x, y, getDistanceBetween(Self.posx(), Self.posy(), x, y)} end end end end end if next_pos[3] < 10 and monster_on_screen_z(follow) == Self.posz() then click_left_on_coordinate(next_pos[1], next_pos[2]) for i=1, (SafeWait*10) do if Self.posx() == next_pos[1] and Self.posy() == next_pos[2] then break else wait(100) end end return true end end followPlayer(Player, SafeDistance) se alguém conseguir fazer esse script funcionar no xenobot tenho certeza q iria ajudar muita gente, não só a mim. obrigado. n encontrei nenhum script funcional...
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.