PDA

View Full Version : [Update] XenoBot Apophis v14.11.19.947 [HUGE SCRIPTER UPDATE]



DarkstaR
07-25-2015, 06:11 AM
This update fixes a few bugs that have surfaced recently, improves many exists features, and adds dozens of new functions to the Scripter. A Majority of the Scripter related work is thanks to Rydan.

Changelog:

v14.11.19.947
Fixed a bug that caused Reconnect not to work.
Fixed a bug that caused Walker.IsLuring to return false when walking.
Fixed many Scripter bugs relating to creature skulls and creature party status.
Added Creature:isGuildmate() to the scripter
Functionality:
Returns true if the creature object is a guildmate
Added Creature:isInAGuild() to the scripter
Functionality:
Returns true if the creature object is in a guild
Improved Self.UseLever() to wait a random amount of time.
Improved Self.Turn() to support lowercase/uppercase typing errors.
Improved Self.Step() to support lowercase/uppercase typing errors.
Improved Self.CutGrass() to support all kinds of cutting weapons and plants.
Improved Self.UsePick() to support opening holes.
Functionality:
Uses a pick or multi-tool on a specific position
Parameters:
x: x coordinate in the map on the x-axis
y: y coordinate in the map on the y-axis
z: z coordinate in the map on the z-axis
openhole (optional): boolean true or false
Return:
True if success, false otherwise
Notes:
Will fail if the container containing the item to use is not open
Improved Self.WithdrawItems() to work as intended.
Improved Self.Equip() to return false if failed.
Improved Self.OpenLocker() to work even if not facing the depot to open.
Added documentation to all functions that were missing it.
Added WEAPON_IDS to Scripter global variables
Added Creature:DistanceFromPosition() to the Scripter.
Functionality:
Returns the creature object's distance from a position
Parameters:
x: x coordinate in the map on the x-axis
y: y coordinate in the map on the y-axis
z: z coordinate in the map on the z-axis
Return:
The creature object's distance from position
Added Creature:isLocation() to the Scripter.
Functionality:
Returns whether the creature object is located at position within range or not
Parameters:
x: x coordinate in the map on the x-axis
y: y coordinate in the map on the y-axis
z: z coordinate in the map on the z-axis
range (optional): the range around position to consider
Return:
True if located at position, false otherwise
Added Creature:LookPosition() to the Scripter.
Functionality:
Returns the position coordinates from the creature object's look direction and range
Parameters:
range (optional): the range around the creature object's position to be considered
Return:
Table x, y, z coordinates of the creature object's look direction and range
Added Container:CountStackableSlotsOfID() to the Scripter.
Functionality:
Returns the amount of free slots of a stackable item in the container object
Parameters:
id: the itemid to check slots for
Return:
The amount of free slots of the stackable item
Added Item.hasID() to the Scripter.
Functionality:
Returns whether the bot can find an itemid for the given name or not
Parameters:
name: the name to check
Return:
True if found, false otherwise
Added Item.hasName() to the Scripter.
Functionality:
Returns whether the bot can find a name for the given itemid or not
Parameters:
id: the itemid to check
Return:
True if found, false otherwise
Added Item.hasValue() to the Scripter.
Functionality:
Returns whether the item has a value or not
Parameters:
item: the item's name or id
Return:
True if value > 0, false otherwise
Added Item.hasCost() to the Scripter.
Functionality:
Returns whether the item has a cost or not
Parameters:
item: the item's name or id
Return:
True if cost > 0, false otherwise
Added Item.hasWeight() to the Scripter.
Functionality:
Returns whether the item has a weight or not
Parameters:
item: the item's name or id
Return:
True if weight > 0, false otherwise
Added Map.IsTileOnScreen() to the Scripter.
Functionality:
Returns whether the given position in on screen or not
Parameters:
x: x coordinate in the map on the x-axis
y: y coordinate in the map on the y-axis
z: z coordinate in the map on the z-axis
Return:
True if on screen, false otherwise
Added Map.IsItemAtPosition() to the Scripter.
Functionality:
Returns whether the item is located at the given position or not
Parameters:
item: the item's name or id
x: x coordinate in the map on the x-axis
y: y coordinate in the map on the y-axis
z: z coordinate in the map on the z-axis
Return:
True if at position, false otherwise
Added Map.IsItemOnScreen() to the Scripter.
Functionality:
Returns whether the item can be found on the screen or not
Parameters:
item: the item's name or id
Return:
True if on screen, false otherwise
Added Map.GetItemPositions() to the Scripter.
Functionality:
Returns a table of positions the item could be found at
Parameters:
item: the item's name or id
Return:
A table of positions the item could be found at
Added Self.Dig() to the Scripter.
Functionality:
Uses a shovel or multi-tool on the given position
Parameters:
x: x coordinate in the map on the x-axis
y: y coordinate in the map on the y-axis
z: z coordinate in the map on the z-axis
openhole (optional): whether to open a hole or not
Return:
True if success, false otherwise
Added Self.UseSewerGate() to the Scripter.
Functionality:
Uses a sewergate from the given position
Parameters:
x: x coordinate in the map on the x-axis
y: y coordinate in the map on the y-axis
z: z coordinate in the map on the z-axis
Return:
True if success, false otherwise
Added Self.ShopSellItemsDownTo() to the Scripter.
Functionality:
Sells an item down to a specific amount
Parameters:
item: the item's name or id
amount: the amount to keep
Return:
1/0 for success/failre, amount failed to sell
Added Self.ShopSellFlasks() to the Scripter.
Functionality:
Sells all empty flasks
Parameters:
None
Return:
Nothing
Added Self.ShopBuyItemsUpToCap() to the Scripter.
Functionality:
Buys an item up to a specific amount of cap
Parameters:
item: the item's name or id
capacity: the capacity to stop at
Return:
Nothing
Added Self.MoveItemsUpTo() to the Scripter.
Functionality:
Moves an item to a container until a specific amount within that container is reached
Parameters:
item: the item's name or id
count: the amount to reach
to: the container to move to
from: the container to take from
Return:
True if success, false otherwise
Added Self.MoveItemsDownTo() to the Scripter.
Functionality:
Moves an item from a container until a specific amount within that container is reached
Parameters:
item: the item's name or id
count: the amount to reach
from: the container to take from
to: the container to move to
Return:
True if success, false otherwise
Added Self.Levitate() to the Scripter.
Functionality:
Levitates to a given level by moving or casting the levitate spell
Parameters:
dir: the direction to levitate to
level: the level to levitate to (either "up" or "down")
tries (optional): how often levitating should be tried before aborting
move (optional): whether to try to step or not
Return:
True if success, false otherwise
Added Self.BreakWall() to the Scripter.
Functionality:
Breaks a wall on the given position
Parameters:
x: x coordinate in the map on the x-axis
y: y coordinate in the map on the y-axis
z: z coordinate in the map on the z-axis
Return:
True if success, false otherwise
Added Self.FoodCount() to the Scripter.
Functionality:
Returns the amount of food found in open containers
Parameters:
None
Return:
The amount of food found
Added Self.Travel() to the Scripter.
Functionality:
Searches for an NPC and tries to reach it to travel to a given destination
Parameters:
destination: the destination to travel to
usering (optional): whether to give buddel in svargrond a dwarven ring or not
Return:
True if success, false otherwise

Ben
07-25-2015, 06:19 AM
thanks DarkstaR and Rydan!!

Ryszard
07-25-2015, 06:46 AM
Great work!

Y2Quakepc2
07-25-2015, 06:57 AM
OH MY GOD

anoyn
07-25-2015, 07:51 AM
Nice!

Pidek098
07-25-2015, 09:56 AM
Thanks :rolleyes:

Stusse
07-25-2015, 11:04 AM
Great update for the people not used to scripting. Perhaps this will help new members in XenoBot.

Glad to see an update anyways, keep it coming. Cheers Darkstar & Rydan!
/Stusse

Dashie
07-25-2015, 11:30 AM
Great job :)

DarkstaR
07-25-2015, 11:32 AM
Great update for the people not used to scripting. Perhaps this will help new members in XenoBot.

Glad to see an update anyways, keep it coming. Cheers Darkstar & Rydan!
/Stusse

I've been thinking about adding a click-through UI to add simple actions to waypoints as pre-made one-liners. I think I'll do it soon, especially with all this shiny new shit.

sausting
07-25-2015, 11:47 AM
this means reconnect is working again? i may need to start something back up if this is the case..

shadowart
07-25-2015, 11:51 AM
I've been thinking about adding a click-through UI to add simple actions to waypoints as pre-made one-liners. I think I'll do it soon, especially with all this shiny new shit.
Could you also change the textbox that you write one-liners into so that you can copy/paste text into it? And maybe increase its size so that you more easily can write longer scripts into it? One-liners execute quicker than labels so you want to keep as much code as possible as one-liners for a smoother walker.

jikoe
07-25-2015, 11:53 AM
Could you also change the textbox that you write one-liners into so that you can copy/paste text into it? And maybe increase its size so that you more easily can write longer scripts into it? One-liners execute quicker than labels so you want to keep as much code as possible as one-liners for a smoother walker.

+100000 its soo annoying to make one-liners now because you cannot copy/paste!!

alpha90
07-25-2015, 04:37 PM
Thanks, Im glad to see something new :D

Gordo
07-25-2015, 08:26 PM
sweet, making izy one of the biggest "problems with xeno" :D

DarkstaR
07-27-2015, 09:13 AM
http://forums.xenobot.net/showthread.php?37261