Ir para conteúdo
  • Cadastre-se

(Resolvido)Erro Raids System


Ir para solução Resolvido por Vodkart,

Posts Recomendados

Eae, alguem pode me ajudar com isso ?

 

o script da erro ao summonar o boss, e não tá summonando.. e fica aparecendo a msg que o boss nasceu varias vezes

ex:

Spoiler

21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started
21:00 The invasion of Ghazbaran started

Uso Tfs 0.4  8.60

 

Mod usado

Spoiler

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Automatic Raids" version="1.0" author="Vodkart And xotservx" contact="xtibia.com" enabled="yes">  
<config name="raids_func"><![CDATA[
days = {
["Monday"] = {
["20:00"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60},
["21:30"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60}
},
["Tuesday"] = {
["19:30"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=410, z=11},toPosition = {x=476, y=408, z=11}}, m = {"1 Ghazbaran"}, Time = 60},
["20:30"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=256, z=14},toPosition = {x=1271, y=250, z=14}}, m = {"1 Morgaroth"}, Time = 60}
},
["Wednesday"] = {
["20:40"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60},
["21:40"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60}
},
["Thursday"] = {
["21:00"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=410, z=11},toPosition = {x=476, y=408, z=11}}, m = {"1 Ghazbaran"}, Time = 60},
["22:00"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=256, z=14},toPosition = {x=1271, y=250, z=14}}, m = {"1 Morgaroth"}, Time = 60}
},
["Friday"] = {
["19:40"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60},
["21:20"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60}
},
["Saturday"] = {
["18:00"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=410, z=11},toPosition = {x=476, y=408, z=11}}, m = {"1 Ghazbaran"}, Time = 60},
["16:00"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=256, z=14},toPosition = {x=1271, y=250, z=14}}, m = {"1 Morgaroth"}, Time = 60}
},
["Sunday"] = {
["15:00"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60},
["17:30"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60}
}
}
]]></config>    
<globalevent name="AutomaticRaids" interval="60" event="script"><![CDATA[
domodlib('raids_func')
function onThink(interval, lastExecution)  
if days[os.date("%A")] then
hours = tostring(os.date("%X")):sub(1, 5)      
tb = days[os.date("%A")][hours]
if tb then        
function removeCreature(tb)
for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do
for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do
local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid
if m ~= 0 and isMonster(m) then
doRemoveCreature(m)
end
end
end
end
doBroadcastMessage("The invasion of " .. tb.nome .. " started")
for _,x in pairs(tb.m) do
for s = 1, tonumber(x:match("%d+")) do
pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z}
doSummonCreature(x:match("%s(.+)"), pos)
end
end
addEvent(removeCreature, tb.Time*60*1000, tb)
end
end
return true
end
]]></globalevent>
</mod>

 

Erro que acontece

Spoiler

[21:0:59.774] [Error - GlobalEvent Interface]
[21:0:59.776] domodlib('raids_func')
[21:0:59.778] function onThink(interval, lastExecution)
[21:0:59.780] if days[os.date("%A")] then
[21:0:59.782] hours = tostring(os.date("%X")):sub(1, 5)
[21:0:59.785] tb = days[os.date("%A")][hours]
[21:0:59.787] if tb then
[21:0:59.788] function removeCreature(tb)
[21:0:59.791] for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do
[21:0:59.794] for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do
[21:0:59.796] local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid
[21:0:59.799] if m ~= 0 and isMonster(m) then
[21:0:59.800] doRemoveCreature(m)
[21:0:59.801] end
[21:0:59.802] end
[21:0:59.802] end
[21:0:59.803] end
[21:0:59.804] doBroadcastMessage("The invasion of " .. tb.nome .. " started")
[21:0:59.806] for _,x in pairs(tb.m) do
[21:0:59.809] for s = 1, tonumber(x:match("%d+")) do
[21:0:59.811] pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z}
[21:0:59.817] doSummonCreature(x:match("%s(.+)"), pos)
[21:0:59.819] end
[21:0:59.819] end
[21:0:59.820] addEvent(removeCreature, tb.Time*60*1000, tb)
[21:0:59.822] end
[21:0:59.822] end
[21:0:59.823] return true
[21:0:59.824] end
[21:0:59.824] :onThink
[21:0:59.825] Description:
[21:0:59.827] [string "LuaInterface::loadBuffer"]:20: bad argument #2 to 'random' (interval is empty)
[21:0:59.831] stack traceback:
[21:0:59.832]   [C]: in function 'random'
[21:0:59.833]   [string "LuaInterface::loadBuffer"]:20: in function <[string "LuaInterface::loadBuffer"]:2>
[21:0:59.837] [Error - GlobalEvents::think] Couldn't execute event: AutomaticRaids
> Broadcasted message: "The invasion of Ghazbaran started".

[21:0:59.893] [Error - GlobalEvent Interface]
[21:0:59.895] domodlib('raids_func')
[21:0:59.896] function onThink(interval, lastExecution)
[21:0:59.898] if days[os.date("%A")] then
[21:0:59.902] hours = tostring(os.date("%X")):sub(1, 5)
[21:0:59.905] tb = days[os.date("%A")][hours]
[21:0:59.907] if tb then
[21:0:59.908] function removeCreature(tb)
[21:0:59.912] for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do
[21:0:59.914] for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do
[21:0:59.916] local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid
[21:0:59.919] if m ~= 0 and isMonster(m) then
[21:0:59.921] doRemoveCreature(m)
[21:0:59.922] end
[21:0:59.922] end
[21:0:59.923] end
[21:0:59.923] end
[21:0:59.924] doBroadcastMessage("The invasion of " .. tb.nome .. " started")
[21:0:59.926] for _,x in pairs(tb.m) do
[21:0:59.930] for s = 1, tonumber(x:match("%d+")) do
[21:0:59.931] pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z}
[21:0:59.937] doSummonCreature(x:match("%s(.+)"), pos)
[21:0:59.938] end
[21:0:59.939] end
[21:0:59.939] addEvent(removeCreature, tb.Time*60*1000, tb)
[21:0:59.941] end
[21:0:59.942] end
[21:0:59.943] return true
[21:0:59.944] end
[21:0:59.946] :onThink
[21:0:59.947] Description:
[21:0:59.948] [string "LuaInterface::loadBuffer"]:20: bad argument #2 to 'random' (interval is empty)
[21:0:59.952] stack traceback:
[21:0:59.952]   [C]: in function 'random'
[21:0:59.954]   [string "LuaInterface::loadBuffer"]:20: in function <[string "LuaInterface::loadBuffer"]:2>
[21:0:59.957] [Error - GlobalEvents::think] Couldn't execute event: AutomaticRaids

 

Editado por subhe (veja o histórico de edições)

n35408.gif

Link para o post
Compartilhar em outros sites
  • Solução

@subhe as position tem que ser sempre do MENOR para o MAIOR

 

 

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Automatic Raids" version="1.0" author="Vodkart And xotservx" contact="xtibia.com" enabled="yes">  
<config name="raids_func"><![CDATA[
days = {
	["Monday"] = {
		["20:00"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60},
		["21:30"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60}
	},
	["Tuesday"] = {
		["19:30"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=408, z=11},toPosition = {x=476, y=410, z=11}}, m = {"1 Ghazbaran"}, Time = 60},
		["20:30"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=250, z=14},toPosition = {x=1271, y=256, z=14}}, m = {"1 Morgaroth"}, Time = 60}
	},
	["Wednesday"] = {
		["20:40"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60},
		["21:40"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60}
	},
	["Thursday"] = {
		["21:00"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=408, z=11},toPosition = {x=476, y=410, z=11}}, m = {"1 Ghazbaran"}, Time = 60},
		["22:00"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=250, z=14},toPosition = {x=1271, y=256, z=14}}, m = {"1 Morgaroth"}, Time = 60}
	},
	["Friday"] = {
		["19:40"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60},
		["21:20"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60}
	},
	["Saturday"] = {
		["18:00"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=408, z=11},toPosition = {x=476, y=410, z=11}}, m = {"1 Ghazbaran"}, Time = 60},
		["16:00"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=250, z=14},toPosition = {x=1271, y=256, z=14}}, m = {"1 Morgaroth"}, Time = 60}
	},
	["Sunday"] = {
		["15:00"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60},
		["17:30"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60}
	}
}
]]></config>    
<globalevent name="AutomaticRaids" interval="60" event="script"><![CDATA[
domodlib('raids_func')
function onThink(interval, lastExecution) 
	if days[os.date("%A")] then
		hours = tostring(os.date("%X")):sub(1, 5) 
		tb = days[os.date("%A")][hours]
		if tb then 
			function removeCreature(tb)
				for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do
					for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do
						local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid
						if m ~= 0 and isMonster(m) then
							doRemoveCreature(m)
						end
					end
				end
			end
			doBroadcastMessage("The invasion of " .. tb.nome .. " started")
			for _,x in pairs(tb.m) do
				for s = 1, tonumber(x:match("%d+")) do
					pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z}
					doSummonCreature(x:match("%s(.+)"), pos)
				end
			end
			addEvent(removeCreature, tb.Time*60*1000, tb)
		end
	end
	return true
end
]]></globalevent>
</mod>

 

OBS: USA ESSA NOVA VERSÃO SEM BUGS

 

https://tibiaking.com/forums/topic/94479-raid-automatica-mod-raid-automatica-edit-brunds/

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

@Vodkart Obrigado mano, o erro era as position mesmo vlw mesmo, REP+ <3 

agora tá 99%, quando ele remove o boss, remove os bixos que estão a volta tbm kkkkkk mas isso é de boa, que coisa de 2 minutos ou menos ja nascem de novo kkk

 

Obs: essa outra versão da vários erros na minha distro, vou optar por essa antiga mesmo, mas vlw pela ajuda <3 

n35408.gif

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo