You have to delete Loadsettings() from the LUA. Then load all the LUA's and XBST and save the XBST again.
And i also have a problem with opening doors etc. I think these funtions are intervering with the new xenobot functions.
Printable View
Hi DarkstaR,
I use this script for slime training but I get this message:
11:17 XenoScript Error:
Script: SlimeTrainer.lua
Line #: 1826
Chunk: C:\Program Files ?x86??XenoBot?Data?XenoLuaLib.lua
Error: attempt to compare number with table
This is an error with user-input and should not be reported as a bug with XenoBot.
here is the script:
]]--
while(true) do
if (Self.TargetID() == 0) then
if (getTargetsInArea(Self.Position(), 1, 0, 0) == 2) then
setTargetingEnabled(true)
wait(500)
setTargetingEnabled(false)
end
end
wait(2000,3000)
end
@Virse, while this is a minor backwards compat bug that will be fixed. I wrote you a better script in the mean time. Let me know if it works well for you.
You should be able to use it the exact same way.
[code=lua]Module.New('slime-trainer', function(mod)
if (Self.TargetID() == 0 and #Self.GetTargets(1) == 2) then
setTargetingEnabled(true)
mod:Delay(500)
setTargetingEnabled(false)
end
mod:Delay(math.random(2000,3000))
end)[/code]
Before the update the Self.Step"(EAST)" was working flawless. So I saw that with the update it would automaticly load the scripts now aswell, so I saved settings when I had all the needed scripts executed.
Then when it went to refill, it wouldnt go trough the teleporter at banuta main floor (with self.step)
So either way, Xenobot somehow corrupted the files when saving, or Self.Step isnt working proppely anymore.
Also, before speaking to npc's at like boats, it is waiting way longer now then before. Maybe because of the self.reachnpc? Did u change anything to one liners that could cause this bugs?
Self.ReachNpc Doesnt work at all.
Edit: I Downloaded the new version 3.00 At like 11;00 PM.
Edit 2: All Oneliners arent working properly.
Its slow.
Good to know I am not the only one. Thought I did something wrong. Any Moderator that could Enlighten Darkstar with the great news xD?
I will need your script to fix this, but it look like you're using Self.DropItems() incorrectly.
Nothing changed with the injector, you must be doing something wrong. Try a full re-install. There's no reason this should happen now if it didn't before.
I'll need the script.
Most people were using the open door functions incorrectly. Now that they have been properly updated, it is breaking peoples scripts. This is why I always yell at people for doing things wrong - I update thing properly and they break because they are used improperly.
Provide you script I'll see if I can fix it.
Self.Step"(EAST)" Is a very improper way to call it. Try Self.Step(EAST), works fine for me.
I have no clue what Self.ReachNpc is, I have not made a function like that so it must be a third party function using some shitty hack to reach the npc. Post it and I'll take a look.
One liners are working perfectly fine. Any problem with them are due to bad scripts.
Let me just reiterate that all of my scripts work FINE. All Infernal Bolts scripts work FINE and all of Spectrus' script work FINE. Most of your issues are poorly made scripts.
Except for needing to change my HUD, HUD.createtextitem wouldn't work I had to replace it with HUD.New everything appears to be working. Due to some other changes I need to use tostring now to force it from being an item but thats all understandable. I think not being able to use HUD.createtextitem might be a bug. In the lib you haveagain executing your example script it runs into errors.Code:HUD.CreateTextDisplay = HUD.New
HUD.CreateItemDisplay = HUD.New
Testing this now. im encountering problems. scenario 2, 3"a", and 3"b" work fine but 1 doesnt work. I get this error.Code:09:33 XenoScript Error:
Script: a.lua
Line #: 1
Chunk: C:?Users?soul4soul?Documents?XenoBot?Scripts?a.lua
Error: attempt to call field 'CreateTextDisplay' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.
Quote:
09:23 XenoScript Error:
Script: control - South Cyclops.lua
Error: cannot open C:\Users\soul4soul\Documents\XenoBot\Scripts\contr ol - South Cyclops.lua: No such file or directory
This is an error with user-input and should not be reported as a bug with XenoBot.
DELETED
That change log <3
Thanks!
it seems like forgee's backpack reopener doesn't work anymore but well i think that doesn't matter much.
i'll just have to change all my lua's :p
Aight thanks alot, Im gonna try that. While you're on it.
Like half of the times, the Depositter doesnt deposit (all) my items. this causes the bot to get stuck when trying to buy potions/sd's because it doesn't thave enough cap.
Could you take a look into that aswell? Its about the same scripts I just send you.
Btw, I just checked the LUA, it actually says Self.Step (east). But in the XBST file its named Self.Step("EAST"). Ive changed it in the XBST file, geuss thats wrong huh xD?
@DarkstaR or any other Pro scripter :P
A lot less messy then letting the bot sit there and use hotkeys at random until they're open, :PCode:Self.CloseContainers()
repeat
wait(900)
until (Self.UseItemFromEquipment("backpack") > 0) --opens main backpack
wait(1000)
Container.GetFirst():OpenChildren("brocade backpack", "backpack of holding", "orange backpack")
It needs either
Self.Step(EAST) or Self.Step("east"). Anything else that may have previously worked was actually a lucky bug not intended to work :P
The deposit function has always been a bit sketchy as well. Just put the deposit statement in the lua 2 or 3 times, that's what I always do. Lmao. (I really don't know what the issue may be, it was made by Syntax and is very hard to understand.)
In before version its work:
On v3.0 i see this error msg:Code:local HUDText = HUD.CreateTextDisplay(100, 100, "", 255, 120, 120)
local HUDItem = HUD.CreateItemDisplay(100, 120, 1781, 48, 100)
local countFile = assert(io.open("C:\\Users\\ht\\Desktop\\stones.txt", "r"))
while (true) do
if(countFile ~= Self.ItemCount(1781)) then
local file = io.open("C:\\Users\\ht\\Desktop\\stones.txt", "w")
file:write(Self.ItemCount(1781))
file:flush()
file:close()
end
HUDText:SetText("Stones: " .. Self.ItemCount(1781) .. " left ")
wait(1000)
end
Quote:
15:56 XenoScript Error:
Script: stones.lua
Line #: 1
Chunk: ...\Documents\XenoBot\Scripts\stones.lua
Error: attempt to call field 'CreateTextDisplay' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.
Thanks for the update ;)
Unfortunately the following script doesn't work:
[code=lua]
local config = {
attacks = {
--[[
spells should be prioritized from top to bottom, eg: exori gran will be attempted before exori or exori mas.
players:
true = the area will include players in the threshold
false = the area will only count the monsters in the area
aggressive:
0 = attack triggers when no players are in the area.
1 = attack triggers when only war enemies and skulled players, noone else.
2 = attack triggers when innocents are in the area but not when friendlies are.
3 = attack triggers when friendlies are in the area but not when innocents are.
4 = attack triggers without any regards to players in the area.
]]
--{words="exori gran", threshold=3, mana=340, radius=1, aggressive=4, players=false},
{words="exori", threshold=4, mana=120, radius=1, aggressive=4, players=false}
--{words="exori ico", threshold =1, mana=40, radius=1, aggressive=4, players=false},
--{words="exori hur", threshold =2, mana=40, radius=1, aggressive=4, players=false}
}
}
local function think()
for _, info in ipairs(config.attacks)do
local amount = getTargetsInArea(Self.Position(), info.radius, info.aggressive, info.players)
if(amount)then
if(amount >= info.threshold) and (Self.CanCastSpell(info.words)) then
Self.Cast(info.words, info.mana)
end
end
end
end
[/code]
yields an error:
16:07 XenoScript Error:
Script: Script.lua
Line #: 1943
Chunk: C:\Program Files ?x86??XenoBot?Data?XenoLuaLib.lua
Error: attempt to index global 'pos' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.
How can I fix this?
Redownloading and clearing cache did nothing for me i already tried it
oooh someone with the same problem as me. To get it to work for now change your first 2 lines.
local HUDText = HUD.New(100, 100, "", 255, 120, 120)
local HUDItem = HUD.New(100, 120, 1781, 48, 100)
Hi DarkstaR could you help me with this issue please,
this is the slime trainer script im using, it worked perfectly before XenoBot update:
]]--
while(true) do
if (Self.TargetID() == 0) then
if (getTargetsInArea(Self.Position(), 1, 0, 0) == 2) then
setTargetingEnabled(true)
wait(500)
setTargetingEnabled(false)
end
end
wait(2000,3000)
end
and this is the error im receiving after update:
15:33 XenoScript Error:
Script: SlimeTrainer.lua
Line #: 1
Chunk: C:?Users?robert?Documents?XenoBot?Scripts?SlimeTra iner.lua
Error: unexpected symbol near ']'
This is an error with user-input and should not be reported as a bug with XenoBot.
Thanks in advance.
Thank you for update, seems nice eventho I cant test it yet, and merry Christmas! :D
deleted.
Re-downloaded and clean re-installed and deleted the last parameter in getTargetsInArea and now getting another error:
16:48 XenoScript Error:
Script: Script.lua
Line #: 1943
Chunk: C:\Program Files ?x86??XenoBot?Data?XenoLuaLib.lua
Error: attempt to call field 'isAttackSafe' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.
Creature.Follow is a library function, not one you have to make. I fixed that.
*REMOVED*
Hmm alright, I take it that you editted from the 1st links I send you, since in my new one I had the depositter 3x? Or did you delete that on purpose aswell? Fk scripts are so sensetive....
@Y2Quake
Container.Minimize("golden backpack")
Container.Minimize("orange backpack")
Container.Minimize("red backpack")
Etc.
The only thing I changed was the Creature.Follow.
@DarkstaR Happy you fixed his problem, however PM it to him or hide the post please since the lua file is a paid script. Respect
/Stusse
thanks so much rydan, now i've another problem.
The following lua doesn't even load nor give any kind of error log.
[CODE=LUA]
------Yalahar Zombies Script-------
--------By Hypn0tic Ki11er---------
--------------Enjoy!!--------------
---I recommend you stack BPs inside of the backpacks in your DP and regular backpacks.
Paladin = true --Are you a Paladin?
--------Soft Boots Settings-------
SoftBoots = false --Whether you are using Soft Boots.
SecondaryBootID = 3079 --Boots you use (when not using softs(keep it in main BP -|||||- 4033 = Draken Boots. 3079 = Boots of Haste.
BoatAccess = true --Can you travel with Karith (Yalahar) to Venore (Without going through Liberty Bay)?
---------Checker Settings---------
LeaveNoSofts = false --Whether you want to leave if you don't have any soft boots left.
LeaveUponGoldAmount = false --Whether you want to leave upon reaching a certain gold amount (determined below).
GoldToLeave = 10000 --Amount of gold before you leave the cave.
MinCap = 10 --At what capacity do you want to leave the cave?
ManasToLeave = 45 --How many Mana Potions to leave the cave?
HealthsToLeave = 20 --How many Health Potions to leave the cave?
GoldID = 3031 --Gold ID
---Support---
WantedHPS = 50 --How many Health Potions do you want in your BP?
WantedMPS = 250 --How many Mana Potions do you want in your BP?
HealthCost = 100 --How much each Health Potion costs.
ManaCost = 80 --How much each Mana Potion costs.
HealthPotID = 236 --Health Potion ID.
ManaPotID = 237 --Mana Potion ID.
---Distance---
---Optional---
WantedDistance = 35 --Amount of your Distance Weapon that you want.
DistanceToLeave = 10 --Amount of your Distance Weapon for you to leave.
DistanceCost = 25 --How much each unit of your distance weapon costs. It is set to Drill Bolt by default.
DistanceID = 7378 --Set this to the Ammo/Spear you want to use. It is defaultly set to Drill Bolt.
--------------
GoldBP = 8860
LootBP = 2854
-----------------------------------------------
if (Paladin == true) then
loadSettings("[Paladin] Yalahar Zombies", "All")
end
if (Paladin == false) then
loadSettings("[Knight] Yalahar Zombies", "All")
end
setTargetingEnabled(true)
setLooterEnabled(true)
-----------------------------------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "InitialChecker") then
setWalkerEnabled(false)
if ((Self.ItemCount(3549) == 0)) and ((Self.ItemCount(6529) == 0)) and ((SoftBoots == true)) or ((Self.ItemCount(ManaPotID) < WantedMPS)) or ((Self.ItemCount(HealthPotID) < WantedHPS)) or (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) <= 3000)) then
gotoLabel("ToDepot")
setWalkerEnabled(true)
else
gotoLabel("ToHunt")
setWalkerEnabled(true)
end
elseif (labelName == "ResetBP") then
Self.CloseContainers()
repeat
wait(900)
until (Self.UseItemFromEquipment("backpack") > 0) --opens main backpack
wait(1000)
Container.GetFirst():OpenChildren(GoldBP, LootBP)
elseif (labelName == "BuyDistance") then
setWalkerEnabled(false)
delayWalker(5000) --Stops walker so that the character doesn't move away from the NPC.
Self.SayToNpc({"Hi", "Trade"}, 100)
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
buyitems(DistanceID, (WantedDistance-Self.ItemCount(DistanceID)))
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
setWalkerEnabled(true)
elseif (labelName == "Bank") then
setWalkerEnabled(false)
delayWalker(7000) --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)) --Sleep between everything the character says to avoid suspicion.
Self.SayToNpc("yes")
sleep(math.random(700, 1400)) --Sleep between everything the character says to avoid suspicion.
Self.WithdrawMoney((ManaCost*(WantedMPS-Self.ItemCount(ManaPotID))))
Self.WithdrawMoney((HealthCost*(WantedHPS-Self.ItemCount(HealthPotID))))
if ((SoftBoots == true)) and ((BoatAccess == true)) and ((Self.ItemCount(3549) == 0)) and ((Self.ItemCount(6529) == 0)) then
Self.WithdrawMoney((10000*(Self.ItemCount(6530))))
Self.WithdrawMoney(370)
wait(500)
elseif ((SoftBoots == true)) and ((BoatAccess == false)) and ((Self.ItemCount(3549) == 0)) and ((Self.ItemCount(6529) == 0)) then
Self.WithdrawMoney((10000*(Self.ItemCount(6530))))
Self.WithdrawMoney(1160)
sleep(math.random(700, 1400)) --Sleep between everything the character says to avoid suspicion.
else
sleep(math.random(700, 1400)) --Sleep between everything the character says to avoid suspicion.
end
if (Paladin == true) then
sleep(math.random(700, 1400)) --Sleep between everything the character says to avoid suspicion.
Self.WithdrawMoney((DistanceCost*(WantedDistance-Self.ItemCount(DistanceID)))+1500)
sleep(math.random(700, 1400)) --Sleep between everything the character says to avoid suspicion.
end
setWalkerEnabled(true)
elseif (labelName == "Deposit") then
setWalkerEnabled(false)
Self.ReachDepot()
Self.DepositItems({3324, 0}, {9659, 0}, {3026, 0}, {3027, 0}, {10320, 0}, {3079, 0}, {3567, 0}, {3325, 0}, {12304, 0}, {3435, 0}, {8073, 0}, {3574, 0}, {7456, 0}, {7427, 0}, {9028, 0}, {7407, 0},{3055, 0}, {820, 0}, {3052, 0})
wait(1500,1900)
setWalkerEnabled(true)
elseif (labelName == "SellItems") then
setWalkerEnabled(false)
Self.SayToNpc("hi")
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
Self.SayToNpc("trade")
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
sellitems(3351, Self.ItemCount(3351))
sellitems(3269, Self.ItemCount(3269))
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
setWalkerEnabled(true)
elseif (labelName == "BuyPotions") then
setWalkerEnabled(false)
Self.SayToNpc("hi")
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
Self.SayToNpc({"Hi", "flasks", "yes", "yes", "yes", "Trade"}, 100)
sleep(math.random(2000, 2400)) --Sleep between everything the character says to avoid suspicion.
buyitems(ManaPotID, (WantedMPS-Self.ItemCount(ManaPotID)))
buyitems(HealthPotID, (WantedHPS-Self.ItemCount(HealthPotID)))
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
setWalkerEnabled(true)
elseif (labelName == "CheckSofts") then
setWalkerEnabled(false)
if ((Self.ItemCount(3549) == 0)) and ((Self.ItemCount(6529) == 0)) and ((SoftBoots == true)) then
gotoLabel("ToVenore")
setWalkerEnabled(true)
else
gotoLabel("ToHunt")
setWalkerEnabled(true)
end
elseif (labelName == "Checker") then
setWalkerEnabled(false)
if ((Self.ItemCount(DistanceID) < DistanceToLeave)) and (Paladin == true) or ((Self.ItemCount(3549) == 0)) and ((Self.ItemCount(6529) == 0)) and ((LeaveNoSofts == true)) or (Self.Cap() <= MinCap) or ((Self.ItemCount(ManaPotID) < ManasToLeave)) or ((Self.ItemCount(HealthPotID) < HealthsToLeave)) or (LeaveUponGoldAmount == true) and ((Self.ItemCount(GoldID) >= GoldToLeave)) then
setWalkerEnabled(true)
gotoLabel("Leave")
else
setWalkerEnabled(true)
gotoLabel("KeepHunting")
end
elseif (labelName == "KeepHunting") then
if (Self.Feet().id ~= 3549) and (Self.Feet().id ~= 6529) and ((SoftBoots == true)) then
if ((Self.ItemCount(3549) == 0)) then
setWalkerEnabled(false)
Self.Equip(6529, "feet")
wait(500)
setWalkerEnabled(true)
else
setWalkerEnabled(false)
Self.Equip(3549, "feet")
wait(500)
setWalkerEnabled(true)
end
end
elseif (labelName == "Leave") then
setWalkerEnabled(false)
Self.Equip(SecondaryBootID, "feet")
wait(500)
setWalkerEnabled(true)
end
end
------------------------------------
----------OTHER FUNCTIONS-----------
----------DON'T MESS HERE-----------
------------------------------------
function buyitems(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
function sellitems(item, count)
count = tonumber(count) or 1
repeat
local amnt = math.min(count, 100)
if(Self.ShopSellItem(item, amnt) == 0)then
return printf("ERROR: failed to sell item: %s", tostring(item))
end
wait(200,500)
count = (count - amnt)
until count == 0
end
Map.GetUseItems = function (id)
if type(id) == "string" then
id = Item.GetID(id)
end
local pos = Self.Position()
local store = {}
for x = -7, 7 do
for y = -5, 5 do
if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
table.insert(store, itemPos)
end
end
end
return store
end
Self.ReachDepot = function (tries)
local tries = tries or 3
setWalkerEnabled(false)
local DepotIDs = {3497, 3498, 3499, 3500}
local DepotPos = {}
for i = 1, #DepotIDs do
local dps = Map.GetUseItems(DepotIDs[i])
for j = 1, #dps do
table.insert(DepotPos, dps[j])
end
end
local function gotoDepot()
local pos = Self.Position()
print("Depots found: " .. tostring(#DepotPos))
for i = 1, #DepotPos do
location = DepotPos[i]
Self.UseItemFromGround(location.x, location.y, location.z)
wait(1000, 2000)
if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
wait(5000, 6000)
if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
setWalkerEnabled(true)
return true
end
else
print("Something is blocking the path. Trying next depot.")
end
end
return false
end
repeat
reachedDP = gotoDepot()
if reachedDP then
return true
end
tries = tries - 1
sleep(100)
print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
until tries <= 0
return false
end
[/CODE]
thanks for having a look.
This is the server log when i load it:
13:12 XenoBot: Loaded settings successfully.
it doesn't print any error so its weird.