KE
pedido

Ajuda Com Esses Bugs No Distro

Por KennyConrad, 23 de ago. de 2012 em Scripts

14
1.2k
KennyConradK
23 de agosto de 2012 às 16:02

Galera Fiz Um Update no meu servidor 9.53 para 9.60 tudo certo até então eu ver que praticamente todos os comandos de Membros Da Equipe quero dizer comandos /a,/c,/goto,/m,/s,/n,/up,/down, e a escada de id 1386 bugou não da para subir vejam as SS dos erros que aparecem no distro

 

JmAL9.png

 

 

wl0RB.png

 

a lib 011-string:

 

 

string.split = function (str)

local t = {}

return not str:gsub("%w+", function(s) table.insert(t, s) return "" end):find("%S") and t or {}

end

 

string.trim = function (str)

return str:gsub("^%s*(.-)%s*$", "%1")

end

 

string.explode = function (str, sep, limit)

if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then

return {}

end

 

local i, pos, tmp, t = 0, 1, "", {}

for s, e in function() return string.find(str, sep, pos) end do

tmp = str:sub(pos, s - 1):trim()

table.insert(t, tmp)

pos = e + 1

 

i = i + 1

if(limit ~= nil and i == limit) then

break

end

end

 

tmp = str:sub(pos):trim()

table.insert(t, tmp)

return t

end

 

string.expand = function (str)

return string.gsub(str, "$(%w+)", function(n) return _G[n] end)

end

 

string.diff = function (diff)

local format = {

{"week", diff / 60 / 60 / 24 / 7},

{"day", diff / 60 / 60 / 24 % 7},

{"hour", diff / 60 / 60 % 24},

{"minute", diff / 60 % 60},

{"second", diff % 60}

}

 

local t = {}

for k, v in ipairs(format) do

local d, tmp = math.floor(v[2]), ""

if(d > 0) then

tmp = (k < table.maxn(format) and (table.maxn(t) > 0 and ", " or "") or " and ") .. d .. " " .. v[1] .. (d ~= 1 and "s" or "")

table.insert(t, tmp)

end

end

 

return t

end

string.timediff = string.diff

 

string.boolean = function (input)

local tmp = type(input)

if(tmp == 'boolean') then

return input

end

 

if(tmp == 'number') then

return input > 0

end

 

local str = string.lower(tostring(input))

return (str == "yes" or str == "true" or (tonumber(str) ~= nil and tonumber(str) > 0))

end

getBooleanFromString = string.boolean

 

 

Ajuda Ae Galera

caoticC
23 de agosto de 2012 às 16:11

o erro estas na string.explode e no Array

 

Voce atualizo a sua lib?

KennyConradK
23 de agosto de 2012 às 16:26

eu baixei esse mapa 9.60 e acho que o cara que posto ele pra download não atualizo a lib ;(

brun123B
23 de agosto de 2012 às 16:39

Adiciona isso em algum lib sua:

 

function isInArray(array, element)
   for a, b in pairs (array) do
    if element == array then return true end
   end
return false
end

KennyConradK
23 de agosto de 2012 às 16:42

adiciona pra min nessa lib ai que postei porque não so muito bom em scripts

brun123B
23 de agosto de 2012 às 16:50

ta mal em

 

 

string.split = function (str)
local t = {}
return not str:gsub("%w+", function(s) table.insert(t, s) return "" end):find("%S") and t or {}
end

string.trim = function (str)
return str:gsub("^%s*(.-)%s*$", "%1")
end

string.explode = function (str, sep, limit)
if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then
return {}
end

local i, pos, tmp, t = 0, 1, "", {}
for s, e in function() return string.find(str, sep, pos) end do
tmp = str:sub(pos, s - 1):trim()
table.insert(t, tmp)
pos = e + 1

i = i + 1
if(limit ~= nil and i == limit) then
break
end
end

tmp = str:sub(pos):trim()
table.insert(t, tmp)
return t
end

string.expand = function (str)
return string.gsub(str, "$(%w+)", function(n) return _G[n] end)
end

string.diff = function (diff)
local format = {
{"week", diff / 60 / 60 / 24 / 7},
{"day", diff / 60 / 60 / 24 % 7},
{"hour", diff / 60 / 60 % 24},
{"minute", diff / 60 % 60},
{"second", diff % 60}
}

local t = {}
for k, v in ipairs(format) do
local d, tmp = math.floor(v[2]), ""
if(d > 0) then
tmp = (k < table.maxn(format) and (table.maxn(t) > 0 and ", " or "") or " and ") .. d .. " " .. v[1] .. (d ~= 1 and "s" or "")
table.insert(t, tmp)
end
end

return t
end
string.timediff = string.diff

string.boolean = function (input)
local tmp = type(input)
if(tmp == 'boolean') then
return input
end

if(tmp == 'number') then
return input > 0
end

local str = string.lower(tostring(input))
return (str == "yes" or str == "true" or (tonumber(str) ~= nil and tonumber(str) > 0))
end
getBooleanFromString = string.boolean

function isInArray(array, element)
   for a, b in pairs (array) do
	    if element == array then return true end
   end
return false
end

 

 

Era só ir na última linha, dar enter 2x e colar o código...

Podia até criar um novo script.lua e colar o código dentro que ia dar certo também, desde que estivesse na pasta

KennyConradK
23 de agosto de 2012 às 17:30

funciono vlw rep + agora tem falto 2 erros

 

O5E3w.png

 

e a escada de id 1386 não da para subir mais.

 

ajuda ae

 

apareceu esse erro no distro aki tbm

 

 

[17:22:22.755] [Error - Action Interface]

[17:22:22.755] data/actions/scripts/other/teleport.lua:onUse

[17:22:22.755] Description:

[17:22:22.755] <Luadotilequeryadd> tile not found

 

 

local UP_FLOORS = {1386, 3678, 5543, 8599, 10035, 13010}

local FIELDS = {1497, 1499, 11095, 11096}

local DRAW_WELL = 1369

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if(item.itemid == DRAW_WELL and item.actionid ~= 100) then

return false

end

 

local check = false

fromPosition.stackpos = STACKPOS_GROUND

if(isInArray(UP_FLOORS, item.itemid)) then

fromPosition.z = fromPosition.z - 1

fromPosition.y = fromPosition.y + 1

if(doTileQueryAdd(cid, fromPosition, 38) ~= RETURNVALUE_NOERROR) then

local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)

if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then

fromPosition.y = fromPosition.y - 2

else

check = true

end

end

else

fromPosition.z = fromPosition.z + 1

end

 

if(not check and doTileQueryAdd(cid, fromPosition, 38) ~= RETURNVALUE_NOERROR) then

local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)

if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then

return false

end

end

 

local pos, dir = getCreaturePosition(cid), SOUTH

if(pos.x < fromPosition.x) then

dir = EAST

elseif(pos.x == fromPosition.x) then

if(pos.y == fromPosition.y) then

dir = getCreatureLookDirection(cid)

elseif(pos.y > fromPosition.y) then

dir = NORTH

end

elseif(pos.x > fromPosition.x) then

dir = WEST

end

 

doTeleportThing(cid, fromPosition, false)

doCreatureSetLookDirection(cid, dir)

return true

end

 

brun123B
23 de agosto de 2012 às 17:50

O problema da vocation é provavelmente algum valor negativo atribuido à vocation do jogador, sendo que o data type da vocation em c++ é unsigned, ou seja, não pode ser negativo. Verifique se não tem ninguém na database com vocation negativa, e cheque o vocations.xml também.

 

O problema do talkaction "/a", erro do doTileQueryAdd é porque você tentou teleportar para um lugar que não tem piso. É só tomar cuidado com o comando, não precisa ficar se preocupando com isso não.

 

Sobre a escada não subir, o player pisa nela e não acontece nada ou o player não consegue pisar nela?

Veja se tem chão embaixo da escada no map editor, e verifique se ela está com os atributos certos no items.xml.

KennyConradK
23 de agosto de 2012 às 18:38

não é esse tipo de escada é a escada de madeira que voce clica para subir.

 

CszJW.png

 

essa aki

 

bugo todas elas sendo que uso muito essa escada pelo meu mapa e na versão 9.53 não ocorria o bug a escada funcionava perfeitamente

brun123B
23 de agosto de 2012 às 19:20

é só arrumar o actions, tenho que sair agora, mas é só pegar alguma script de uma outra versão que funcione e colocar direitinho no actions.xml

KennyConradK
24 de agosto de 2012 às 12:38

mano mais eu to com os 2 ots um na versão 9.53 e outro na 9.60 aki. na versão 9.53 com o mesmo script de actions a escada não buga agora na versão 9.60 buga ;(

 

brun123 ajuda ae mano

Editado Agosto 23 por KennyxD

brun123B
24 de agosto de 2012 às 12:48

Você mudou o actions.xml?

KennyConradK
24 de agosto de 2012 às 13:17

eu peguei a actions do 9.53 que funciona e puz no 9.60 ai o bug so acontece na 9.60 na 9.53 não da o bug e mesmo com o actions que veio no 9.60 a escada fika bugada ;(

2 semanas depois...
rhamerR
31 de agosto de 2012 às 17:41

aqui a escada e o bueiro esta bugado tbm algurm ajuda nos por favor