Ir para conteúdo

keilost1

Membro
  • Registro em

  • Última visita

Tudo que keilost1 postou

  1. Não funcionou, quais erros está apresentando?
  2. me envia o seu login, se não eu não vou poder te ajudar..
  3. Outras pessoas conseguem acessa-lo? Quando exatamente começou o erro? Alias, poderia encontrar o primeiro o erro alertado e enviar por print aqui? Envie seu código também.
  4. Envie o código aqui para eu dar uma olhada.
  5. Existe erro na distro? Você mudou algo além de ter resetado seu banco de dados?
  6. E aí galera do TK.... Estou passando meu OT para TFS 1.2 (OTXSERVER) e estou criando algumas funções para suprir a necessidade de alguns scripts.... Segue a função function getExperienceForLevel(level) level = level - 1 return ((50 * level * level * level) - (150 * level * level) + (400 * level)) / 3 end
  7. E aí galera do TK.... Estou passando meu OT para TFS 1.2 (OTXSERVER) e estou criando algumas funções para suprir a necessidade de alguns scripts, quando me deparei com o problema de listar as cidades no meu comando fly, não existia a função getTownList(), se existe alguma função que faça isso, me desculpe eu não encontrei, então segue o código: function townExists(townId) local t = Town(townId) return t ~= nil and true or false end function getTownList() local listtowns = {} setmetatable(listtowns, {__index=table}) local town while townExists(#listtowns+1) do town = Town(#listtowns+1) listtowns:insert({id=town:getId(), name=town:getName()}) end return listtowns end Para os novatos (não que eu não seja rs), você pode utilizar da seguinte forma: local str = "Cidades disponiveis para viajar: \n" for i, town in ipairs(getTownList()) do str = str .. town.name .. "\n" end player:showTextDialog(1950, str) Vai ser printado algo como isto: Por hoje é só pessoal, beijos!
  8. Esse foi um dos códigos mais feios que vi aqui no TibiaKing hoje, não está identado, todo desorganizado, além de estar sujo com caracteres do forum... A lógica que você usou é péssima, pois se o player não tiver online, e logar após ter executado esse script ele não vai estar com exp dobrada.... Hora que acaba o evento, hã? Não consegui entender o que acontece...
  9. Desculpa reviver o tópico, porém eu estava criando o evento de natal, e fui utilizar a função, e reparei que quando ela seta a primeira storage, vai tudo beleza, mas quando usa UPDATE na função, a logica e a sintaxe está incorreta: db.executeQuery("UPDATE `account_storage` SET `value` = " .. accid .. " WHERE `key`=" .. key .. " LIMIT 1');") Aonde o certo é: db.executeQuery("UPDATE `account_storage` SET `value` = " .. value .. " WHERE `key`=" .. key .. " AND `account_id` = " .. accid .. " LIMIT 1;") Repare que removi um ') do final e troquei o valor do campo value por value, antes estava accid e adicionei um AND onde filtra pela conta do player. Segue a função corrigida para os preguiçosos: function setAccountStorageValue(accid, key, value) local getvalue = db.getResult("SELECT `value` FROM `account_storage` WHERE `account_id` = " .. accid .. " and `key` = " .. key .. " LIMIT 1;") if(getvalue:getID() ~= -1) then db.executeQuery("UPDATE `account_storage` SET `value` = " .. value .. " WHERE `key`=" .. key .. " AND `account_id` = " .. accid .. " LIMIT 1;") getvalue:free() return 1 else db.executeQuery("INSERT INTO `account_storage` (`account_id`, `key`, `value`) VALUES (" .. accid .. ", " .. key .. ", '"..value.."');") return 1 end end
  10. keilost1 postou uma resposta no tópico em Tutoriais sobre Scripting
    doPlayerSendMailByName(name, item[, town[, actor]]) Tá faltando essa também
  11. keilost1 postou uma resposta no tópico em Formação de Equipe
    E aí pessoal do Tibia King, Eu sou dono do GoldenOT e estou a procura de alguém que realmente domine a linguagem PHP para ajudar em algumas questões, se eu achar que o serviço é bom mesmo estarei pagando o mesmo. Entrem em contato pelo skype: guirocio
  12. keilost1 postou uma resposta no tópico em Eventos de Scripting
    Se não fosse pela função doResetSKRoom() do script 3, eu teria votado nele, não achei muito legal o metódo. Voto no script 2 pela lógica.
  13. Hmm.. verdade, obrigado pela sugestão Wakon!
  14. E aí galera do TK, Hoje vim trazer um script idiota simples e que é util para os tutores do meu servidor, onde eles utilizam um comando e anuncia a seguinte mensagem: 00:13 O Tutor Keilost está no Help Channel respondendo duvidas. Ele tem uma limitação de 15 minutos para usar novamente, ah e fiz uma funçãozinha que ele identifica qual group é do player, caso um GM queria usar, CM, whatever... Vamos ao código: Em talkactions/talkactions.xml coloque a seguinte tag: <talkaction log="yes" words="/anunciar" access="2" event="script" script="staffbroad.lua"/> Agora em talkactions/scripts crie um arquivo lua chamado staffbroad e coloque o seguinte conteudo: function getNameGroup(group) local groups = {"Player", "Tutor", "Senior Tutor", "Gamemaster", "Community Manager", "Administrador"} return groups[group] end function onSay(cid, words, param, channel) local gbb = 82389239 if getPlayerStorageValue(cid, gbb) - os.time() > 0 then doPlayerSendTextMessage(cid, 27, "O comando só pode ser executado de 15 em 15 minutos.") return true end doBroadcastMessage("O "..getNameGroup(getPlayerGroupId(cid)).." "..getPlayerName(cid).." está no Help Channel respondendo duvidas.") setPlayerStorageValue(cid, gbb, os.time() + 15 * 60) return true end Bom é isso, qualquer duvida podem perguntar aqui Créditos Keilost(eu)
  15. Ceos, seja mais educado com os membros. rozinx, dizendo de uma forma menos rude, se você der uma olhada pelo fórum encontra..
  16. Então é porque não há mémoria o suficiente, qual o tamanho do mapa?
  17. keilost1 postou uma resposta no tópico em Suporte Tibia OTServer
    Respondendo a sua dúvida, qualquer um. Mas eu recomendaria estudar linux e também há ferramentas melhor que o Xampp para web.
  18. Elias, isso é alterado no OTCliente, esses lugares citados pelos membros não implica em nada naquela área. Eu não consigo te dizer especificamente onde é pois não me lembro e estou com um pouco de preguiça de procurar, mas se você explorar a pasta do OTCliente vai descobrir.
  19. Antes de tudo, nada é do nada rsrs... Qual é a sua distro?
  20. Droox, não vai funcionar, pois o TFS 1.0 não tem statschange (ou pelo menos não tinha), e as tags do creatureevent estão erradas. Alguém da equipe por favor poderia colocar os créditos VERDADEIROS nesse tópico? Ao mestre Demonbholder e ao servidor Global War por idealizar esse codigo, absolute não fez nada mais que decorar esse tópico com o nome dele.
  21. Olá, seu sistema operacional é 64 bits? Outra pergunta, quanto de mémoria RAM tem?
  22. Opa, esqueci de mudar uma função -- ### CONFIG ###-- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'Você recebeu: '.. add_item_name ..' do shopping online.') db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << Seu item esta esperando por você. Por favor libeere um local para este item em sua mochila e aguarde '.. SQL_interval ..' segundos para obte-lo.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << Seu item esta esperando por você. O peso do item é '.. full_weight ..' oz. Você tem no momento '.. free_cap ..' oz. de capacidade livre. Coloque alguns itens no depósito e espere cerca de '.. SQL_interval ..' segundos para obte-lo.') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end
  23. Caso não der, pode usar o meu -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'Você recebeu: '.. add_item_name ..' do shopping online.') db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << Seu item esta esperando por você. Por favor libeere um local para este item em sua mochila e aguarde '.. SQL_interval ..' segundos para obte-lo.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << Seu item esta esperando por você. O peso do item é '.. full_weight ..' oz. Você tem no momento '.. free_cap ..' oz. de capacidade livre. Coloque alguns itens no depósito e espere cerca de '.. SQL_interval ..' segundos para obte-lo.') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end

Informação Importante

Confirmação de Termo