Ir para conteúdo
  • Cadastre-se

Posts Recomendados

@Tiodarsaa @vankk @Vodkart, desculpa por marcar mais gostaria que vocês desse uma olhada e me desse sua opinião sobre oque está faltando pro script funcionar corretamente.

 

Olá galerina do TK, estou aqui hoje para pedir uma ajuda em um script.

eis o problema, ele funciona perfeitamente, mais com apenas um problema

quando eu ligo a coleta de gold do autoloot ele funciona perfeitamente com um porém !!!

 

12:20 Você ligou a coleta de dinheiro.

12:23 O sistema já coletou 230000 gold coins

 

pode perceber que ele liga normal, coleta normal,

mais não faço a minima ideia como fazer o saque desse gold, se alguem puder analisar o script para me ajudar

pensei até mesmo que fosse para o NPC Banqueiro do servidor mais infelizmente não vai, 

é um sistema muito bom, so estou tendo problema para retirar o "GOLD" coletado !!!

reputarei quem puder me ajudar, ou pelo menos tentar

 

Spoiler

-- Sistema de auto loot criado por Vítor Bertolucci - Killua

function ExistItemByName(name) -- by vodka
	local items = io.open("data/items/items.xml", "r"):read("*all")
	local get = items:match('name="' .. name ..'"')
	if get == nil or get == "" then
		return false
	end
	return true
end

local function getPlayerList(cid)
	local tab = {}
	if getPlayerStorageValue(cid, 04420021) ~= -1 then
		table.insert(tab, getPlayerStorageValue(cid, 04420021))
	end
	if getPlayerStorageValue(cid, 04420031) ~= -1 then
		table.insert(tab, getPlayerStorageValue(cid, 04420031))
	end
	if getPlayerStorageValue(cid, 04420041) ~= -1 then
		table.insert(tab, getPlayerStorageValue(cid, 04420041))
	end
	if getPlayerStorageValue(cid, 04420051) ~= -1 then
		table.insert(tab, getPlayerStorageValue(cid, 04420051))
	end
	if #tab > 0 then
		return tab
	end
	return false
end

local function addToList(cid, name)
	local itemid = getItemIdByName(name)
	if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then
		return false
	end
	if getPlayerStorageValue(cid, 04420021) == -1 then
		return doPlayerSetStorageValue(cid, 04420021, itemid)
	elseif getPlayerStorageValue(cid, 04420031) == -1 then
		return doPlayerSetStorageValue(cid, 04420031, itemid)
	elseif getPlayerStorageValue(cid, 04420041) == -1 then	
		return doPlayerSetStorageValue(cid, 04420041, itemid)
	elseif getPlayerStorageValue(cid, 04420051) == -1 then
		return doPlayerSetStorageValue(cid, 04420051, itemid)
	end
end

local function removeFromList(cid, name)
	local itemid = getItemIdByName(name)
	if getPlayerStorageValue(cid, 04420021) == itemid then
		return doPlayerSetStorageValue(cid, 04420021, -1)
	elseif getPlayerStorageValue(cid, 04420031) == itemid then
		return doPlayerSetStorageValue(cid, 04420031, -1)
	elseif getPlayerStorageValue(cid, 04420041) == itemid then
		return doPlayerSetStorageValue(cid, 04420041, -1)
	elseif getPlayerStorageValue(cid, 04420051) == itemid then
		return doPlayerSetStorageValue(cid, 04420051, -1)
	end
	return false
end

function onSay(cid, words, param)
	if param == "" then
		local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420021)) or ""
		local se = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420031) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420031)) or ""
		local th = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420041) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420041)) or ""
		local fo = not vip.hasVip(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 04420051) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420051)) or ""
		local stt = getPlayerStorageValue(cid, 04421011) == 1 and "sim" or "não"
		local str = getPlayerStorageValue(cid, 04421001) == 1 and "sim" or "não"
		doPlayerPopupFYI(cid, "{Auto-Loot} ---Menu Auto Loot do jogador\n{Auto-Loot} ----------------\n{Auto-Loot} ---Coletar dinheiro: "..stt..". Para ligar/desligar: !autoloot gold \n{Auto-Loot} ---Coletar itens únicos: "..str..". Para ligar/desligar: !autoloot power\n{Auto-Loot} --Configuração dos slots:\n{Auto-Loot} ---Slot 1: "..fi.."\n{Auto-Loot} ---Slot 2: "..se.."\n{Auto-Loot} ---Slot 3: "..th.."\n{Auto-Loot} ---Slot 4: "..fo.."\n{Auto-Loot} ---Para adicionar um novo item aos slots: !autoloot add, <nome do item>\n{Auto-Loot} ---Para retirar um item dos slots: !autoloot remove, <nome do item>\n{Auto-Loot} ---Para limpar todos os slots utilize: !autoloot clear\n{Auto-Loot} ---Para informações de quanto você já fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n\nSe seu autoloot bugar use !autoloot desbug\n\n{Auto-Loot} ----------------")
		return true
	end
	
	local t = string.explode(param, ",")
	
	if t[1] == "power" then
		local check = getPlayerStorageValue(cid, 04421001) == -1 and "ligou" or "desligou"
		doPlayerSetStorageValue(cid, 04421001, getPlayerStorageValue(cid, 04421001) == -1 and 1 or -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." o auto loot.")
	elseif t[1] == "gold" then
		local check = getPlayerStorageValue(cid, 04421011) == -1 and "ligou" or "desligou"
		doPlayerSetStorageValue(cid, 04421011, getPlayerStorageValue(cid, 04421011) == -1 and 1 or -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." a coleta de dinheiro.")
		doPlayerSetStorageValue(cid, 04421021, 0)
	elseif t[1] == "goldinfo" then
		local str = getPlayerStorageValue(cid, 04421011) == -1 and "O sistema de coleta de dinheiro está desligado" or "O sistema já coletou "..getPlayerStorageZero(cid, 04421021).." gold coins"
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
	elseif t[1] == "add" then
		if ExistItemByName(t[2]) then
			local item = getItemIdByName(t[2])
			if isInArray({2160, 2148, 2152}, item) then
				return doPlayerSendCancel(cid, "Você não pode adicionar moedas no autoloot. Para coletar dinheiro use !autoloot gold")
			end
			if vip.hasVip(cid) then
				if getPlayerStorageValue(cid, 04420011) < 3 then
					if addToList(cid, t[2]) then
						doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot list")
					else
						doPlayerSendCancel(cid, t[2].." já está em sua lista!")
					end
				else
					doPlayerSendCancel(cid, "Sua lista já tem 4 itens! Você deve remover algum antes de adicionar outro.")
				end
			else
				if getPlayerStorageValue(cid, 04420011) == -1 then
					if addToList(cid, t[2]) then
						doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot")
					else
						doPlayerSendCancel(cid, t[2].." já está em sua lista!")
					end
				else
					doPlayerSendCancel(cid, "Você já tem um item adicionado no auto loot! Para adicionar outro, você deve remover o item atual.")
				end
			end
		else
			doPlayerSendCancel(cid, "Este item não existe!")
		end
	elseif t[1] == "remove" then
		if ExistItemByName(t[2]) then
			if removeFromList(cid, t[2]) then
				doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) - 1)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!")
			else
				doPlayerSendCancel(cid, "Este item não está na sua lista!")
			end
		else
			doPlayerSendCancel(cid, "Este item não existe!")
		end
	elseif t[1] == "clear" then
		if getPlayerStorageValue(cid, 04420011) > -1 then
			doPlayerSetStorageValue(cid, 04420011, -1)
			doPlayerSetStorageValue(cid, 04420021, -1)
			doPlayerSetStorageValue(cid, 04420031, -1)
			doPlayerSetStorageValue(cid, 04420041, -1)
			doPlayerSetStorageValue(cid, 04420051, -1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!")
		else
			doPlayerSendCancel(cid, "Sua lista ja esta limpa!")
		end
	elseif t[1] == "desbug" or t[1] == "desbugar" then
		doPlayerSetStorageValue(cid, 04420011, -1)
		doPlayerSetStorageValue(cid, 04420021, -1)
		doPlayerSetStorageValue(cid, 04420031, -1)
		doPlayerSetStorageValue(cid, 04420041, -1)
		doPlayerSetStorageValue(cid, 04420051, -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Desbugado!")
	elseif t[1] == "list" then
		local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420021)).."\n" or ""
		local se = getPlayerStorageValue(cid, 04420031) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420031)).."\n" or ""
		local th = getPlayerStorageValue(cid, 04420041) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420041)).."\n" or ""
		local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420051)).."\n" or ""
		doPlayerPopupFYI(cid, "O sistema auto loot está coletando:\n "..fi..""..se..""..th..""..fo)
	end
	return true
end
					

 

 

Editado por Micheel15 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Respostas 53
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

local function autoGold(cid, pos) local check = false local total = 0 local position = {} for i = 1, 255 do pos.stackpos = i if getThingFromPos(pos).uid and getThingFro

e o outro tópico que você fez, eu respondi e você abandonou porque? nem falou mais nada, nem pra falar se funcionou ou algo do tipo.

<?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes"> <config name="Loot_func"><![CDATA[

Posted Images

local function autoGold(cid, pos)
    local check = false
    local total = 0
    local position = {}
    for i = 1, 255 do
        pos.stackpos = i
        if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
            position = pos
            check = true
            break
        end
    end
    if check then
        local corpse = getContainerItemsInfo(getThingFromPos(position).uid)
        if corpse then
            for index, info in pairs(corpse) do
                if info.uid and info.itemid then
                    if index < countTable(corpse) then
                        if isContainer(info.uid) then
                            local bag = getContainerItemsInfo(info.uid)
                            for i = 1, countTable(bag) - 1 do
                                if isInArray({2148, 2152, 2160}, bag.itemid) then
                                    local multiplie = 1
                                    if bag.itemid == 2148 then
                                        multiplie = 1
                                    elseif bag.itemid == 2152 then
                                        multiplie = 100
                                    elseif bag.itemid == 2160 then
                                        multiplie = 10000
                                    end
                                    doRemoveItem(bag.uid, bag.quant)
                                    doPlayerSetBalance(cid, getPlayerBalance(cid) + (tonumber(bag.quant) and tonumber(bag.quant) * multiplie or 0))
                                    total = total + (tonumber(bag.quant) and tonumber(bag.quant) * multiplie or 0)
                                    doPlayerSetStorageValue(cid, 0442102, getPlayerStorageZero(cid, 0442102) + (tonumber(bag.quant) and tonumber(bag.quant) * multiplie or 0))
                                end
                            end
                        end
                    end
                    if isInArray({2148, 2152, 2160}, info.itemid) then
                        local multiplie = 1
                        if info.itemid == 2148 then
                            multiplie = 1
                        elseif info.itemid == 2152 then
                            multiplie = 100
                        elseif info.itemid == 2160 then
                            multiplie = 10000
                        end
    doRemoveItem(info.uid, info.quant)
                        doPlayerSetBalance(cid, getPlayerBalance(cid) + (tonumber(info.quant) and tonumber(info.quant) * tonumber(multiplie) or 0))
                        doPlayerSetStorageValue(cid, 0442102, getPlayerStorageZero(cid, 0442102) + (tonumber(info.quant) and tonumber(info.quant) * tonumber(multiplie) or 0))
                        total = total + (tonumber(info.quant) and tonumber(info.quant) * multiplie or 0)
                    end
                end
            end
        end
    end
    if tabela[getCreatureName(cid)] and tabela[getCreatureName(cid)].gold then
        tabela[getCreatureName(cid)].gold = total
    end
end

 

 

ta ai, era pra fzer isso, se não faz usa outro sistema

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 , esse sistema funciona como ?

e so pra gold ou pega items, pq tipo assim esse que to usando e ate legal,

pq como no meu servidor tem donate, ele limita os players que não são donates

a poder colocar apenas 1 loot normal na lista, 

já os donates podem colocar 5 loots na lista

 

ou esse dai, seria apenas pra coleta de gold ?

Editado por Micheel15 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

e o outro tópico que você fez, eu respondi e você abandonou porque? nem falou mais nada, nem pra falar se funcionou ou algo do tipo.

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

cara me desculpa, e que hoje ta um inferno usar internet, ta chovendo muito e de 20 em 20 minutos ta caindo a energia aqui

tanto que fui tomar banho e voltei agora, mais vou te dar os devidos créditos, pois está me ajudando deis de manha 

 

peço minhas sinceras desculpas

Link para o post
Compartilhar em outros sites

faz um script pra checar se o gold fica salvo nessa storage: 0442102

 

faz uma talk pra ver se retorna o gold nela

 

function onSay(cid, words, param)
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você tem "..getPlayerStorageValue(cid, 0442102).." gold.")
end

 

se retornar me avisa

 

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
35 minutos atrás, Micheel15 disse:

a talk não retornou

deu isso

21:49 Você tem -1 gold.

 

agora criando outro tipo, retornou

 

oq

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

testa assim

 

function onSay(cid, words, param)
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você tem "..getPlayerStorageValue(cid, 04421021).." gold.")
end

 

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

wtf? oq tu fez? kk

 

apaga td e coloca só isso

 

function onSay(cid, words, param)
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"you have "..getPlayerStorageValue(cid, 04421021).." gold.")
end

 

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

agora não deu erro nenhum, e quando fiz o teste no servidor apareceu igual a imagem abaixo :

vou ter que mudar agora algo, pra poder sacar os golds que forem coletados com o autoloot ?

 

loot.jpg

 

Editado por Micheel15 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

ok, mais tipo assim @Vodkart você não conseguiria apenas definir uma talk para retirar o dinheiro coletado?

pois o unico problema que essa script aprenseta é isso, 

se consegui-se seria melhor !!!

Link para o post
Compartilhar em outros sites
1 minuto atrás, Micheel15 disse:

ok, mais tipo assim @Vodkart você não conseguiria apenas definir uma talk para retirar o dinheiro coletado?

pois o unico problema que essa script aprenseta é isso, 

se consegui-se seria melhor !!!

 

sim mas onde fica salvo a quantidade de gold nesse sistema? já que não fica salvo no banco e nem em storage nehhuma!

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

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.


  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo