Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

XenoBot HUD


ninjaf1000

Rekomendowane odpowiedzi

Opublikowano

Wywala mi skrypt przez ten error: 

XenoScript Error:
           Script: HUD.lua
           Line #: 179
           Chunk: C:?DOCUME?1?Patryk?MOJEDO?1?XenoBot?Scripts??HUD.lua
           Error: attempt to call local 'itemid' (a string value)
 
 
 
Skrypt+link jeśli komuś będzie łatwiej:        http://pastebin.com/tpTvW9j0

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
dofile("library ropiderz.lua")

----- Setup labels at the end of the script -----
------------ SETUP ------------
local loots = {"Cheese Cutter","Bola","Earflap","Cheesy Figurine","Rat God Doll","Ratana","Spiky Club","Leather Harness"}
local supplies = {{"Mana Potion", 250}, {"Great Health Potion", 50}} -------- Set max amount of supplies always will refill

--Warning: Run the script after your bps are opened and dont forget to set the labels at the end of the script
------------------ Do not modify below ----------------------------
local Stamina = HUD.New(62, 30, "", 240, 230, 140)
local ExpG = HUD.New(78, 45, "", 240, 230, 140)
local timecount = HUD.New(108, 60, "", 240, 230, 140)

local TotalGold = HUD.New(42, 90, "", 240, 230, 140)
local TotalLoot = HUD.New(44, 105, "", 240, 230, 140)
local TotalSupplies = HUD.New(50, 120, "", 240, 230, 140)
local TotalProfit = HUD.New(50, 135, "", 240, 230, 140)

local suppliesStored = {}
local lootStored = {}
local currentGold = 0
local goldStored = 0
local CostText = {}
local CostTextSupplies = {}
local x = 0
local y = 0
local z = 0
local stime = os.time()
local Cexp = Self.Experience()
local backpacks = Container.GetAll()

HUD.New(10, 30, "Stamina:", 205, 170, 125)
HUD.New(10, 45, "Exp Gained:", 205, 170, 125)
HUD.New(10, 60, "Adventure Time:", 205, 170, 125)

HUD.New(10, 90, "Gold:", 205, 170, 125)
HUD.New(10, 105, "Loot:", 205, 170, 125)
HUD.New(10, 120, "Waste:", 205, 170, 125)
HUD.New(10, 135, "Profit:", 205, 170, 125)


function comma_value(amount)
local formatted = amount
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if (k==0) then
break
end
end
return formatted
end

function countLootValues()
local x = currentGold+goldStored+x
for i=1, #lootStored do
local item = lootStored.name
local count = lootStored.count+lootStored.count0
local preco = count*itemvalue(item)
x = x + preco
end
return x
end

function Justlootvalues()
local x = x
for i=1, #lootStored do
local item = lootStored.name
local count = lootStored.count+lootStored.count0
local preco = count*itemvalue(item)
x = x + preco
end
return x
end

function countgp()
local y = currentGold+goldStored
return y
end

function countSuppliesValues()
local x = countLootValues() + x
for i=1, #suppliesStored do
local items = suppliesStored.name
local counts = suppliesStored.count+suppliesStored.count0
local precio = counts*itemprice(items)
x = x - precio
end
return x
end

function countSuppliesValuesfortotalsupplies()
local z = z
for i=1, #suppliesStored do
local items = suppliesStored.name
local counts = suppliesStored.count+suppliesStored.count0
local precio = counts*itemprice(items)
z = z + precio
end
return z
end

function contains(item)
for i=1, #lootStored do
if lootStored.name==item then return i end
end
return -1
end

function suppliescontains(item)
for i=1, #suppliesStored do
if suppliesStored.name==item then return i end
end
return -1
end

function storeItemCount(i)
lootStored.count0 = lootStored.count0+lootStored.count
end

function storeSuppliesCount(i)
suppliesStored.count0 = suppliesStored.count0+suppliesStored.count
end

function storeGold()
goldStored = goldStored + currentGold
end

function Timecount()
elapsetime = os.difftime(os.time(), stime)
timecount:SetText(string.format("%02.f", math.floor(elapsetime/3600)) .. ":" .. os.date("%M", elapsetime))
end

function printgp()
local gptotal = countgp()
gold = gptotal
TotalGold:SetText(comma_value(gold))
end

function printTotalProfit()
local lootValues = countSuppliesValues()
ajua = lootValues
TotalProfit:SetText(" "..comma_value(ajua).." gp" .. " ["..(string.format("%.2f", (math.floor(ajua / (os.time() - stime) * 60 * 60))/1000) .."k/hour]"))
end

function Totalloot()
local juasloot = Justlootvalues()
TotalLoot:SetText(comma_value(juasloot) .. " gp")
end

function Totalsupplies()
local juassupplies = countSuppliesValuesfortotalsupplies()
TotalSupplies:SetText(comma_value(juassupplies) .. " gp")
end

function StaminaExpG()
local currentstamina = Self.Stamina()
Stamina:SetText(os.date("%M:%S", currentstamina))
ExpG:SetText(comma_value(Self.Experience() - Cexp))
end

function Itemscount(id)
local count = 0
for _, backpack in pairs(backpacks) do
local amount = Container.New(backpack)
count = count + amount:CountItemsOfID(id)
end
return count
end

function HudProfit()
local mainContainer = Container.GetFirst()
local itemContainer = Container.New(1)
local goldContainer = Container.New(2)

if mainContainer:isOpen() then
for i=1, #supplies do
local item = supplies[1]
local count = supplies[2]-Itemscount(itemid(item))
local itemIndex = suppliescontains(item)
if itemIndex==-1 then
table.insert(suppliesStored, {['name']=item, ['count']=count, ['count0']=0})
else
if suppliesStored[itemIndex].count>0 and count==0 then storeSuppliesCount(itemIndex) end
suppliesStored[itemIndex].count = count
end
end
end

if goldContainer:isOpen() then
local aux = Itemscount(itemid("gold coin"))
if currentGold > aux then
storeGold()
end
currentGold = Itemscount(itemid("gold coin"))
end

if itemContainer:isOpen() then
for i=1, #loots do
local item = loots
local count = Itemscount(itemid(item))
local itemIndex = contains(item)
if itemIndex==-1 then
table.insert(lootStored, {['name']=item, ['count']=count, ['count0']=0})
else
if lootStored[itemIndex].count>0 and count==0 then storeItemCount(itemIndex) end
lootStored[itemIndex].count = count
end
end
end
Timecount()
printgp()
Totalloot()
Totalsupplies()
printTotalProfit()
StaminaExpG()
wait(100)
end

local HudModule = Module.New('HudCount', HudProfit)

function onWalkerSelectLabel(labelName)
if (labelName == "Deposit Items") then --------- Set the label you use for deposit items // It will stop the HUD
HudModule:Stop()

elseif (labelName == "Going to cave") then ---------Set the label used when will start to hunt /// It will start the HUD
HudModule:Start()
end
end

--- Example of how to use the script ---

--Example of labels of regular settings
--Hunt
--Check refill
--Goint to city
--Deposit gold HUD(module) must be stopped when deposit items until will hunt again. (Set the labels in lines 246 and 250 according your script.)
--Deposit Items According to the labels already set in this script for match my example. Hud will be stoppped at "Deposit Items" label then, hud will start at "Going to cave" label
--Refill
--Reset Bps
--Going to cave

Z góry dziękuje ;)

B

Opublikowano

Sluchaj pobiez sobie Notepad++ jakos tak to bylo nei pamietam :D tam bedziesz mial taki ulepszony notatnik w ktorym np numery linijek beda i znajdziesz akurat ta 179 linijke i jak troche sie znasz to ogarniesz co tam jest nei tak .

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...