• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Automatic Temple Cleaner

darkmu

Well-Known Member
Joined
Aug 26, 2007
Messages
278
Solutions
1
Reaction score
50
Location
Paraná,Brazil
ATTENTION:
READ ALL THE TOPIC [click here for a ba dum tss]
NO PERMISSIONS FOR USING THIS SCRIPT.


This script is hard to explain, so please test it to see how it works

Explaining:
When you use the item, it creates a "pet". He is made by effects, and move randomly. If there's any item in his way, the item is removed, and if there's a barrier, it moves for anyway except to the barrier's (doesn't matter how many barriers there are)


- You need to stuck him in somewhere. He can only walk in flat ground! So, any unmovable item (excepting ground) is classified as a barrier.

Example from a good place: click
Barriers in red (walls are barriers too, obviously)

Script:
[data/actions/scripts/clean.lua]
Code:
-- script by Eitor Laba
-- bot cleaner v1.0
local c = {x=0,y=0,z=0}
function onUse(cid, item, frompos, item2, topos)

function newEffect()

local random = math.random(1,4)
local effects = {47}
local delay = 0.8
local msgs = {"Oops!","Bloqueado","Epa!"}

if random == 1 then
c.x = c.x + 1
elseif random == 2 then
c.x = c.x - 1
elseif random == 3 then
c.y = c.y + 1
elseif random == 4 then
c.y = c.y - 1
end

if math.random(1,8) == 5 then
local saudacoes = {"Tudo bom?","Limpando!","Olá!",":D","Passando!"}
doSendAnimatedText(c,saudacoes[math.random(0,#saudacoes)],160)
end

if getThingFromPos(c).itemid > 0 then
if isItemMovable(getThingFromPos(c).itemid) then
c.stackpos = 253
if not isCreature(getThingFromPos(c).uid) then
doSendAnimatedText(c,"Limpo!",TEXTCOLOR_YELLOW)
doCleanTile(c)
c.stackpos = 1
else
doSendAnimatedText(c,"Licença!",160)
c.stackpos = 1
end
else
if random == 1 then
c.x = c.x - 1
elseif random == 2 then
c.x = c.x + 1
elseif random == 3 then
c.y = c.y - 1
elseif random == 4 then
c.y = c.y + 1
end
doSendAnimatedText(c,msgs[math.random(0,#msgs)],TEXTCOLOR_YELLOW)
end
end

doSendMagicEffect(c,effects[math.random(1,#effects)])
addEvent(newEffect,delay * 1000)
end


c = getPlayerPosition(cid)
c.stackpos = 1
newEffect()
return TRUE
end
Please note the words are in portuguese (because I'm brazilian, so edit the portuguese words (e.g: ctrl + f: saudacoes)

Tag:
[data/actions/actions.xml]
Code:
<action uniqueid="xxx" script="clean.lua"/>

Thank you guys.
 

Attachments

Back
Top