• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action Bot cleanner

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
106
Location
Brazil
Hello I'm here to show my new script. The bot

cleanner v 2.0, you put them in any place of your map and

him walk and clean ground :p

This script was made by TFS 0.2++ (recomended

0.3.1)


To install them you need open the folder actions, in

actions.xml you add this tag

PHP:
<action actionid="1234" script="lixos.lua"/>
the actionid 1234 you can put in some item or change for an

itemid.
Now the lua file...​
Code:
--[[ script 100% by mock
 ver 2.0
 wanna an video?
 take a look
 

[url=http://www.youtube.com/watch?v=zOX4Eaxd9fQ]YouTub

e - tibia script - bot cleanner v2.0[/url]
  ]]--
local config = {
--- speed/chances
velocidade = 1000, -- speed
--- effects
Efeito_normal = 47, --- magic effect  (normal)
Efeito_block = 31,  --- magic effect (blocking in some wall
BombEfect = 1,
Allow_funnyTalks = TRUE,
funnyTalks = {"lol","Hello","o0"},
Allow_Bombs = TRUE, --- clean bombs (limpa em volta do 

bot)
----ssecurity
exclusoes ={6500,9999,2092}, -- Ignored itemids
allowFloorChange = TRUE,  -- floor change?
stairs_up_ids = {1386,1385,1389,3687}, -- Stairs id (to up)
stairs_down_ids = {459,4834,3219},  -- Stairs id (down)
sqms_de_distancia_do_centro = 5, -- spawn radius
}
----- Functions
function isWalkable2(pos)
 local wall0 = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, 

stackpos=0})
 local wall1 = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, 

stackpos=1})
 local wall2 = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, 

stackpos=2})
 local creature = getThingfromPos({x=pos.x, y=pos.y, 

z=pos.z, stackpos=255})
 if isCreature(creature.uid) == FALSE then
 if wall0.uid ~= 0 and hasProperty(wall0.uid, 3) == FALSE 

and hasProperty(wall0.uid, 7) == FALSE then
  if wall1.uid == 0 or (hasProperty(wall1.uid, 3) == FALSE 

and hasProperty(wall1.uid, 7) == FALSE) then
   if wall2.uid == 0 or (hasProperty(wall2.uid, 3) == FALSE 

and hasProperty(wall2.uid, 7) == FALSE) then
     return TRUE
    end
   end
  end
 end
 return FALSE
end
local function doCleanArea(pos, exclusaos,config)
      pos1 = {x=pos.x-1,y=pos.y-1,z=pos.z}
      pos2 = {x=pos.x+1,y=pos.y+1,z=pos.z}
      for x = 0, math.abs(pos1.x-pos2.x) do
          for y = 0, math.abs(pos1.y-pos2.y) do
              pos3 = {x = pos1.x+x, y = pos1.y+y, z = pos1.z, 

stackpos = 255}
              local coisa = getThingfromPos(pos3)
              pos3 = {x = pos1.x+x, y = pos1.y+y, z = pos1.z, 

stackpos = 0}
              local coisa2 = getThingfromPos(pos3)
              doSendMagicEffect(pos3,config.BombEfect)
              if coisa.itemid ~= 0 then
                 if isInArray(exclusaos, coisa.itemid) == FALSE and 

getTileHouseInfo(pos3) == 0 and coisa2.actionid ~= 500 and 

isWalkable2(pos3) == TRUE then
                    doRemoveItem(coisa.uid, -1)
                    doSendAnimatedText(pos3,"Deleted", 

math.random(1,255))
                 end
              end
          end
      end
end
--- Thanks jovial for tihs function :P
--- 

[url=http://forums.otserv.com.br/f154/funcao-inscreen-2-0-by-j

ovial-3363/]Funçao inScreen 2.0 by -Jovial- - OTServ 

Networks[/url] 
function isInArea(center, pos2,radius)
 if ((math.abs(center.x - pos2.x) <= radius) and 

(math.abs(center.y - pos2.y) <= radius)) then
  return TRUE
 else
  return FALSE
 end
end
-----Finallby my bot :P
local function andar(topos,cento,config)
      ----- talking...
      if math.random(1,12) > 8 and config.Allow_funnyTalks == 

TRUE then
         

doSendAnimatedText(topos,config.funnyTalks[math.random(

1,#config.funnyTalks)],math.random(1,255))
      end
      
      --- Some important thinks :P
      local maspos = {x = topos.x, y = topos.y ,z = 

topos.z,stackpos=255}
      local oldpos = topos
      local changed = FALSE
      local getdir = math.random(0,3)
      maspos = getPosByDir(maspos, getdir)
      Items = getThingfromPos(maspos)
      items2 = getThingfromPos({x = maspos.x, y = maspos.y 

,z = maspos.z,stackpos=1})
      Itempost = maspos
      Itempost.stackpos = 0
      gnr = getThingfromPos(Itempost)
      ----                                                                                               

                  --  or isInArea(cento, 

topos,config.sqms_de_distancia_do_centro,config)
 
      val = getThingfromPos(Itempost)
      if val.actionid == 500 or getTileHouseInfo(maspos) ~= 0 

or isWalkable2(maspos) == FALSE or isCreature(Items.uid) 

== TRUE or isInArea(cento, 

maspos,config.sqms_de_distancia_do_centro) == FALSE 

then
         if config.allowFloorChange == TRUE then
                 items2 = getThingfromPos({x = maspos.x, y = 

maspos.y ,z = maspos.z,stackpos=1})
                 items3 = getThingfromPos({x = maspos.x, y = 

maspos.y ,z = maspos.z,stackpos=0})
                 if isInArray(config.stairs_up_ids, items2.itemid) == 

TRUE then
                    doSendAnimatedText(maspos,"UP!", 

math.random(1,255))
                    maspos.z = maspos.z-1
                    local changed = TRUE
                 elseif isInArray(config.stairs_down_ids, 

items3.itemid) == TRUE then
                    doSendAnimatedText(maspos,"DOWN!", 

math.random(1,255))
                    maspos.z = maspos.z+1
                    local changed = TRUE
                 end        
         end
         if changed == FALSE then        
         doSendAnimatedText(maspos,"Block", 

math.random(1,255))
         end
         if getdir == 1 then
         getdir = 3
         elseif getdir == 3 then
         getdir = 1
         elseif getdir == 0 then
         getdir = 2
         elseif getdir == 2 then
         getdir = 0
         end
         topos = getPosByDir(maspos, getdir)
         doSendMagicEffect(maspos,config.Efeito_block)
      else
          if Items.itemid ~= 0 then
             if isInArray(config.exclusoes, Items.itemid) == FALSE 

then
                doSendMagicEffect(maspos,config.Efeito_normal)
                local cor = math.random(1,255)
                addEvent(doSendAnimatedText, 

200,maspos,"Deleted",cor)
                doRemoveItem(Items.uid, -1)
                topos = maspos
             else
                topos = maspos
                doSendAnimatedText(maspos,"Ignore", 

math.random(1,255)) 
             end
          else
              if config.allowFloorChange == TRUE then
                 items2 = getThingfromPos({x = maspos.x, y = 

maspos.y ,z = maspos.z,stackpos=1})
                 items3 = getThingfromPos({x = maspos.x, y = 

maspos.y ,z = maspos.z,stackpos=0})
                 if isInArray(config.stairs_up_ids, items2.itemid) == 

TRUE then
                    doSendAnimatedText(maspos,"UP!", 

math.random(1,255))
                    maspos.z = maspos.z-1
                    local changed = TRUE
                 elseif isInArray(config.stairs_down_ids, 

items3.itemid) == TRUE then
                    doSendAnimatedText(maspos,"DOWN!", 

math.random(1,255))
                    maspos.z = maspos.z+1
                    local changed = TRUE
                 end        
              end
              topos = maspos
          end
      end
      if math.random(1,2) == 1 and config.Allow_Bombs == 

TRUE then
         doCleanArea(topos, config.exclusoes,config)
      end
      doSendMagicEffect(maspos,config.Efeito_normal)
      addEvent(andar,  config.velocidade, topos,cento,config)
end
---- Ativaction :O
function onUse(cid, item, frompos, item2, topos)
         if getPlayerGroupId(cid) > 3 then
            local cento = topos
            addEvent(andar,  config.velocidade, 

topos,cento,config)
            return true
         else
             return false
         end
end
You can configure using the table config.
But... if you want an video look here
YouTub

e - tibia script - bot cleanner v2.0
 
ahha) it rox :D thanks for sharing..

omg, just saw your tetris system, it's amazing! Planning to release it too?
 
@fare-fary
nop the tetris system is for the Kingdom Age
:p
@all
this bot walk only where an normal player can walk and no enter in houses etc~
 
Wow this is awesome...
Keep it up.

Edit:
They should make "Walking" brooms do this. XD.
 
function getPosByDir(fromPosition, direction, size)
local n = size or 1

local pos = fromPosition
if(direction == NORTH) then
pos.y = pos.y - n
elseif(direction == SOUTH) then
pos.y = pos.y + n
elseif(direction == WEST) then
pos.x = pos.x - n
elseif(direction == EAST) then
pos.x = pos.x + n
elseif(direction == NORTHWEST) then
pos.y = pos.y - n
pos.x = pos.x - n
elseif(direction == NORTHEAST) then
pos.y = pos.y - n
pos.x = pos.x + n
elseif(direction == SOUTHWEST) then
pos.y = pos.y + n
pos.x = pos.x - n
elseif(direction == SOUTHEAST) then
pos.y = pos.y + n
pos.x = pos.x + n
end

return pos
end
^this is function :p
 
[26/02/2009 02:45:56] data/actions/scripts/lixos.lua:14: '}' expected (to close '{' at line 1) near 'exclusoes'
[26/02/2009 02:45:56] Reloaded actions.

help please :(
 
@Swimmi

exlcusoues = {1234,1235,6500}
dont forget {} and ,
 
@Swimmi

exlcusoues = {1234,1235,6500}
dont forget {} and ,


du de waht u mean help please :(


[05/03/2009 00:53:53] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lixos.lua
[05/03/2009 00:53:53] data/actions/scripts/lixos.lua:22: '}' expected (to close '{' at line 11) near ')'
[05/03/2009 00:53:53] Reloaded actions.

----ssecurity
exclusoes ={6500,9999,2092}, -- Ignored itemids
 
v7qcfq1.png


Muito bom

este script se puede configurar para que ataque ( lute )???

Obrigado!!!
 
I have problem here..

[05/03/2009 21:11:47] Warning: [Event::loadScript] Can not load script. data/actions/scripts/lixos.lua
[05/03/2009 21:11:47] data/actions/scripts/lixos.lua:22: '}' expected (to close '{' at line 11) near ')'
 

Similar threads

Back
Top