PDA

View Full Version : Need some help



itisandrew
04-05-2013, 11:21 AM
hi i been having problems with scripts that i m useing the ones i got they have refiler and gold depositer but it never works so it doent deposit gold and doesnt rebuy pots so i m guessing i m missing something so if someone can explin to me how it all works would be much appriciated

Tibtrak
04-05-2013, 11:22 AM
It will be much easier for ppl to help you out if you copy/paste the script into this thread, and/or give some more spesific information.

itisandrew
04-05-2013, 11:24 AM
thnks for the quick reply
this is what i m useing

-----------Hdden Larvas---------------
-----------Made by Hypn0ticKi11er-----
-----------Enjoy----------------------

--SETTINGS--

LeaveUponGoldAmount = true --Whether you want to leave upon reaching gold determined below.

GoldToLeave = 3000 --Amount of gold before you leave the cave.

MinCap = 3 --At what capacity do you want to leave the cave?

GoldID = 3031 --Gold ID


-----END OF SETTINGS-----
-----Script Begins Here-----
-----Edit at your own risk-----


registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")


function onWalkerSelectLabel(labelName)
if (labelName == "ResetBP") then
resetBackpacks()
elseif (labelName == "ResetBP") then
resetBackpacks()
elseif (labelName == "Checker") then
if (Self.Cap() < MinCap) or (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= GoldToLeave)) then
gotoLabel("Leave")
else
gotoLabel("KeepHunting2")
end
elseif (labelName == "Checker2") then
if (Self.Cap() < MinCap) or (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= GoldToLeave)) then
gotoLabel("Leave")
else
gotoLabel("KeepHunting3")
end
elseif (labelName == "Checker3") then
if (Self.Cap() < MinCap) or (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= GoldToLeave)) then
gotoLabel("Leave")
else
gotoLabel("KeepHunting")
end
elseif (labelName == "Bank") then
setWalkerEnabled(false)
delayWalker(5000) --Stops walker so that the character doesn't move away from the NPC.
Self.SayToNpc("hi")
sleep(math.random(700, 1400)) --Sleep between everything the character says to avoid suspicion.
Self.SayToNpc("deposit all")
sleep(math.random(300, 1000))
Self.SayToNpc("yes")
setWalkerEnabled(true)
end
end

-------------------------------
-------Additional Script-------
-------Don't Mess Here---------
-------------------------------

function closeBackpacks()
local displayName = "CloseBackpacks"
local tmpBP = Container.GetFirst()
local cascaded = {}
while tmpBP:isOpen() do
for spot = 0, tmpBP:ItemCount() do
local item = tmpBP:GetItemData(spot)
if item.id == tmpBP:ID() then
table.insert(cascaded, tmpBP:ID())
tmpBP = tmpBP:GetNext()
end
end
tmpBP = Container.GetFirst()
if not table.contains(cascaded, tmpBP:ID()) or tmpBP:ItemCount() == 0 then -- Backpack is main or last cascaded. Closing...
Self.UseItem(tmpBP:ID())
wait(500, 900)
end
if #cascaded > 0 then -- Any cascaded backpacks?
for i = 1, #cascaded do
if tmpBP:ID() == cascaded[i] then -- Found cascaded backpack.
if tmpBP:ItemCount() > 0 then -- Backpack contains atleast one item, check for another bp.
for spot = 0, tmpBP:ItemCount() do
local item = tmpBP:GetItemData(spot)
if item.id == tmpBP:ID() then -- Found anoter cascade bp, opening...
tmpBP:UseItem(spot, true)
break
end
end
end
end
end
end
wait(500, 900)
tmpBP = Container.GetFirst() -- Get a new bp to check.
if tmpBP:ID() == 0 then -- No more open backpacks.
print("All backpacks were successfully closed.")
end
end
return true
end

function openBackpacks(...)
local displayName = "OpenBackpacks"
local backpacks = {...}
Self.UseItem(Self.Backpack().id) -- Open main backpack.
print("Opening main backpack.")
wait(500, 900)
main = Container.GetFirst()
if #backpacks > 0 then
for i = 1, #backpacks do
if type(backpacks[i]) == 'table' then -- Is parent container specified?
tmpBP = Container.GetByName(backpacks[i][1])
for spot = 0, tmpBP:ItemCount() do
item = tmpBP:GetItemData(spot)
if item.id == backpacks[i][2] then
tmpBP:UseItem(spot)
print("Opening backpack from list. " .. backpacks[i][1] .. ", " .. backpacks[i][2])
wait(500, 800)
end
end
else -- If there is no parent specified we will use the main bp.
for spot = 0, main:ItemCount() do
item = main:GetItemData(spot)
if item.id == backpacks[i] then
main:UseItem(spot)
print("Opening backpack from list, " .. backpacks[i])
wait(500, 800)
end
end
end
end
local indexes = Container.GetIndexes()
for i = 1, #indexes do
if type(backpacks[i]) == "table" then
if Container.GetFromIndex(indexes[i]):ID() ~= backpacks[i][1] then
return false
end
else
if Container.GetFromIndex(indexes[i]):ID() ~= backpacks[i] then
return false
end
end
end
return true
end
end

function getOpenBackpacks()
local indexes = Container.GetIndexes() -- Find index for all open backpacks
local open = {} -- Create a place to store our open backpacks
for i = 1, #indexes do -- Search all open backpacks
tmpBP = Container.GetFromIndex(indexes[i])
table.insert(open, tmpBP:ID()) -- Store this backpack
end
return open -- Return found backpacks
end

function resetBackpacks(tries)
setWalkerEnabled(false)
local open = getOpenBackpacks() -- Save a list of open backpacks
local tries = 3 -- Give the script 3 tries to achieve a successful reset.
repeat
closeBackpacks() -- Close all backpacks
wait(600, 800) -- wait a little bit
local reopen = openBackpacks(unpack(open)) -- I store the return from openBackpacks, true if successfull, false otherwise
if tries == 0 then -- Check how many tries function has left
print("BackpackReset failed!") -- Tell the user reset has failed
return false
end
tries = tries - 1 -- One try has been spent
until reopen -- If reopen is true it means all backpacks were opened successfully and function is done
print("BackpackReset was successfull!") -- Tell user reset was successful
setWalkerEnabled(true)
return true
end

itisandrew
04-05-2013, 11:25 AM
so it does run back to the bank and dp but doesnt do anything

Tibtrak
04-05-2013, 12:14 PM
so it does run back to the bank and dp but doesnt do anything
So I tabbed the script a little for you and added in Walker.Stop/Start() / Cavebot.Stop/Start() where it was needed, like when resetting bps you would want it to stop walking. I didnt look much into each function, and I didn't bother to look into (or tab) the functions created by Forgee at the bottom. But they did not have anything to do with depositting at bank or dp either. Actually there are no functions in this script releated to dp, so it wont do anything in dp. It should deposit gold in bank. I don't quite understand why it wouldn't do that. The function written before seemed correct, outdated, but correct. Anyway, I updated the banker a little bit. So you could try this and see if it works for you. Remember to load the lua file in the scripter AFTER you've loaded the xbst file. (Then save the script and later you only have to load the xbst file).

With that beeing said, this script is old and outdated. It's not a very good script. But I believe it would still work.
If this doesn't work for you, I simply suggest you to look at the Larva scripts from JX-Scripts. They should be up to date and work.
http://forums.xenobot.net/showthread.php?8821-JXScripts-(-gt-.-)-gt-100-AFK-lt-(-.-lt-)&highlight=larvas


-----------Hdden Larvas---------------
-----------Made by Hypn0ticKi11er-----
-----------Enjoy----------------------

--SETTINGS--
LeaveUponGoldAmount = true --Whether you want to leave upon reaching gold determined below.
GoldToLeave = 3000 --Amount of gold before you leave the cave.
MinCap = 3 --At what capacity do you want to leave the cave?
GoldID = 3031 --Gold ID


-----END OF SETTINGS-----
-----Script Begins Here-----
-----Edit at your own risk-----


registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "ResetBackpacks") then
Walker.Start()
resetBackpacks()
Walker.Stop()
elseif (labelName == "Checker") then
Cavebot.Stop()
if (Self.Cap() < MinCap) or (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= GoldToLeave)) then
gotoLabel("Leave")
Cavebot.Start()
else
gotoLabel("KeepHunting2")
Cavebot.Start()
end
elseif (labelName == "Checker2") then
Cavebot.Stop()
if (Self.Cap() < MinCap) or (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= GoldToLeave)) then
gotoLabel("Leave")
Cavebot.Start()
else
gotoLabel("KeepHunting3")
Cavebot.Start()
end
elseif (labelName == "Checker3") then
Cavebot.Stop()
if (Self.Cap() < MinCap) or (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= GoldToLeave)) then
gotoLabel("Leave")
Cavebot.Start()
else
gotoLabel("KeepHunting")
Cavebot.Start()
end
elseif (labelName == "Bank") then
Walker.Stop()
wait(1000,2000)
Self.SayToNpc({"hi", "deposit all", "yes"}, 65)
wait(1000,2000)
Walker.Start()
end
end

-------------------------------
-------Additional Script-------
-------Don't Mess Here---------
-------------------------------

function closeBackpacks()
local displayName = "CloseBackpacks"
local tmpBP = Container.GetFirst()
local cascaded = {}
while tmpBP:isOpen() do
for spot = 0, tmpBP:ItemCount() do
local item = tmpBP:GetItemData(spot)
if item.id == tmpBP:ID() then
table.insert(cascaded, tmpBP:ID())
tmpBP = tmpBP:GetNext()
end
end
tmpBP = Container.GetFirst()
if not table.contains(cascaded, tmpBP:ID()) or tmpBP:ItemCount() == 0 then -- Backpack is main or last cascaded. Closing...
Self.UseItem(tmpBP:ID())
wait(500, 900)
end
if #cascaded > 0 then -- Any cascaded backpacks?
for i = 1, #cascaded do
if tmpBP:ID() == cascaded[i] then -- Found cascaded backpack.
if tmpBP:ItemCount() > 0 then -- Backpack contains atleast one item, check for another bp.
for spot = 0, tmpBP:ItemCount() do
local item = tmpBP:GetItemData(spot)
if item.id == tmpBP:ID() then -- Found anoter cascade bp, opening...
tmpBP:UseItem(spot, true)
break
end
end
end
end
end
end
wait(500, 900)
tmpBP = Container.GetFirst() -- Get a new bp to check.
if tmpBP:ID() == 0 then -- No more open backpacks.
print("All backpacks were successfully closed.")
end
end
return true
end

function openBackpacks(...)
local displayName = "OpenBackpacks"
local backpacks = {...}
Self.UseItem(Self.Backpack().id) -- Open main backpack.
print("Opening main backpack.")
wait(500, 900)
main = Container.GetFirst()
if #backpacks > 0 then
for i = 1, #backpacks do
if type(backpacks[i]) == 'table' then -- Is parent container specified?
tmpBP = Container.GetByName(backpacks[i][1])
for spot = 0, tmpBP:ItemCount() do
item = tmpBP:GetItemData(spot)
if item.id == backpacks[i][2] then
tmpBP:UseItem(spot)
print("Opening backpack from list. " .. backpacks[i][1] .. ", " .. backpacks[i][2])
wait(500, 800)
end
end
else -- If there is no parent specified we will use the main bp.
for spot = 0, main:ItemCount() do
item = main:GetItemData(spot)
if item.id == backpacks[i] then
main:UseItem(spot)
print("Opening backpack from list, " .. backpacks[i])
wait(500, 800)
end
end
end
end
local indexes = Container.GetIndexes()
for i = 1, #indexes do
if type(backpacks[i]) == "table" then
if Container.GetFromIndex(indexes[i]):ID() ~= backpacks[i][1] then
return false
end
else
if Container.GetFromIndex(indexes[i]):ID() ~= backpacks[i] then
return false
end
end
end
return true
end
end

function getOpenBackpacks()
local indexes = Container.GetIndexes() -- Find index for all open backpacks
local open = {} -- Create a place to store our open backpacks
for i = 1, #indexes do -- Search all open backpacks
tmpBP = Container.GetFromIndex(indexes[i])
table.insert(open, tmpBP:ID()) -- Store this backpack
end
return open -- Return found backpacks
end

function resetBackpacks(tries)
setWalkerEnabled(false)
local open = getOpenBackpacks() -- Save a list of open backpacks
local tries = 3 -- Give the script 3 tries to achieve a successful reset.
repeat
closeBackpacks() -- Close all backpacks
wait(600, 800) -- wait a little bit
local reopen = openBackpacks(unpack(open)) -- I store the return from openBackpacks, true if successfull, false otherwise
if tries == 0 then -- Check how many tries function has left
print("BackpackReset failed!") -- Tell the user reset has failed
return false
end
tries = tries - 1 -- One try has been spent
until reopen -- If reopen is true it means all backpacks were opened successfully and function is done
print("BackpackReset was successfull!") -- Tell user reset was successful
setWalkerEnabled(true)
return true
end

itisandrew
04-06-2013, 07:27 AM
thank you for taking time i will try it and see how i go cheers