PDA

View Full Version : Outdated?



Robin2161
01-09-2013, 05:19 PM
Hello,

I'm currently using a script that I guess is outdated. Doesn't work that well with depositing items and selling items.. Someone mind giving me a hand and update it?


--Settings---------------------------------------
MPotID = 268 --- mana potion ID
MinMPots = 20 ---- if less then script will exit spawn
MPots = 200 ----- amount to refill
MPotprice = 50 ---- price of 1 single mana pot
HPotID = 239 ---- health potion ID
HPotprice = 190 ---- health potion price
HPots = 10 ---- health potions you want to buy
MinHPots = 5 ---- min of health potions to leave
MinCap = 50 ---- if less then script will exit spawn
-------------------------------------------------
--END OF SETTINGS--------------------------------



--- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function NpcConv(...)
for _, str in ipairs(arg) do
wait((tostring(str):len() / 125) * 60000 * math.random(1.1, 1.8))
Self.SayToNpc(str)
end
end
function onWalkerSelectLabel(labelName)
if (labelName == "sell") then
delayWalker(20000)
Self.SayToNpc({"hi", "trade"}, 65)
Self.ShopSellItem(17810, Self.ItemCount(17810))
wait(900, 1200)
Self.ShopSellItem(17859, Self.ItemCount(17859))
wait(900, 1200)
Self.ShopSellItem(17819, Self.ItemCount(17819))
wait(900, 1200)
Self.ShopSellItem(17818, Self.ItemCount(17818))
wait(900, 1200)
Self.ShopSellItem(17813, Self.ItemCount(17813))
wait(900, 1200)
Self.ShopSellItem(17812, Self.ItemCount(17812))
wait(900, 1200)
setWalkerEnabled(true)

elseif (labelName == "checker") then
delayWalker(1000)
setWalkerEnabled(false)
if (Self.ItemCount(MPotID) <= MinMPots) or (Self.Cap() < MinCap) or (Self.ItemCount(HPotID) <= MinHPots) then
setWalkerEnabled(true)
gotoLabel("leavecave")
else
setWalkerEnabled(true)
gotoLabel("hunt")
end

elseif (labelName == "bank") then
setWalkerEnabled(false)
NpcConv("hi","deposit all","yes","balance")
wait(900, 1200)
Self.WithdrawMoney((MPotprice*(MPots-Self.ItemCount(MPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.WithdrawMoney((HPotprice*(HPots-Self.ItemCount(HPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(2000)
setWalkerEnabled(true)
wait(2000)

elseif (labelName == "useelevatordown") then
delayWalker(3000)
Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)

elseif (labelName == "useelevatorup") then
delayWalker(3000)
Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)

elseif (labelName == "backpacks") then
dofile("Forgee.lua")
delayWalker(15000)
resetBackpacks()


elseif (labelName == "deposit") then
setWalkerEnabled(false)
Self.DepositItems({17810,0})
Self.DepositItems({17859,0})
Self.DepositItems({17819,0})
Self.DepositItems({17818,0})
Self.DepositItems({17813,0})
Self.DepositItems({17812,0})
Self.DepositItems({17817,0})
Self.DepositItems({17809,0})
Self.DepositItems({17825,0})
wait(1500,1900)
setWalkerEnabled(true)
wait(2000)


elseif (labelName == "refillpots") then
setWalkerEnabled(false)
wait(900, 1200)
Self.SayToNpc({"hi", "flasks", "yes", "Trade"}, 65)
wait(900, 1200)
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID , (MPots-Self.ItemCount(MPotID)))
wait(900, 1200)
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(HPotID , (HPots-Self.ItemCount(HPotID)))
wait(200, 500)
setWalkerEnabled(true)




end
end
function buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(item, count)
count = tonumber(count) or 1
repeat
local amnt = math.min(count, 100)
if(Self.ShopBuyItem(item, amnt) == 0)then
return printf("ERROR: failed to buy item: %s", tostring(item))
end
wait(200,500)
count = (count - amnt)
until count <= 0
end

Robin2161
01-10-2013, 01:37 PM
Anyone? The NPC conersations ain't working that good

desche188
01-10-2013, 01:52 PM
new forge.lua

Robin2161
01-10-2013, 03:43 PM
new forge.lua

What? The script is outdated, doesn't help with a new forgee..

desche188
01-10-2013, 03:49 PM
i use the same npc conversation and it works fine

Infernal Bolt
01-10-2013, 04:14 PM
Since I removed forgees bp opener you will have to specify what bps you use in the config on top, it opens mainbp first and then the other ones in new windows in the order specified.



--Settings---------------------------------------
local MPotID = 268 --- mana potion ID
local MinMPots = 20 ---- if less then script will exit spawn
local MPots = 200 ----- amount to refill
local MPotprice = 50 ---- price of 1 single mana pot
local HPotID = 239 ---- health potion ID
local HPotprice = 190 ---- health potion price
local HPots = 10 ---- health potions you want to buy
local MinHPots = 5 ---- min of health potions to leave
local MinCap = 50 ---- if less then script will exit spawn

local Backpacks = {"Red Backpack", "Blue Backpack", "Golden Backpack"} -- CHANGE THESE TO WHATEVER YOU USE, IT WILL OPEN MAIN BP AUTO
-------------------------------------------------
--END OF SETTINGS--------------------------------



--- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")


function onWalkerSelectLabel(labelName)
if (labelName == "sell") then
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 65) wait(1200, 2000)
Self.ShopSellAllItems(17810) wait(900, 1200)
Self.ShopSellAllItems(17859) wait(900, 1200)
Self.ShopSellAllItems(17819) wait(900, 1200)
Self.ShopSellAllItems(17818) wait(900, 1200)
Self.ShopSellAllItems(17813) wait(900, 1200)
Self.ShopSellAllItems(17812) wait(900, 1200)
Walker.Start()
elseif (labelName == "checker") then
if (Self.ItemCount(MPotID) <= MinMPots) or (Self.Cap() < MinCap) or (Self.ItemCount(HPotID) <= MinHPots) then
gotoLabel("leavecave")
else
gotoLabel("hunt")
end
elseif (labelName == "bank") then
Walker.Stop()
Self.DepositMoney('all')
wait(900, 1200)
Self.WithdrawMoney(MPotprice*(MPots-Self.ItemCount(MPotID)))
Self.WithdrawMoney(HPotprice*(HPots-Self.ItemCount(HPotID)))
wait(900, 1200)
Self.SayToNpc("balance")
Walker.Start()
elseif (labelName == "useelevatordown") then
Walker.Stop()
Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)
wait(1000,2000)
Walker.Start()
elseif (labelName == "useelevatorup") then
Walker.Stop()
Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)
wait(1000,2000)
Walker.Start()
elseif (labelName == "backpacks") then
Walker.Stop()
Self.CloseContainers()
wait(900,1000)
Self.OpenMainBackpack():OpenChildren(unpack(Backpa cks))
Walker.Start()
elseif (labelName == "deposit") then
Self.DepositItems(17810,17859,17819,17818,17813,17 812,17817,17809,17825)
elseif (labelName == "refillpots") then
Walker.Stop()
Self.SayToNpc({"hi", "flasks", "yes", "Trade"}, 65)
wait(1200, 2200)
Self.ShopBuyItemsUpTo(MPotID, MPots)
wait(400, 700)
Self.ShopBuyItemsUpTo(HPotID, HPots)
Walker.Start()
end
end

Robin2161
01-10-2013, 08:00 PM
Getting the following message:

20:58 XenoScript Error:
Script: Coryms - Venore.lua
Line #: 54
Chunk: ...LAPTOP\Documents\XenoBot\Scripts\Coryms - Venore.lua
Error: attempt to index global 'Walker' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.

Infernal Bolt

Infernal Bolt
01-10-2013, 08:06 PM
Update your bot

also take the script again, noticed I forgot to add Self.ShopSellAllItems on all the selling functions.

Robin2161
01-10-2013, 08:52 PM
Update your bot

also take the script again, noticed I forgot to add Self.ShopSellAllItems on all the selling functions.

Working now! But the functions still need to be updated, it doesn't search for a free depot... And the deposit function is not that good, sometimes forgets to deposit items

Infernal Bolt
01-10-2013, 08:58 PM
Working now! But the functions still need to be updated, it doesn't search for a free depot... And the deposit function is not that good, sometimes forgets to deposit items

The deposit function is from the native lib and if you want to make a checker then figure out how to make one yourself :)
Rydan has a good reachdp function, idk where I found it but it works just fine.

Robin2161
01-10-2013, 09:14 PM
Where should I put this in my script? Rydan