PDA

View Full Version : [Update] XenoBot v2.2.0 [Alarms | Refiller | Ammo Reload]



DarkstaR
02-03-2012, 04:23 PM
This update fixes many bugs and adds many features. Among the new functionality you will find is an Alarm system and a system to refill your ammunition for you. Furthermore, the Scripter now exports functionality for making scripts that can deposit looted items to depot and restock potions and other supplies strait from depot or any other containers where you store such supplies. Lastly, you can now see information about your equipment, inventory and use/move items as you please.

Changelog

v2.2.0
Fixed a bug which didn't show damage done to other players on Most Dealt Damage HUD item
Fixed Eat Food to wait until the character is still before eating food
Fixed Anti-Idle to wait until the character is still before spinning
Fixed a bug which caused the Scripter to kill the wrong scripts and, very rarely, crash upon killing a script
Fixed Walker Labels to delay longer before moving to the next waypoint iteration to allow scripts more time to execute
Fixed itemID boxes to draw stackable items with 100 count instead of 1, since it looks nicer
Added "Equipment Manager" to "Support" which currently supports functionality for refilling ammo to hand and arrow slot
Added "Alarms" dialog window which will allow the user to enable alerts which can warm them when certain actions take place. Current Alarms:
Disconnected
Damaged
Low Health
Private Message
Creature Detected
Player Attack
Player Detected
Player Detected extends functionality to logout upon detection. Furthermore, alarms which are triggered by other players will ignore partied players if enabled by the user.
Added new functionality to the Scripter. The functions are as follows:
Global functions:
wait(min, max)
wait(time)
setWalkerEnabled(enabled)
setLooterEnabled(enabled)
setTargetingEnabled(enabled)
Self class functions:
Self.UseItem(id)
Self.UseItemFromGround(x, y, z) --Returns the id of the item it found and used
Self.UseItemWithGround(id, x, y, z)
Self.UseItemWithCreature(itemid, creatureid)
Self.UseItemFromMyPosition() --Returns the id of the item it found and used
Self.UseItemWithMyPosition(id)
Self.UseItemWithMe(id)
Self.UseItemWithTarget(id)
Self.UseItemWithFollow(id)
Self.Head()
Self.Armor()
Self.Legs()
Self.Feet()
Self.Amulet()
Self.Weapon()
Self.Ring()
Self.Backpack()
Self.Shield()
Self.Ammo()
Container class functions
Container.GetFirst()
Container.GetByName(name)
Container.GetFromIndex(index)
Container:GetNext()
Container:Index()
Container:ID()
Container:Name()
Container:ItemCount()
Container:ItemCapacity()
Container:isOpen()
Container:GetItemData(spot)
Container:UseItem(spot)
Container:UseItemWithGround(spot, x, y, z)
Container:UseItemWithCreature(spot, id)
Container:MoveItemToEquipment(spot, slotName)
Container:MoveItemToGround(spot, x, y, z)
Container:MoveItemToContainer(spotFrom, containerTo, spotTo)

Sadly, though, I have still not managed to locate and fix the bug which is causing the client to crash upon inject. For this reason, and I cannot stress this enough, only inject in safe places - preferably when logged out. Below, you will find some scripting examples using some of the new functions:


LoadStars.lua - Loads Assassin Stars from Depot to weapon hand

local depot = Container.GetByName("Depot Chest")

for spot = 0, depot:ItemCount() do
local item = depot:GetItemData(spot)
if (item.id == 7368) then --assassin stars
depot:MoveItemToEquipment(spot, "weapon")
break
end
end

DropItems.lua - Drops all Gold to the floor

function dropItem(id)
local cont = Container.GetFirst()

while (cont:isOpen()) do
for spot = 0, cont:ItemCount() do
local item = cont:GetItemData(spot)
if (item.id == id) then
cont:MoveItemToGround(spot, Self.Position().x, Self.Position().y, Self.Position().z)
return true
end
end

cont = cont:GetNext()
end

return false
end


while (true) do
dropItem(3031)
wait(700, 1200)
end

DepotRestock.lua - When the Walker hits the label "AtDepot," opens Depot and moves all Assassin Stars to the first open Dragon Backpack


function onWalkerSelectLabel(labelName)
if (labelName == "AtDepot") then
setWalkerEnabled(false)
setLooterEnabled(false)
setTargetingEnabled(false)

Self.UseItemFromGround(Self.Position().x, Self.Position().y - 1, Self.Position().z) --open the Locker (north of us)
wait(1500) --Wait for 1.5 seconds

local locker = Container.GetByName("Locker")

if (locker:isOpen() == false) then
--handle the error~
else
locker:UseItem(0) --open the Depot Chest (first item in the container)
wait(1500) --Wait for 1.5 seconds
local depot = Container.GetByName("Depot Chest")


if (depot:isOpen() == false) then
--handle the error~
else
local backpack = Container.GetByName("Dragon Backpack") --should be open by the user, our ammo backpack
if (backpack:isOpen() == false) then
--handle the error
else
while (depot:CountItemsOfID(7368) > 0) do
for spot = 0, depot:ItemCount() do
local item = depot:GetItemData(spot)
if (item.id == 7368) then --assassin stars
depot:MoveItemToContainer(spot, backpack:Index(), 0)
wait(500, 1500)
break
end
end
end
end
end
end

setWalkerEnabled(true)
setLooterEnabled(true)
setTargetingEnabled(true)
gotoLabel("GoToHunt")
end
end


For download and operation instructions, refer back to this thread:
http://forums.xenobot.net/showthread.php?19

soul4soul
02-03-2012, 04:28 PM
awesome. great item functions now we can start making some real scripts.

Mega
02-03-2012, 04:28 PM
YOU OWN DARK

Pixels
02-03-2012, 04:54 PM
Nice to see this long ChangeLog ^^ Good Job!

Hendy
02-03-2012, 05:33 PM
As always good job!!

nostrumx
02-03-2012, 05:34 PM
how can I put those codes of the alarm and those things? or I just have to download again the bot?
Im new in this :S

MUHFUGGAS
02-03-2012, 05:35 PM
Really nice, good work!

Bashy
02-03-2012, 05:50 PM
I have been waiting for so long! I can finally skill my Knight without any fear. I could seriously make love to you right now.

Hawkeye
02-03-2012, 05:56 PM
Yeah, you added a lot of new functions. Good job Nick !

Lolbroek
02-03-2012, 06:18 PM
DepotRestock.lua - When the Walker hits the label "AtDepot," opens Depot and moves all Assassin Stars to the first open Dragon Backpack


function onWalkerSelectLabel(labelName)
if (labelName == "AtDepot") then
setWalkerEnabled(false)
setLooterEnabled(false)
setTargetingEnabled(false)

Self.UseItemFromGround(Self.Position().x, Self.Position().y - 1, Self.Position().z) --open the Locker (north of us)
wait(1500) --Wait for 1.5 seconds

local locker = Container.GetByName("Locker")

if (locker:isOpen() == false) then
--handle the error~
else
locker:UseItem(0) --open the Depot Chest (first item in the container)
wait(1500) --Wait for 1.5 seconds
local depot = Container.GetByName("Depot Chest")


if (depot:isOpen() == false) then
--handle the error~
else
local backpack = Container.GetByName("Dragon Backpack") --should be open by the user, our ammo backpack
if (backpack:isOpen() == false) then
--handle the error
else
while (depot:CountItemsOfID(7368) > 0) do
for spot = 0, depot:ItemCount() do
local item = depot:GetItemData(spot)
if (item.id == 7368) then --assassin stars
depot:MoveItemToContainer(spot, backpack:Index(), 0)
wait(500, 1500)
break
end
end
end
end
end
end

setWalkerEnabled(true)
setLooterEnabled(true)
setTargetingEnabled(true)
gotoLabel("GoToHunt")
end
end


can we change the function so he would deposit stuff inside depot?

and about the dragon backpack is it inside depot or main backpack

Ryangiggs
02-03-2012, 06:23 PM
If you can make so bot takes assasin stars from depot to bp, cant you make that bot throw in stuff from bp to dp?

Xongiver
02-03-2012, 06:30 PM
"local backpack = Container.GetByName("Dragon Backpack") --should be open by the user"

does it mean script is not able to refill afk?

Ryangiggs
02-03-2012, 06:34 PM
"local backpack = Container.GetByName("Dragon Backpack") --should be open by the user"

does it mean script is not able to refill afk?

I think that means, once(first time) bot doesnt close the bp dude

Xongiver
02-03-2012, 06:39 PM
and about it
"When the Walker hits the label "AtDepot," opens Depot and moves all Assassin Stars to the first open Dragon Backpack"

cant amount be set by user? eg 500, if it move all items it isnt so good. I would like to use it with mana restore.

Maiku
02-03-2012, 06:43 PM
YOU ROCK!!!!! YOU'RE AWESOME!!!!!

Keep up the good work.

:D
Later
Maiku

DarkstaR
02-03-2012, 06:55 PM
It can do it however you want it too, just modify the script. The scripting system is implemented for innumerable possibilities and you are sitting here asking me to list them finitely. Anything you can normally do with items in containers, it will be able to do (with the exception of moving 10 from a stack of 50, etc. For now you can only move full stacks, partial is coming soon.)

Ryangiggs
02-03-2012, 06:56 PM
It can do it however you want it too, just modify the script. The scripting system is implemented for innumerable possibilities and you are sitting here asking me to list them finitely. Anything you can normally do with items in containers, it will be able to do (with the exception of moving 10 from a stack of 50, etc. For now you ca only move full stacks, partial is coming soon.)

can you send me one that takes out 200 smp from dp to dragon backpack?`:d

DarkstaR
02-03-2012, 07:02 PM
I have a bot to develop. I don't have time to make scripts for people. (Which, by the way, would only need to change 1 line and 2 values)
If you're not capable or not willing, have a scripter make it for you. :P

Ryangiggs
02-03-2012, 07:03 PM
I have a bot to develop. I don't have time to make scripts for people. (Which, by the way, would only need to change 1 line and 2 values)
If you're not capable or not willing, have a scripter make it for you. :P

haha ty anyways, but if its so easy you could of do it by now :d

Brenno
02-03-2012, 07:10 PM
Thanks for the update, really awesome :D

Xongiver
02-03-2012, 07:15 PM
tbh, I cant even get this bot to open depot,

Self.UseItemFromGround(Self.Position().x, Self.Position().y - 1, Self.Position().z)

tried open dp north of me, doesnt work

Self.UseItemFromGround(Self.Position().x - 1, Self.Position().y, Self.Position().z)

should open dp from left, doesnt work as well

DarkstaR
02-03-2012, 07:20 PM
Not sure what you're doing wrong cause it works perfect for me, lol

Syntax
02-03-2012, 07:23 PM
This is not the place to request scripts. The next person that requests a modified version of the script provided or any other script will receive an infraction.
Keep the discussion to the release and the mechanics of the bot.

Veritas
02-03-2012, 07:31 PM
darkstar, i just wanted to say i saw this bot being able to catch up to neobot, but i was thinking it would take around 6 months. then after moving here and seeing you didn't really respond or give answers about updates and what you were working on i thought it might take a little longer. however, this update completely surprised me. i am literally amazed at all the functions you added that fast, and the fact that so far they are working flawlessly for me on 4 knights, 1 druid, and 3 paladins. i just wanted to say good job, and congratulations on replacing neo as the top bot.

Paush
02-03-2012, 07:43 PM
Great job master <3

ChaoticJello
02-03-2012, 07:52 PM
Awesome major props

Sharri
02-03-2012, 08:48 PM
22:47 You lose 25 hitpoints.

Energy damage makes the bot play "player attack" while its activated

rogens
02-03-2012, 09:30 PM
To be honest, (not to be rude or anything) i dont think it catch up to neobot yet.. theres still some things it need and i still think its a bit hard to use when your not into making those scripts.. i cant even get it to load the code's ppl add to their scripts.. Neo was alot easier to use with the Action label in the walker section,

But thats just my opinnion..

maly
02-03-2012, 10:29 PM
At the beginning neobot users were complaining that elfbot was better. Give it some time. You will get used to it. Darkstar will eventually add most of the neobot features.

curry
02-03-2012, 10:48 PM
man i almost want to marry you! :)

Exponent
02-03-2012, 10:51 PM
This is very nice, good job. :)

Heardy
02-04-2012, 01:18 AM
How are we supposed to reach the locker? :(

Supadupa
02-04-2012, 01:43 AM
Did you add skip nearby node function yet? If not, is it coming anytime near future? It's quite necessary for safe botting.

Luls
02-04-2012, 02:30 AM
Wow. I knew an update was coming soon, but all the new features are a huge surprise. I was expecting alarms and a few bug fixes. Good work, man ^_^

DPK
02-04-2012, 03:07 AM
If The alarms can detect if disconnected does that mean that there is a possible way for the scripter to detect and relog in? (expecting no, but wasnt sure so ill ask anyway)

botserone
02-04-2012, 03:26 AM
FUUUUUUUUCCCKKKK YEEEEEEEAAAAAAAAHHHHH

Darkhaos
02-04-2012, 03:27 AM
function openDepot(myPosition, direction)

local depotPos = {x = Self.Position().x, y = Self.Position().y, z = Self.Position().z}
if direction:lower() == "north" then
depotPos.y = depotPos.y - 1
elseif direction:lower() == "south" then
depotPos.y = depotPos.y + 1
elseif direction:lower() == "east" then
depotPos.x = depotPos.x + 1
elseif direction:lower() == "west" then
depotPos.x = depotPos.x - 1
end

Self.UseItemFromGround(depotPos.x, depotPos.y, depotPos.z)
return true
end

function moveItemToDepot(backpackName, itemID, count) --moveItemToDepot(backpackName, itemID [, count])

local locker = Container.GetByName("Locker")

if (locker:isOpen() == false) then
--handle the error~
else

locker:UseItem(0) --open the Depot Chest (first item in the container)
wait(1500) --Wait for 1.5 seconds

local depot = Container.GetByName("Depot Chest")
if (depot:isOpen() == false) then
--handle the error~
else
local backpack = Container.GetByName(backpackName) --should be open by the user, our ammo backpack
if (backpack:isOpen() == false) then
--handle the error
else
while (depot:CountItemsOfID(itemID) > (count or 0)) do
for spot = 0, depot:ItemCount() do
local item = depot:GetItemData(spot)
if (item.id == itemID) then --assassin stars
depot:MoveItemToContainer(spot, backpack:Index(), 0)
wait(500, 1500)
break
end
end
end
end
end
end
end

I made this, but didn't tested... it's working?

HolmaN
02-04-2012, 07:34 AM
Thanks Nick. :)

Glidarn
02-04-2012, 10:18 AM
But you can still not refill right? I mean if you bot like cemetery -1and then go the depot to collect more power bolts, does it then work to grab strong manas at the same time?

HolmaN
02-04-2012, 10:58 AM
It can for the moment grab from dp, unable to do sO from the npc tho.

Sor Jack
02-04-2012, 11:01 AM
22:47 You lose 25 hitpoints.

Energy damage makes the bot play "player attack" while its activated
Same to me. Lose 1 hitpoint by poison and the alarm gets crazy.

Awesome update! Now I have to learn how make scripts with refillers and make it myself not depending of the goodness of the others ;]

Great job, DarkstaR! Better, EXCELLENT job!

Mac
02-04-2012, 12:25 PM
nice job, though you could give some more infos about the methods, what do they give as result and so on, simple usage would be nice aswell

Wizzard
02-04-2012, 12:38 PM
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa owwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwww yeaaaaaaaaaaaaaaaaaa

Lanibox
02-04-2012, 12:48 PM
Doest somebody have same problem as I do? Im trying to use that Assy refiller script, but nothing happens. I have set label "AtDepot" when im standing at dp and it doesnt even open dp..

DarkstaR
02-04-2012, 12:49 PM
nice job, though you could give some more infos about the methods, what do they give as result and so on, simple usage would be nice aswell

Methods either return the obvious or nothing at all. (E.G. Container:ItemCount() isn't going to return your characters heart rate)
I detailed usage as much as I care to with the example scripts. While I understand people would like it, I really don't have much time, sorry :P

Tala
02-04-2012, 02:04 PM
<3333

DarkstaR
02-04-2012, 02:47 PM
OHHAI (http://forums.xenobot.net/showthread.php?1507)

kimper
02-05-2012, 07:28 AM
Think theres an error in the UseItem() function tbh

KieR
02-05-2012, 11:03 AM
Finally :D

Yemoz
02-05-2012, 03:40 PM
Great update! :)

ShadyTim
02-07-2012, 12:19 PM
Damn, Great work man! Keep it comming :D

ShadyTim
02-07-2012, 12:22 PM
Is it my problem or is it not possible to change the low health percent?

Junnior
02-07-2012, 03:28 PM
great update man : ) keep it up xD

YesIBot
02-07-2012, 05:20 PM
I don't know why this happens. When I set up my alarms and an "event" that I selected is met my client crashes. For example, when I select a character detected and I meet a character it crashes instead of producing an alarm. Im using windows 7

Mitch
02-08-2012, 09:44 AM
The alarms are not working for me. And no its not to do with the sound my end - volume is left as it always is, loud.
Any reasons why the alarms wouldnt be working? Yes they are turned on -.-

wooster
02-10-2012, 12:52 PM
So, can anyone tell me if it's possible to move items from backpack to any container, like chest on the ground? If so, it would be awesome...

Rozkurvitov
05-07-2012, 02:42 PM
well done

sirmate
05-07-2012, 03:07 PM
... NVM ...

Neum
05-18-2012, 06:31 PM
This update fixes many bugs and adds many features. Among the new functionality you will find is an Alarm system and a system to refill your ammunition for you. Furthermore, the Scripter now exports functionality for making scripts that can deposit looted items to depot and restock potions and other supplies strait from depot or any other containers where you store such supplies. Lastly, you can now see information about your equipment, inventory and use/move items as you please.


DropItems.lua - Drops all Gold to the floor

function dropItem(id)
local cont = Container.GetFirst()

while (cont:isOpen()) do
for spot = 0, cont:ItemCount() do
local item = cont:GetItemData(spot)
if (item.id == id) then
cont:MoveItemToGround(spot, Self.Position().x, Self.Position().y, Self.Position().z)
return true
end
end

cont = cont:GetNext()
end

return false
end


while (true) do
dropItem(3031)
wait(700, 1200)
end



Ok everythings going ok till i need to take my items back for go depot, is there any funtion to take items from ground?? I'm hunting for about 8 hours and i dont know how to take all items easy, please help!! i need something like container.GetFromFloor(lootid, lootid , indexbp) :P thanks a lot

Luls
05-18-2012, 07:11 PM
This thread is from Feburary. If you want help with a script, post in the script section of the forum.

thorekz
06-25-2012, 04:53 PM
Can this function Container:MoveItemToContainer(spotFrom, containerTo, spotTo)
moves items from ground to backpack?

jorge23
07-03-2012, 05:48 PM
and use lua functions?

jorge23
07-03-2012, 05:49 PM
and use lua functions?

NNiklaSS
09-26-2012, 06:34 PM
Hello! Does it works to add like "setPlayerOnScreenEnabled(enabled) / (false) ?
When my bot run to town for refill I want the bot to put alarm off and when its back at spawn will it put it on again.

NNiklaSS~

Crystaline
09-26-2012, 06:59 PM
Hello! Does it works to add like "setPlayerOnScreenEnabled(enabled) / (false) ?
When my bot run to town for refill I want the bot to put alarm off and when its back at spawn will it put it on again.

NNiklaSS~

Congratulations, you just bumped a 2 month old thread ^^

DarkstaR
09-26-2012, 07:01 PM
Congratulations, you just bumped a 2 month old thread ^^

Actually, it's 7 months old.