TendoTensei 2 Postado Janeiro 29, 2012 Share Postado Janeiro 29, 2012 (editado) toda vez que executo o comando /woe da esse erros no meu console e no jogo da NOT VALID PARAM dofile("./_woe.lua") local config = woe_config function onSay(cid, words, param) if words == "/woe" and param == "/!/SETUP" then Woe.setup() return true end Woe.getInfo() local myTable = {} for _, i in ipairs({"%d", "%B", "%Y", "%X"}) do table.insert(myTable, os.date(i, infoLua[4])) end if Woe.isStarted() then text = "time left = " .. Woe.timeToEnd().mins .. ":" .. Woe.timeToEnd().secs .. "\nActually the castle " .. Castle.name .. " is owned by " .. Woe.guildName() .. ".\n" .. Woe.breakerName() .. " broke the empe at "..myTable[1].." / "..myTable[2].." / "..myTable[3].." at time "..myTable[4].."." else text = "the last woe was won by " .. Woe.guildName() .. ".\n" .. Woe.breakerName() .. " broke the empe at "..myTable[1].." / "..myTable[2].." / "..myTable[3].." at time "..myTable[4].."." end if words == "/woe" then if getPlayerAccess(cid) >= config.accessToStar then if param == "on" then if Woe.isTime() ~= true then doBroadcastMessage("War of Emperium will start in next 5 minutes...", config.bcType) doBroadcastMessage("will have a duration of " .. config.timeToEnd .. " Minutes.", config.bcType) setGlobalStorageValue(stor.WoeTime, 1) else doPlayerSendCancel(cid, "WoE is already running.") end elseif param == "off" then if Woe.isTime() == true then doBroadcastMessage("WoE was canceled...", config.bcType) setGlobalStorageValue(stor.WoeTime, 0) setGlobalStorageValue(stor.Started, 0) if isCreature(getThingFromPos(Castle.empePos).uid) == TRUE then doRemoveCreature(getThingFromPos(Castle.empePos).uid) end if getThingFromPos(Castle.desde).itemid > 0 then doRemoveItem(getThingFromPos(Castle.desde).uid) end Woe.removePre() Woe.removePortals() else doPlayerSendCancel(cid, "WoE is not running.") end elseif param == "empe" then doSummonCreature("empe", Castle.empePos) elseif param == "go" then local newPos = Castle.empePos newPos.y = newPos.y + 1 doTeleportThing(cid, newPos, FALSE) elseif param == "info" then doPlayerPopupFYI(cid, text) else doPlayerSendCancel(cid, "not valid param.") end elseif getPlayerAccess(cid) < config.accessToStar then if param == "info" then doPlayerPopupFYI(cid, text) end else doPlayerSendCancel(cid, "not possible.") end elseif words == "!recall" then if Woe.isStarted() == true then if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then if Woe.isInCastle(cid) == true then local members = Woe.getGuildMembers(getPlayerGuildId(cid)) if #members > 1 then if(exhaust(cid, stor.recall, config.recallTime) == 1) then for _, i in ipairs(members) do if getPlayerGuildLevel(i) ~= GUILDLEVEL_LEADER then local pos = getClosestFreeTile(cid, getCreaturePosition(cid), FALSE, TRUE) doTeleportThing(i, pos, FALSE) end end doCreatureSay(cid, "Emergency Recall", TALKTYPE_SAY) else doPlayerSendCancel(cid, "you can only use this every " .. config.recallTime / 60 .. " minutes.") end else doPlayerSendCancel(cid, "no members online.") end else doPlayerSendCancel(cid, "only can be used in the castle.") end else doPlayerSendCancel(cid, "you are not the leader.") end else doPlayerSendCancel(cid, "woe is not running.") end end return true end Editado Janeiro 29, 2012 por TendoTensei Link para o comentário Compartilhar em outros sites More sharing options...
TendoTensei 2 Postado Fevereiro 1, 2012 Autor Share Postado Fevereiro 1, 2012 @up Link para o comentário Compartilhar em outros sites More sharing options...
Fir3element 185 Postado Fevereiro 1, 2012 Share Postado Fevereiro 1, 2012 (editado) Posta o outro script, o erro não ta nesse ai... Acho que chama _woe.lua Editado Fevereiro 1, 2012 por fireelement Link para o comentário Compartilhar em outros sites More sharing options...
TendoTensei 2 Postado Fevereiro 2, 2012 Autor Share Postado Fevereiro 2, 2012 dofile("./var.woe") local config = woe_config fileStore = true infoFile = 'tmp.woe' infoLua = {} Woe = {} Woe.__index = Woe function Woe.setup() db.executeQuery("DROP TABLE IF EXISTS `woe`;") db.executeQuery("CREATE TABLE `woe` (`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,`started` INT( 11 ) NOT NULL ,`guild` INT( 11 ) NOT NULL ,`breaker` INT( 11 ) NOT NULL ,`time` INT( 11 ) NOT NULL ,PRIMARY KEY ( `id` ) ,UNIQUE (`id`)) ENGINE = MYISAM") doBroadcastMessage("DB Added [...]", config.bcType) if fileStore then local newFile = io.open(infoFile, "w") for _, i in ipairs({'started', 'guild', 'breaker', 'time'}) do newFile:write(i .. ' = 0 ;end;\n') end newFile:close() else db.executeQuery("DROP TABLE IF EXISTS `tmpwoe`;") db.executeQuery("CREATE TABLE `tmpwoe` (`started` INT( 11 ) NOT NULL ,`guild` INT( 11 ) NOT NULL ,`breaker` INT( 111 ) NOT NULL ,`time` INT( 1 ) NOT NULL) ENGINE = MYISAM ;") db.executeQuery("ALTER TABLE `tmpwoe` ADD `indexer` INT NOT NULL ") db.executeQuery("INSERT INTO `tmpwoe` (`started` ,`guild` ,`breaker` ,`time`, `indexer`)VALUES ('0', '0', '0', '0', '1');") end end function Woe.getInfo() if fileStore then local open = io.open(infoFile, "r") if open then for i in io.lines(infoFile) do for v, k in ipairs({'started', 'guild', 'breaker', 'time'}) do if (i:find(k)) then n = i:match(k .. '.*') infoLua[v] = tonumber(n:sub(n:find('=') + 2, n:find(';end;') - 2)) end end end open:close() end else for v, k in ipairs({'started', 'guild', 'breaker', 'time'}) do local tmp = db.getResult("SELECT " .. k .. " FROM `tmpwoe` WHERE `indexer` = '1';") infoLua[v] = tmp:getDataInt(k) tmp:free() end end end function Woe.updateInfo(tab) if fileStore then local open = io.open(infoFile, "w") if open then for k, i in ipairs({'started', 'guild', 'breaker', 'time'}) do open:write(i .. ' = ' .. tab[k] .. ' ;end;\n') end open:close() end else for v, k in ipairs({'started', 'guild', 'breaker', 'time'}) do db.executeQuery("UPDATE `tmpwoe` SET " .. k .. " = " .. tab[v] .. " WHERE `indexer` = 1;") end end end function Woe.save() Woe.getInfo() db.executeQuery("INSERT INTO `woe` (`started`, `guild`, `breaker`, `time`) VALUES (" .. infoLua[1] .. ", " .. infoLua[2] .. ", " .. infoLua[3] .. ", " .. infoLua[4] .. ");") end function Woe.getGuildName(id) local res = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. id .. ";") if (res:getID() ~= -1) then ret = res:getDataString('name') res:free() end return ret end function Woe.breakerName() Woe.getInfo() return infoLua[3] ~= 0 and getPlayerNameByGUID(infoLua[3]) or 'None' end function Woe.guildName() Woe.getInfo() return infoLua[2] ~= 0 and Woe.getGuildName(infoLua[2]) or 'Nones' end function Woe.startTime() Woe.getInfo() return os.date("%d %B %Y %X ", infoLua[1]) end function Woe.breakTime() Woe.getInfo() return os.date("%d %B %Y %X ", infoLua[4]) end function Woe.timeToEnd() Woe.getInfo() local myTable = {} for k, i in ipairs({"%M", "%S"}) do myTable[k] = os.date(i, os.difftime(os.time(), infoLua[1])) end return {mins = ((config.timeToEnd - 1) - myTable[1]), secs = (60 - myTable[2])} end function Woe.moveBack(cid, fromPosition, text) doTeleportThing(cid, fromPosition, TRUE) doPlayerSendCancel(cid, text) end function Woe.getGuildMembers(id) local members = {} for _, i in ipairs(getPlayersOnline()) do if id == getPlayerGuildId(i) then table.insert(members, i) end end return members end function Woe.deco(text) for _, i in ipairs(Castle.decoraciones) do doItemSetAttribute(i, "description", text) end end function Woe.removePortals() for _, i in ipairs(Castle.PrePortalsPos) do if (getThingFromPos(i).itemid > 0) then doRemoveItem(getThingFromPos(i).uid) end end end function Woe.removePre() for _, i in ipairs(Castle.PreEmpes) do if (isCreature(getThingFromPos(i).uid) == true) then doRemoveCreature(getThingFromPos(i).uid) end end end function Woe.checkPre() local Count = 0 for _, i in ipairs(Castle.PreEmpes) do if (isCreature(getThingFromPos(i).uid) == false) then Count = Count + 1 end end return (Count == #Castle.PreEmpes) end function Woe.isTime() return (getGlobalStorageValue(stor.WoeTime) == 1) end function Woe.isStarted() return (getGlobalStorageValue(stor.Started) == 1) end function Woe.isRegistered(cid) return (getPlayerStorageValue(cid, stor.register) == 1) end function Woe.isInCastle(cid) local myPos = getCreaturePosition(cid) if (myPos.x >= Castle.salas.a.fromx and myPos.x <= Castle.salas.a.tox) then if (myPos.y >= Castle.salas.a.fromy and myPos.y <= Castle.salas.a.toy) then if isInArray({Castle.salas.a.z, Castle.salas.b.z, Castle.salas.c.z}, myPos.z) then return true end end end return false end function Woe.expulsar(guild, fromx, tox, fromy, toy, z, outpos) for _x = fromx, tox do for _y = fromy, toy do local player = getThingFromPos({x = _x, y = _y, z = z, stackpos = 253}).uid if (isPlayer(player) == true) then if (getPlayerGuildId(player) ~= guild) then doTeleportThing(player, outpos, false) end end end end end -- extras function doSetItemActionId(uid, action) doItemSetAttribute(uid, "aid", action) end function exhaust(cid, storevalue, exhausttime) -- Exhaustion function by Alreth, v1.1 2006-06-24 01:31 -- Returns 1 if not exhausted and 0 if exhausted newExhaust = os.time() oldExhaust = getPlayerStorageValue(cid, storevalue) if (oldExhaust == nil or oldExhaust < 0) then oldExhaust = 0 end if (exhausttime == nil or exhausttime < 0) then exhausttime = 1 end diffTime = os.difftime(newExhaust, oldExhaust) if (diffTime >= exhausttime or diffTime < 0) then setPlayerStorageValue(cid, storevalue, newExhaust) return 1 else return 0 end end --Posição dos guardas que vão defender o Castelo. guard_pos = { {x = 18987, y = 19064, z = 7}, {x = 18987, y = 19065, z = 7} } function Woe.check() for storage = 24504, 24511 do local pid = getGlobalStorageValue(storage) if isCreature(pid) then return false end end return true end function Woe.summon() for k, i in ipairs(guard_pos) do local pid = doSummonCreature("guard", i) setGlobalStorageValue(24503 + k, pid) end end function Woe.remove() for storage = 24504, 24511 do local pid = getGlobalStorageValue(storage) if isCreature(pid) then doRemoveCreature(pid) end end end function pegavencedor() local aa local res = db.getResult("SELECT `guild` FROM `woe` ORDER BY `id` DESC;") if (res:getID() ~= -1) then aa = res:getDataString('guild') res:free() else res:free() return 0 end return aa end Link para o comentário Compartilhar em outros sites More sharing options...
guixap 60 Postado Fevereiro 2, 2012 Share Postado Fevereiro 2, 2012 Você usou a talk para instalar o Sistema na DB ? E outra si não me engano só funciona em servidor com a database MySql. Poste o script que fica na pasta data/talkactions/scripts/woe.lua Link para o comentário Compartilhar em outros sites More sharing options...
TendoTensei 2 Postado Fevereiro 2, 2012 Autor Share Postado Fevereiro 2, 2012 sim amigo usei a talk e meu servidor é mysql Link para o comentário Compartilhar em outros sites More sharing options...
bepokemon 101 Postado Fevereiro 3, 2012 Share Postado Fevereiro 3, 2012 (editado) Você tem os arquivos temporários: tmp.woevar.woe Dentro do diretório de seu servidor? Eles contém algo assim: tmp.woe started = 1321992055 ;end; guild = 8 ;end; breaker = 90 ;end; time = 1321992327 ;end; var.woe Castle, woe_config, stor = {}, {}, {} --castle name (?) Castle.name = 'Imperius' --aid of entry. Castle.tiles = 3131 --aid for created portals. Castle.portals = 3132 --aid of flags in castle. Castle.banderas = 3133 --aid of empes bases. Castle.bases = 3134 --uids in case you have decorations with info. Castle.decoraciones = {} --where you teleported from temple. Castle.pos = {x = 55, y = 80, z = 7} --where players are teleported when finished or castle owner change. Castle._exit = {x = 1017, y = 1034, z = 7} --where portal appears Castle.desde = {x = 1013, y = 1040, z = 6, stackpos = 1} --true / false default_map = true --if you will not use default map you should config all the pos. --main empe pos => with this pos all castle pos will be calculated (default map only) Castle.empePos = {x = 55, y = 34, z = 5, stackpos = 253} if default_map then local pos = Castle.empePos --entry for guild by using flags. Castle.guildEntry = {x = pos.x - 9, y = pos.y + 4, z = pos.z} --each floor should be all floor. Castle.salas = { a = {fromx = pos.x - 18, tox = pos.x + 18, fromy = pos.y - 10, toy = pos.y + 28, z = pos.z + 2}, b = {fromx = pos.x - 18, tox = pos.x + 18, fromy = pos.y - 10, toy = pos.y + 28, z = pos.z + 1}, c = {fromx = pos.x - 18, tox = pos.x + 18, fromy = pos.y - 10, toy = pos.y + 28, z = pos.z} } --pre empes pos Castle.PreEmpes = { {x = pos.x - 13, y = pos.y + 3, z = pos.z + 1, stackpos = 253}, {x = pos.x + 13, y = pos.y + 3, z = pos.z + 1, stackpos = 253} } --when you kill pre empes new portals appears. Castle.PrePortalsPos = { {x = pos.x - 4, y = pos.y - 6, z = pos.z + 1, stackpos = 1}, {x = pos.x + 4, y = pos.y - 6, z = pos.z + 1, stackpos = 1} } Castle.PreToPos = { [1] = {x = pos.x - 7, y = pos.y + 26, z = pos.z}, [2] = {x = pos.x + 7, y = pos.y + 26, z = pos.z} } else --edit those if not using default map --read above to know what is everything. --break this comment to use [...] --[[ Castle.guildEntry = {x = 46, y = 38, z = 5} Castle.salas = { a = {fromx=37, tox=73, fromy=24, toy=62, z=7}, b = {fromx=37, tox=73, fromy=24, toy=62, z=6}, c = {fromx=37, tox=73, fromy=24, toy=62, z=5} } Castle.PreEmpes = { {x=42, y=37, z=6, stackpos=253}, {x=68, y=37, z=6, stackpos=253} } Castle.PrePortalsPos = { {x=51, y=28, z=6, stackpos=1}, {x=59, y=28, z=6, stackpos=1} } Castle.PreToPos = { [1] = {x = 48, y = 60, z = 5}, [2] = {x = 62, y = 60, z = 5} } ]] end --duration woe_config.timeToEnd = 60 --bc type woe_config.bcType = MESSAGE_EVENT_ADVANCE --days woe_config.dias = {"monday","tuesday","wednesday","thursday","friday","saturday","sunday"} --time to start woe_config.horaPartida = 18 --access to start woe_config.accessToStar = 4 --recall delay woe_config.recallTime = 3 * 60 --rewards for winners woe_config.premios = true --storage for register players stor.register = 8589 --recall delay stor stor.recall = 23155 --global stor started stor.Started = 7801 --global stor [...] stor.WoeTime = 7802 Editado Fevereiro 3, 2012 por Byerne Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados