Summary
Members | Descriptions |
---|---|
public Unit getUnit ( int type,String name,uint32_t mode,uint32_t nUnitId) |
Get a unit by type, name, mode and nUnitId. |
public Unit getUnit ( int type,uint32_t classId,uint32_t mode,uint32_t nUnitId) |
Get a unit by type, classId, mode and nUnitId. |
public object[] getPath (uint32_t Area,uint32_t srcX,uint32_t srcY,uint32_t dstX, int dstY,uint32_t reductionType,uint32_t Radius) |
Creates a path (walking or teleporting) from the source to the destination. |
public object[] getPath (uint32_t Area,uint32_t srcX,uint32_t srcY,uint32_t dstX, int dstY,uint32_t reductionType,uint32_t Radius,bool(*)(int32_t x, int32_t y) reject,bool(*)(object curPt, int i, object[] pts) reduce,int32_t(*)(int32_t x, int32_t y) mutate) |
Creates a path (walking or teleporting) from the source to the destination. |
public unsigned short getCollision (uint32_t nLevelId,int32_t nX,int32_t nY) |
Get the collision flags at a given point in a given area. |
public int getMercHP () |
Get the health points of the controlled unit's merc. |
public int getCursorType () |
Get the cursor type from p_D2CLIENT_RegularCursorType. |
public int getCursorType ( int nType) |
Get the cursor type from p_D2CLIENT_RegularCursorType if nType != 1, from p_D2CLIENT_ShopCursorType if nType == 1. |
public int getSkillByName (String skillName) |
Get skill ID by name. |
public String getSkillById ( int skillId) |
Get skill name by ID. |
public String getLocaleString (uint16_t localeId) |
Get the String in the current locale that corresponds to the given id. |
public int getTextSize (String string, int font,bool asObject) |
Get the width and height of the given text in the given font. |
public int getThreadPriority () |
Get the priority of the current thread. |
public bool getUIFlag ( int nUIId) |
Get whether or not a UI flag is set. |
public int getTradeInfo ( int nMode) |
Get the TradeFlag or RecentTradeId. |
public bool getWaypoint ( int nWaypointId) |
Get whether the controlled unit has the given waypoint. |
public D2BSScript getScript (bool currentScript) |
Get the current or first context. |
public D2BSScript getScript ( int threadId) |
Get a script by thread id. |
public D2BSScript getScript (String name) |
Get a script by filename. |
public D2BSScript getScript () |
Get the first script. |
public Room getRoom (uint32_t levelId) |
Get the first room in area given by level id. |
public Room getRoom (uint32_t levelId, int x, int y) |
Get the room that the given point is in from the given level id. |
public Room getRoom ( int x, int y) |
Get the room that the given point is in. |
public Room getRoom () |
Get the first room in the current area. |
public Party getParty () |
Get the first party. |
public Party getParty (String name) |
Get the party line for the player with the given name. |
public Party getParty (uint32_t playerId) |
Get the party line for the player with the given player id. |
public Party getParty ( Unit player) |
Get the party line that corresponds to the given unit. |
public PresetUnit getPresetUnit (uint32_t levelId, int nType, int nClassId) |
Get the first PresetUnit of the given type and class id. |
public PresetUnit getPresetUnits (uint32_t levelId, int nType, int nClassId) |
Get an array of PresetUnit s of the given type and class id. |
public Area getArea () |
Get the Area where the controlled unit currently resides. |
public Area getArea (int32_t nArea) |
Get the Area for area ID nArea. |
public String getBaseStat (String szTableName,int32_t nClassId,String szStatName) |
Get the base stat from the given table with the given class ID and stat name. |
public String getBaseStat (int32_t nBaseStat,int32_t nClassId,String szStatName) |
Get the base stat from the given table with the given class ID and stat name. |
public String getBaseStat (String szTableName,int32_t nClassId,int32_t nStat) |
Get the base stat from the given table with the given class ID and stat ID. |
public String getBaseStat (int32_t nBaseStat,int32_t nClassId,int32_t nStat) |
Get the base stat from the given table with the given class ID and stat ID. |
public Control getControl (int32_t nType,int32_t nX,int32_t nY,int32_t nXSize,int32_t nYSize) |
Get the control specified by type, location and size. |
public bool getPlayerFlag ( int nFirstUnitId, int nSecondUnitId, int nFlag) |
Get the relation between two units. |
public int getTickCount () |
Get the tick count. |
public Unit getInteractedNPC () |
Get the Unit that the controlled Unit is currently interacting with. |
public void print (...) |
Print the String representation of the arguments to the console. |
public void delay (uint32_t nDelay) |
Delay for nDelay milliseconds. |
public D2BSScript load (String file,...) |
Load file and create a thread with it's main function. |
public bool isIncluded (String file) |
Determine whether a file has been included yet or not. |
public bool include (String file) |
Include file from the scriptDir\libs directory. |
public void stop ( int stop) |
Conditionally stop current script. |
public void stop (bool stop) |
Conditionnaly stop current script. |
public int rand (int32_t low,int32_t high) |
Return a random number between low and high. |
public void copy (String txt) |
Copy txt to clipboard. |
public String paste () |
Get the text from the clipboard. |
public int sendCopyData (String windowClassName,String windowName,int32_t nModeId,String data) |
Send data to another window by means of the WM_COPYDATA message. |
public int sendCopyData (HWND hWnd,String dummy,int32_t nModeId,String data) |
Send data to another window by means of the WM_COPYDATA message. |
public String sendDDE (int32_t mode,String pszDDEServer,String pszTopic,String pszItem) |
Send data to a DDE server by means of DdeClientTransaction. |
public bool keystate ( int vKey) |
Get whether or not a key is pressed. |
public void addEventListener (String event,Function eventHandler) |
Add an event handler to the list of listeners for the given event. |
public void removeEventListener (String event,Function eventHandler) |
Removes a previously added event from the listener list. |
public void clearEvent (String event) |
Clear the event handler list for given event. |
public void clearAllEvents () |
Clear all event handlers (from all events). |
public bool js_strict () |
Get whether or not the JSOPTION_STRICT flag is set. |
public void js_strict (bool setStrictFlag) |
Set or clear the JSOPTION_STRICT flag. |
public String version () |
Get the D2BS version string. |
public void version ( int a) |
Print the D2BS version string. |
public void scriptBroadcast (...) |
Broadcast a message to all other scripts. |
public String sqlite_version () |
Get the sqlite version string (from sqlite3_version). |
public double sqlite_memusage () |
Return the sqlite memory usage. |
public Folder dopen (String name) |
Get the Folder object for the directory scriptPath\name. |
public void debugLog (...) |
Log the String representation of the arguments. |
public void showConsole () |
Show the console. |
public void hideConsole () |
Hide the console. |
public void login () |
Loads the default (either from config or copydata or DDE) profile from d2bs.ini and gets to the lobby (for battle.net chars) or into a game (for single player characters). |
public void login (String profile) |
Loads the profile from d2bs.ini and gets to the lobby (for battle.net chars) or into a game (for single player characters). |
public bool selectCharacter (String profile) |
Select the character from the given profile. |
public void createGame (String name,String pass,int32_t diff) |
Create a game with the given name and password in the given difficulty. |
public void joinGame (String name,String pass) |
Join a game with the given name and password. |
public void addProfile (String profile,String mode,String gateway,String username,String password,String charname, int spDifficulty) |
Create a profile with the given profile name, mode, gateway, username, password, character name and single player difficulty. |
public int getLocation () |
Get the current OOG location. |
public void loadMpq (String path) |
Load an mpq file. |
public bool submitItem () |
Submit the item on the cursor to the open screen (like the add sockets screen). |
public int getMouseCoords (bool nFlag,bool nReturn) |
Get the mouse coordinates (in screen or map space) and return as an array. |
public Unit copyUnit ( Unit other) |
Copy the cached data associated with given unit. |
public bool clickMap (uint16_t nClickType,uint16_t nShift, Unit toClick) |
Click on the map with the given click type and possibly shift at the given unit. |
public bool clickMap (uint16_t nClickType,bool nShift, Unit toClick) |
Click on the map with the given click type and possibly shift at the given unit. |
public bool clickMap (uint16_t nClickType,uint16_t nShift,uint16_t nX,uint16_t nY) |
Click on the map with the given click type and possibly shift at the given point. |
public bool clickMap (uint16_t nClickType,bool nShift,uint16_t nX,uint16_t nY) |
Click on the map with the given click type and possibly shift at the given point. |
public bool acceptTrade ( int action) |
Get or do something to do with accepting trade. |
public bool acceptTrade () |
Accept a trade if not already accepted, cancel a trade if already accepted. |
public void tradeOk () |
Hit the OK button to open the trade window. |
public object[] getDialogLines () |
Get the lines of dialog of whatever you're talking to. |
public void beep ( int nBeepId) |
Beep with beep ID nBeepId. |
public void clickItem ( Unit item) |
Click an item. |
public void clickItem ( int nClickType, int nBodyLoc) |
Click on a body location with a certain click type. |
public void clickItem ( int nClickType, Unit item) |
Click on a given item with the given click type. |
public void clickItem ( int nClickType, int nX, int nY, int nLoc) |
Click an item location with the given click type. |
public double getDistance ( Unit a) |
Get the euclidean distance from me to a. |
public double getDistance ( Unit a, Unit b) |
Get the euclidean distance from a to b. |
public double getDistance ( Unit a,int32_t bx,int32_t by) |
Get the euclidean distance from a to b. |
public double getDistance (int32_t ax,int32_t ay) |
Get the euclidean distance from me to a. |
public double getDistance (int32_t ax,int32_t ay, Unit b) |
Get the euclidean distance from a to b. |
public double getDistance (int32_t ax,int32_t ay,int32_t bx,int32_t by) |
Get the euclidean distance from a to b. |
public void gold ( int nGold, int nMode) |
Do something with some gold. |
public int checkCollision ( Unit a, Unit b, int nBitMask) |
Check if two units collide. |
public bool playSound ( int nSoundId) |
Play d2 sound by id. |
public void quit () |
Quit the game. |
public void quitGame () |
Quit Diablo II. |
public bool say (...) |
Say the string equivalent of the each of the arguments. |
public bool clickParty ( Party player, int nMode) |
Click one of the buttons in the party screen for the given player. |
public int weaponSwitch (int32_t dummy) |
Get which weapon switch is being used. |
public void transmute () |
Hit the transmute button. |
public void useStatPoint (uint16_t statType,uint32_t count) |
Use a stat point. |
public void useSkillPoint (uint16_t skill,uint32_t count) |
Use a skill point. |
public void takeScreenshot () |
Take a screenshot. |
public bool moveNPC ( Unit npc,uint32_t x,uint32_t y) |
Move NPC to a new location. |
public bool getPacket (...) |
Send a packet to the client. |
public bool sendPacket (...) |
Send a packet to the server. |
public String getIP () |
Get the external IP by going to "http://automation.whatismyip.com/n09230945.asp" and parsing the result. |
public Object screenToAutomap (Object arg) |
Convert a point from screen coordinates to automap coordinates. |
public Object screenToAutomap ( int ix, int iy) |
Convert a point from screen coordinates to automap coordinates. |
public Object automapToScreen (Object arg) |
Convert a point from automap coordinates to screen coordinates. |
public Object automapToScreen ( int ix, int iy) |
Convert a point from automap coordinates to screen coordinates. |
public String md5 (String str) |
Takes the md5 hash. |
public String sha1 (String str) |
Takes the sha1 hash. |
public String sha256 (String str) |
Takes the sha256 hash. |
public String sha384 (String str) |
Takes the sha384 hash. |
public String sha512 (String str) |
Takes the sha512 hash. |
public String md5_file (String file) |
Take the md5 hash of a file. |
public String sha1_file (String file) |
Take the sha1 hash of a file. |
public String sha256_file (String file) |
Take the sha256 hash of a file. |
public String sha384_file (String file) |
Take the sha384 hash of a file. |
public String sha512_file (String file) |
Take the sha512 hash of a file. |
namespace ProfileType |
ProfileType enum. |
class Area |
Represent an Area of the map. |
class Box |
A Box screen hook. |
class Control |
This class represents out of game (OOG) Control s. |
class D2BSScript |
Represents a script (a thread), created by either loading a file, or typing something in the console. |
class DBStatement |
A class describing ... |
class Exit |
Represents a method of getting from one Area to another. |
class File |
This class handles the opening, reading and writing of files. |
class FileTools |
A collection of tools to do things like move files and determine whether files exist. |
class Folder |
Represents a folder. |
class Frame |
This class represents a screen hook for a Frame. |
class Image |
This class represents a screen hook for a Image. |
class Line |
A 2d line. |
class Me |
The class that represents the controlled unit. |
class Party |
Represents the items in the list in the Party screen. |
class PresetUnit |
Represents a PresetUnit (a type of Unit that is available as soon as the Area data is available). |
class Profile |
This class represents the details needed to get a player to a game or lobby. |
class Room |
Represents a "Room" in the game. |
class Sandbox |
A separate context to run scripts in. |
class SQLite |
Class for dealing with an SQLite database. |
class Text |
A Text screen hook. |
class Unit |
This class represents a unit (monster, wp, npc, character, etc) in the game. |
Members
public
Unit
getUnit
(
int
type,String name,uint32_t mode,uint32_t nUnitId)
Get a unit by type, name, mode and nUnitId.
Parameters
-
type
The type of the unit. Set to -1 to get any unit. 100 gets the cursor item, 101 gets the selected unit. -
name
The name of the unit to look for. -
mode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for. -
nUnitId
The unique id of the unit.
Returns
The first unit found that matches the description.
public
Unit
getUnit
(
int
type,uint32_t classId,uint32_t mode,uint32_t nUnitId)
Get a unit by type, classId, mode and nUnitId.
Parameters
-
type
The type of the unit. Set to -1 to get any unit. 100 gets the cursor item, 101 gets the selected unit. -
classId
The class id of the unit. -
mode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for. -
nUnitId
The unique id of the unit.
Returns
The first unit found that matches the description.
public object[]
getPath
(uint32_t Area,uint32_t srcX,uint32_t srcY,uint32_t dstX,
int
dstY,uint32_t reductionType,uint32_t Radius)
Creates a path (walking or teleporting) from the source to the destination.
Returns an array of points that form a path from the source to the destination. Takes Area ID(s), source and destination points, walking or teleporting and range as parameters.
Parameters
-
[Area](#classArea)
The Area ID to path through. -
srcX
The source X coordinate. -
srcY
The source Y coordinate. -
dstX
The destination X coordinate. -
dstY
The destination Y coordinate. -
reductionType
The type of reduction: {0 - walking, 1 - teleport, 2 - none} -
Radius
The distance between each point.
Returns
The path as an array of objects with x and y properties.
public object[]
getPath
(uint32_t Area,uint32_t srcX,uint32_t srcY,uint32_t dstX,
int
dstY,uint32_t reductionType,uint32_t Radius,bool(*)(int32_t x, int32_t y) reject,bool(*)(object curPt,
int
i, object[] pts) reduce,int32_t(*)(int32_t x, int32_t y) mutate)
Creates a path (walking or teleporting) from the source to the destination.
Returns an array of points that form a path from the source to the destination. Takes Area ID, source and destination points, walking or teleporting, range and reduction or not as parameters.
Parameters
-
[Area](#classArea)
The Area ID to path through. -
srcX
The source X coordinate. -
srcY
The source Y coordinate. -
dstX
The destination X coordinate. -
dstY
The destination Y coordinate. -
reductionType
The type of reduction: {0 - walking, 1 - teleport, 2 - none, 3 - user specified} -
Radius
The distance between each point. -
reject
Called on start and end to determine if point is valid. -
reduce
Function to determine whether to keep point. Returns true if point should be kept, false if point should be eliminated. -
mutate
Called on the start/end if it isn't/is rejected respectively. This is done before path generation.
Returns
The path as an array of objects with x and y properties.
public unsigned short
getCollision
(uint32_t nLevelId,int32_t nX,int32_t nY)
Get the collision flags at a given point in a given area.
Parameters
-
nLevelId
The level id of the area in question. -
nX
The x coordinate of the point in question. -
nY
The y coordinate of the point in question.
Returns
The collision flags. For details see: http://forums.d2botnet.org/viewtopic.php?f=18&t=1212 .
public
int
getMercHP
()
Get the health points of the controlled unit's merc.
Returns
The health points.
public
int
getCursorType
()
Get the cursor type from p_D2CLIENT_RegularCursorType.
Todo: Determine what the return value means.
Returns
The regular cursor type.
public
int
getCursorType
(
int
nType)
Get the cursor type from p_D2CLIENT_RegularCursorType if nType != 1, from p_D2CLIENT_ShopCursorType if nType == 1.
Parameters
nType
What type of cursor to get. 1 - ShopCursorType, other - RegularCursorType.
Todo: Determine what the return value means.
Returns
The cursor type.
public
int
getSkillByName
(String skillName)
Get skill ID by name.
Parameters
skillName
The skill name.
Returns
The skill ID.
public String
getSkillById
(
int
skillId)
Get skill name by ID.
Parameters
skillId
The skill ID.
Returns
The skill name.
public String
getLocaleString
(uint16_t localeId)
Get the String in the current locale that corresponds to the given id.
Parameters
localeId
The id of the String.
Returns
The String in the current locale.
public
int
getTextSize
(String string,
int
font,bool asObject)
Get the width and height of the given text in the given font.
Parameters
-
string
The string to get the size of. -
font
The font to use. -
asObject
False to return as an array.
Returns
The width and height of the text. 0 - width, 1 - height.
Parameters
-
string
The string to get the size of. -
font
The font to use. -
asObject
True to return as an object.
Returns
The width and height of the text. Has properties .width and .height.
public
int
getThreadPriority
()
Get the priority of the current thread.
Returns
The priority.
public bool
getUIFlag
(
int
nUIId)
Get whether or not a UI flag is set.
Todo: Get a reference for the UI IDs.
Parameters
nUIId
The ID of the UI in question.
Returns
Whether or not the flag is set.
public
int
getTradeInfo
(
int
nMode)
Get the TradeFlag or RecentTradeId.
Get the RecentTradeName.
Todo: Determine what this means.
Parameters
nMode
What to return. 0 - TradeFlag, 2 - RecentTradeId.
Returns
The TradeFlag or RecentTradeId.
Currently broken, returns null.
Todo: Determine what these are.
Parameters
nMode
What to return. 1 - RecentTradeName.
Returns
The RecentTradeName.
public bool
getWaypoint
(
int
nWaypointId)
Get whether the controlled unit has the given waypoint.
Parameters
nWaypointId
The area id of the waypoint in question.
Returns
Whether or not the controlled unit has the waypoint.
public
D2BSScript
getScript
(bool currentScript)
Get the current or first context.
Parameters
currentScript
Whether to get the current script (true) or the first (false).
Returns
A D2BSScript object for the request script.
public
D2BSScript
getScript
(
int
threadId)
Get a script by thread id.
Parameters
threadId
The thread id of the script to get.
Returns
A D2BSScript object for the script from the given thread.
public
D2BSScript
getScript
(String name)
Get a script by filename.
Parameters
name
The filename of the script to find.
Returns
A D2BSScript object for the script.
public
D2BSScript
getScript
()
Get the first script.
Returns
A D2BSScript representing the first script in the runtime.
public
Room
getRoom
(uint32_t levelId)
Get the first room in area given by level id.
Parameters
levelId
The id of the area to get the room from, or 0 to get the room the controlled unit is in.
Returns
The first room in the area.
public
Room
getRoom
(uint32_t levelId,
int
x,
int
y)
Get the room that the given point is in from the given level id.
Parameters
-
levelId
The level id to look in. -
x
The x coordinate to find a room for. -
y
The y coordinate to find a room for.
Returns
The room at the given point.
public
Room
getRoom
(
int
x,
int
y)
Get the room that the given point is in.
Parameters
-
x
The x coordinate to find a room for. -
y
The y coordinate to find a room for.
Returns
The room at the given point.
public
Room
getRoom
()
Get the first room in the current area.
Returns
The first room in the current area.
public
Party
getParty
()
Get the first party.
Returns
The first party.
public
Party
getParty
(String name)
Get the party line for the player with the given name.
Parameters
name
The name of the player to search for
Returns
The party line
public
Party
getParty
(uint32_t playerId)
Get the party line for the player with the given player id.
Parameters
playerId
Returns
The party line
public
Party
getParty
(
Unit
player)
Get the party line that corresponds to the given unit.
Parameters
player
Unit
Returns
The party line
public
PresetUnit
getPresetUnit
(uint32_t levelId,
int
nType,
int
nClassId)
Get the first PresetUnit of the given type and class id.
Parameters
-
levelId
The area id of the level to look for a PresetUnit in. -
nType
The type of the PresetUnit. See getUnit for type codes. -
nClassId
The class id to find. See: http://forums.d2botnet.org/viewtopic.php?f=18&t=986 and http://forums.d2botnet.org/viewtopic.php?f=18&t=985 .
Returns
The first PresetUnit found of type nType and class ID nClassId.
public
PresetUnit
getPresetUnits
(uint32_t levelId,
int
nType,
int
nClassId)
Get an array of PresetUnit s of the given type and class id.
Parameters
-
levelId
The area id of the level to look for PresetUnit s in. -
nType
The type of the PresetUnit. See getUnit for type codes. -
nClassId
The class id to find. See: http://forums.d2botnet.org/viewtopic.php?f=18&t=986 and http://forums.d2botnet.org/viewtopic.php?f=18&t=985 .
Returns
An array of PresetUnit s found of type nType and class ID nClassId.
public
Area
getArea
()
Get the Area where the controlled unit currently resides.
Returns
An Area object for the current object.
public
Area
getArea
(int32_t nArea)
Get the Area for area ID nArea.
Parameters
nArea
The area ID.
Returns
An Area object.
public String
getBaseStat
(String szTableName,int32_t nClassId,String szStatName)
Get the base stat from the given table with the given class ID and stat name.
Parameters
-
szTableName
The name of the table to look in. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
szTableName
The name of the table to look in. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
szTableName
The name of the table to look in. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
szTableName
The name of the table to look in. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
Returns
The stat.
public String
getBaseStat
(int32_t nBaseStat,int32_t nClassId,String szStatName)
Get the base stat from the given table with the given class ID and stat name.
Parameters
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
Returns
The stat.
public String
getBaseStat
(String szTableName,int32_t nClassId,int32_t nStat)
Get the base stat from the given table with the given class ID and stat ID.
Parameters
-
szTableName
The name of the table to look in. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
szTableName
The name of the table to look in. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
szTableName
The name of the table to look in. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
szTableName
The name of the table to look in. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
Returns
The stat.
public String
getBaseStat
(int32_t nBaseStat,int32_t nClassId,int32_t nStat)
Get the base stat from the given table with the given class ID and stat ID.
Parameters
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
Returns
The stat.
Parameters
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
Returns
The stat.
public
Control
getControl
(int32_t nType,int32_t nX,int32_t nY,int32_t nXSize,int32_t nYSize)
Get the control specified by type, location and size.
-1 indicates parameter not to be matched against.
Parameters
-
nType
The type of control (button, text box, etc.) -
nX
The x coordinate of the control of the control to find. -
nY
The y coordinate of the control of the control to find. -
nXSize
The width of the control. -
nYSize
The height of the control.
Todo: Get a reference for nType
Returns
A Control object representing the Control found.
public bool
getPlayerFlag
(
int
nFirstUnitId,
int
nSecondUnitId,
int
nFlag)
Get the relation between two units.
Parameters
-
nFirstUnitId
The unit id for the unit making the relationship. -
nSecondUnitId
The unit id for the unit receiving the relationship. -
nFlag
The relationship.
Todo: Determine what the flags are.
Todo: Should this return bool instead of int? (i.e. change the d2bs code).
Returns
Whether or not the relationship is of the type specified.
public
int
getTickCount
()
Get the tick count.
Returns GetTickCount().
Returns
The tick count.
public
Unit
getInteractedNPC
()
Get the Unit that the controlled Unit is currently interacting with.
Returns
The Unit currently being interacted with.
public void
print
(...)
Print the String representation of the arguments to the console.
public void
delay
(uint32_t nDelay)
Delay for nDelay milliseconds.
This is done by suspending the context, sleeping, then resuming the context for short (<50 ms) delays. For longer delays the context is suspended, 50ms are slept away, the context is resumed, sequence repeats until time slept is greater then nDelay ms.
Parameters
nDelay
Milliseconds to sleep.
public
D2BSScript
load
(String file,...)
Load file and create a thread with it's main function.
File taken from scriptDir\file. All remaining parameters are passed to the script.
Parameters
file
The filename of the script.
Returns
If successful returns the new script object representing the thread of the thread. Otherwise it returns null.
public bool
isIncluded
(String file)
Determine whether a file has been included yet or not.
File taken from scriptDir\libs\file
Parameters
file
Filename of the file that might have been included.
Returns
Whether or not the file has been included.
public bool
include
(String file)
Include file from the scriptDir\libs directory.
Parameters
file
Filename of the file to include.
Returns
Whether the inclusion was successful.
public void
stop
(
int
stop)
Conditionally stop current script.
Parameters
stop
1 if current script should be stopped.
public void
stop
(bool stop)
Conditionnaly stop current script.
Parameters
stop
True if current script should be stopped.
public
int
rand
(int32_t low,int32_t high)
Return a random number between low and high.
Uses C rand() when out of game, and D2GAME_D2Rand with the game seed while in game.
Parameters
-
low
The lowest possible integer to return. -
high
The highest possible integer to return.
Returns
A random integer in the range [low,high].
public void
copy
(String txt)
Copy txt to clipboard.
Parameters
txt
Text to copy to the clipboard.
public String
paste
()
Get the text from the clipboard.
Returns
The text from the clipboard.
public
int
sendCopyData
(String windowClassName,String windowName,int32_t nModeId,String data)
Send data to another window by means of the WM_COPYDATA message.
Uses FindWindow to get the HWND and SendMessage to send the message.
Parameters
-
windowClassName
The class name of the receiving window. -
windowName
The window name of the receiving window. -
nModeId
Data to be sent as the dwData member of the copy data. -
data
Data to be send as the lpData member of the copy data.
Returns
The result of SendMessage.
public
int
sendCopyData
(HWND hWnd,String dummy,int32_t nModeId,String data)
Send data to another window by means of the WM_COPYDATA message.
Uses SendMessage to send the message to hWnd.
Parameters
-
hWnd
The handle to the receiving window. -
dummy
Ignored. -
nModeId
Data to be sent as the dwData member of the copy data. -
data
Data to be send as the lpData member of the copy data.
Returns
The result of SendMessage.
public String
sendDDE
(int32_t mode,String pszDDEServer,String pszTopic,String pszItem)
Send data to a DDE server by means of DdeClientTransaction.
Parameters
mode
The mode of transaction to use.
0 - Do command given by pszItem with an XTYP_REQUEST and get the resulting data.
1 - Do command given by pszItem with an XTYP_POKE sending ""
2 - Do command with an XTYP_EXECUTE sending ""
Parameters
-
pszDDEServer
The service name of the DDE server to connect to. -
pszTopic
The topic with which to start the connection. -
pszItem
Data to be sent.
Returns
Result data if mode was 0.
public bool
keystate
(
int
vKey)
Get whether or not a key is pressed.
Returns the value of GetAsyncKeyState.
Parameters
vKey
The virtual key code for the key in question. See: http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx
Returns
Whether not the key is pressed.
public void
addEventListener
(String event,Function eventHandler)
Add an event handler to the list of listeners for the given event.
Parameters
event
The name of the event. Can be:
melife (uint32_t dwLife)
memana (uint32_t dwMana)
keyup (uint32_t key)
keydown (uint32_t key)
bool keyupblock (uint32_t key) - Returns true to block event from Diablo II
bool keydownblock (uint32_t key) - Returns true to block event from Diablo II
playerassign (uint32_t unitId)
mouseclick (uint32_t button, uint32_t x, uint32_t y, bool bUp)
mousemove (uint32_t x, uint32_t y)
scriptmsg (...)
golddrop (uint32_t gId, uint32_t Mode)
chatmsg (String lpszNick, String lpszMsg)
bool chatmsgblocker (String lpszNick, String lpszMsg) - Returns true to block event from Diablo II
whispermsg (String lpszNick, String lpszMsg)
bool whispermsgblocker (String lpszNick, String lpszMsg) - Returns true to block event from Diablo II
copydata (int32_t dwMode, String lpszMsg)
itemaction (uint32_t gId, uint32_t mode, String code, Bool global)
gameevent (BYTE mode, DWORD param1, DWORD param2, String name1, String name2)
From http://www.blizzhackers.cc/viewtopic.php?t=392307 Dark_Mage-
mode:
0x00 - "%Name1(%Name2) dropped due to time out." 0x01 - "%Name1(%Name2) dropped due to errors." 0x02 - "%Name1(%Name2) joined our world. Diablo's minions grow stronger." 0x03 - "%Name1(%Name2) left our world. Diablo's minions weaken." 0x04 - "%Name1 is not in the game." 0x05 - "%Name1 is not logged in."
0x06 - "%Name1 was Slain by %Name2" BYTE Param2 = Unit Type of Slayer (0x00 = Player, 0x01 = NPC) if Type = Player, Name2 = Slayer Character Name & DWORD Param1 = Slayer Character Type if Type = NPC, DWORD Param1 = Monster Id Code from MPQ (points to string for Name2) if Type = NPC & Monster is Unique, Name2 = Unique Monster Id
0x07 - Player Relations (Bottom Left Text) DWORD Param1 = Player Id Player Id = Pointer to Character Name BYTE Param2 = Action Taken Actions: 0x01 - "%Player permits you to loot his corpse." 0x02 - "%Player permits you to loot her corpse." 0x03 - "%Player has declared hostility towards you." 0x04 - "%Player is no longer hostile towards you." 0x05 - "%Player invites you to ally against the forces of evil." 0x06 - "%Player has canceled party invite." 0x07 - "%Player has joined your party to fight the forces of evil." 0x08 - "You are now allied with %Player." 0x09 - "%Player has left your party." 0x0a - "%Player no longer allows you to access his corpse." 0x0b - "%Player no longer allows you to access her corpse."
0x08 - "%Name1 is busy." 0x09 - "You must wait a short time to trade with that player."
0x0a - "%Name1 has items in his box." if Name1 = 0x00, "You have items in your box."
0x0b - 0x0c - 0x0d - "%Name1 is not listening to you." 0x0e - Received on 'Not enough mana' speech. 0x0f - "Realm going down in %Param1 minutes." 0x10 - "You must wait a short time to declare hostility with that player." 0x11 - "%Param1 Stones of Jordan Sold to Merchants" 0x12 - "Diablo Walks the Earth"
Parameters
eventHandler
A function with the signature listed above that handles the event.
public void
removeEventListener
(String event,Function eventHandler)
Removes a previously added event from the listener list.
Parameters
-
event
The event name (the one used to add the event). -
eventHandler
The handler to remove.
public void
clearEvent
(String event)
Clear the event handler list for given event.
Parameters
event
The name of the event to clear the handler list for.
public void
clearAllEvents
()
Clear all event handlers (from all events).
public bool
js_strict
()
Get whether or not the JSOPTION_STRICT flag is set.
Returns
Whether or not the strict flag is set.
public void
js_strict
(bool setStrictFlag)
Set or clear the JSOPTION_STRICT flag.
Parameters
setStrictFlag
The new JSOPTION_STRICT state.
public String
version
()
Get the D2BS version string.
Returns
The D2BS version string.
public void
version
(
int
a)
Print the D2BS version string.
public void
scriptBroadcast
(...)
Broadcast a message to all other scripts.
D2BS calls each scripts scriptmsg event listeners with the messages passed in.
public String
sqlite_version
()
Get the sqlite version string (from sqlite3_version).
Returns
The sqlite version string.
public double
sqlite_memusage
()
Return the sqlite memory usage.
public
Folder
dopen
(String name)
Get the Folder object for the directory scriptPath\name.
Parameters
name
The name of the Folder to open.
Returns
A Folder object representing the Folder name.
public void
debugLog
(...)
Log the String representation of the arguments.
public void
showConsole
()
Show the console.
public void
hideConsole
()
Hide the console.
public void
login
()
Loads the default (either from config or copydata or DDE) profile from d2bs.ini and gets to the lobby (for battle.net chars) or into a game (for single player characters).
Exceptions
String
May throw one of the following:
"invalid character name" - If it fails to select the character.
"Failed to click the Single button?" - If it fails to click the single player button.
"Failed to click the 'Battle.net' button?" - If it fails to click the battle.net button.
"Failed to click the 'Other Multiplayer' button?" - If it fails to click the Other Multiplayer button.
"Failed to click the 'Open Battle.net' button?" - If it fails to click the Open battle.net button.
"Failed to click the 'TCP/IP' button?" - If it fails to click the TCP/IP button.
"Failed to click the 'Host Game' button?" - If it fails to click the Host Game (TCP/IP) button.
"Failed to click the 'Join Game' button?" - If it fails to click the Join Game (TCP/IP) button.
"Failed to click the OK button" - If it fails to click the OK button (TCP/IP enter IP address).
"Failed to find the 'Host IP Address' text-edit box." - If it can't find the host IP address (TCP/IP) text box.
"Could not get the IP address from the profile in the d2bs.ini file." - If the user failed to specify the IP address in the d2bs.ini file.
"Failed to click the exit button?" - If it is login and fails to click the exit button.
"Failed to set the 'Username' text-edit box.' - If it can't find the username control.
"Failed to set the 'Password' text-edit box." - If it can't find the password control.
"Failed to click the 'Log in' button?" - If it can't click the login button.
"Failed to click the 'Normal Difficulty' button?" - If it can't click the normal button in single player game creation.
"Failed to click the 'Nightmare Difficulty' button?" - If it can't click the nightmare button in single player game creation.
"Failed to click the 'Hell Difficulty' button?" - If it can't click the hell button in single player game creation.
"Invalid single player difficulty level specified!" - If the difficulty level is invalid.
"Unable to connect" - If the unable to connect screen is shown.
"CD-Key in use" - If the cdkey in use screen is shown.
"Bad account or password" - If the username/password wrong screen is shown.
"Realm Down" - If the realm down message is shown.
"Unhandled login location" - If the game is in an unsupported location.
public void
login
(String profile)
Loads the profile from d2bs.ini and gets to the lobby (for battle.net chars) or into a game (for single player characters).
Parameters
profile
The profile to load.
Exceptions
String
May throw one of the following:
"invalid character name" - If it fails to select the character.
"Failed to click the Single button?" - If it fails to click the single player button.
"Failed to click the 'Battle.net' button?" - If it fails to click the battle.net button.
"Failed to click the 'Other Multiplayer' button?" - If it fails to click the Other Multiplayer button.
"Failed to click the 'Open Battle.net' button?" - If it fails to click the Open battle.net button.
"Failed to click the exit button?" - If it is login and fails to click the exit button.
"Failed to set the 'Username' text-edit box.' - If it can't find the username control.
"Failed to set the 'Password' text-edit box." - If it can't find the password control.
"Failed to click the 'Log in' button?" - If it can't click the login button.
"Failed to click the 'Normal Difficulty' button?" - If it can't click the normal button in single player game creation.
"Failed to click the 'Nightmare Difficulty' button?" - If it can't click the nightmare button in single player game creation.
"Failed to click the 'Hell Difficulty' button?" - If it can't click the hell button in single player game creation.
"Invalid single player difficulty level specified!" - If the difficulty level is invalid.
"Unable to connect" - If the unable to connect screen is shown.
"CD-Key in use" - If the cdkey in use screen is shown.
"Bad account or password" - If the username/password wrong screen is shown.
"Realm Down" - If the realm down message is shown.
"Unhandled login location" - If the game is in an unsupported location.
public bool
selectCharacter
(String profile)
Select the character from the given profile.
Keeps all details except the character name from old profile.
Parameters
profile
The profile to get the character name from.
Returns
Whether or not character swap was successful.
public void
createGame
(String name,String pass,int32_t diff)
Create a game with the given name and password in the given difficulty.
Parameters
-
name
The game name. -
pass
The game password. -
diff
The game difficulty. 0 - normal, 1 - nightmare, 2 - hell, 3 - hardest difficulty available.
public void
joinGame
(String name,String pass)
Join a game with the given name and password.
Parameters
-
name
The game name. -
pass
The game password.
public void
addProfile
(String profile,String mode,String gateway,String username,String password,String charname,
int
spDifficulty)
Create a profile with the given profile name, mode, gateway, username, password, character name and single player difficulty.
Parameters
-
profile
The profile name. -
mode
The mode (single player/battle.net/etc). -
gateway
The realm gateway. -
username
Account username. -
password
Account password. -
charname
Character name (case sensitive). -
spDifficulty
The difficulty to create games for a single player character.
public
int
getLocation
()
Get the current OOG location.
Todo: Create a reference for the return values.
Returns
The current OOG location.
public void
loadMpq
(String path)
Load an mpq file.
Parameters
path
The mpq file to load
public bool
submitItem
()
Submit the item on the cursor to the open screen (like the add sockets screen).
Returns
Whether or not it was successful.
public
int
getMouseCoords
(bool nFlag,bool nReturn)
Get the mouse coordinates (in screen or map space) and return as an array.
Get the mouse coordinates (in screen or map space) and return as an Object.
Parameters
-
nFlag
Whether to return in map space (true) or screen space (false). -
nReturn
Whether to return as an array or as an Object, false for array format.
Returns
The mouse coordinates in an array. 0 - x, 1 - y.
Parameters
-
nFlag
Whether to return in map space (true) or screen space (false). -
nReturn
Whether to return as an array or as an Object, true for Object format.
Returns
The mouse coordinates in an array. Has properties .x and .y.
public
Unit
copyUnit
(
Unit
other)
Copy the cached data associated with given unit.
This is things like type and unit id.
Todo: Figure out why anyone would want to copy a unit.
Returns
The new copy of the unit.
public bool
clickMap
(uint16_t nClickType,uint16_t nShift,
Unit
toClick)
Click on the map with the given click type and possibly shift at the given unit.
Parameters
-
nClickType
The click type to do. -
nShift
Whether or not to be holding down shift. 0 - Don't hold shift, 1 - hold shift. -
toClick
The unit to click on.
Todo: Get a reference for nClickType.
Returns
Whether or not the click was successful.
public bool
clickMap
(uint16_t nClickType,bool nShift,
Unit
toClick)
Click on the map with the given click type and possibly shift at the given unit.
Parameters
-
nClickType
The click type to do. -
nShift
Whether or not to be holding down shift. -
toClick
The unit to click on.
Todo: Get a reference for nClickType.
Returns
Whether or not the click was successful.
public bool
clickMap
(uint16_t nClickType,uint16_t nShift,uint16_t nX,uint16_t nY)
Click on the map with the given click type and possibly shift at the given point.
Parameters
-
nClickType
The click type to do. -
nShift
Whether or not to be holding down shift. 0 - Don't hold shift, 1 - hold shift. -
nX
The x coordinate to click at. -
nY
The y coordinate to click at.
Todo: Get a reference for nClickType.
Returns
Whether or not the click was successful.
public bool
clickMap
(uint16_t nClickType,bool nShift,uint16_t nX,uint16_t nY)
Click on the map with the given click type and possibly shift at the given point.
Parameters
-
nClickType
The click type to do. -
nShift
Whether or not to be holding down shift. -
nX
The x coordinate to click at. -
nY
The y coordinate to click at.
Todo: Get a reference for nClickType.
Returns
Whether or not the click was successful.
public bool
acceptTrade
(
int
action)
Get or do something to do with accepting trade.
Parameters
action
What action to perform.
1 - Get whether trade we've accepted trade already or not.
2 - Get the trade flag ...
3 - Get whether the check is red or not.
Returns
The flag specified by action.
public bool
acceptTrade
()
Accept a trade if not already accepted, cancel a trade if already accepted.
Todo: Verify that I understand this correctly.
Returns
Whether or not trade was accepted.
public void
tradeOk
()
Hit the OK button to open the trade window.
Throws an error if client not in a proper state to click ok.
public object[]
getDialogLines
()
Get the lines of dialog of whatever you're talking to.
Each object has a text property which gives the text and a selectable property which is a boolean as to whether you can click on that line or not.
Returns
An array of objects of the lines, or undefined if no dialog up.
public void
beep
(
int
nBeepId)
Beep with beep ID nBeepId.
Parameters
nBeepId
ID of the beep to make. See: http://msdn.microsoft.com/en-us/library/ms680356%28VS.85%29.aspx .
public void
clickItem
(
Unit
item)
Click an item.
Parameters
item
The item to click on.
public void
clickItem
(
int
nClickType,
int
nBodyLoc)
Click on a body location with a certain click type.
Parameters
-
nClickType
The click type. {0 - left click, 4 - left click merc body locations} -
nBodyLoc
The body location.
0 - Not equipped
1 - Helmet
2 - Amulet
3 - Armor
4 - Right hand slot 1
5 - Left hand slot 1
6 - Right ring
7 - Left ring
8 - Belt
9 - Boots
10 - Gloves
11 - Right hand slot 2
12 - Left hand slot 2
public void
clickItem
(
int
nClickType,
Unit
item)
Click on a given item with the given click type.
Parameters
-
nClickType
The click type. {0 - left click, 1 - right click, 4 - left click merc location} -
item
The item to click. -
nClickType
public void
clickItem
(
int
nClickType,
int
nX,
int
nY,
int
nLoc)
Click an item location with the given click type.
Parameters
-
nClickType
The click type. {0 - left click, 1 - right click, 2 - shift left click, 4 - left click merc location} -
nX
The x coordinate of the location to click. -
nY
The y coordinate of the location to click. -
nLoc
The game location of the item.
2 - Belt
3 - Inventory
4 - Player trade
6 - Cube
7 - Stash
public double
getDistance
(
Unit
a)
Get the euclidean distance from me to a.
Parameters
a
The second Unit.
Returns
The euclidean distance from a.
public double
getDistance
(
Unit
a,
Unit
b)
Get the euclidean distance from a to b.
Parameters
Returns
The euclidean distance from a to b.
public double
getDistance
(
Unit
a,int32_t bx,int32_t by)
Get the euclidean distance from a to b.
Parameters
-
a
The first Unit. -
bx
The x coordinate of point b. -
by
The y coordinate of point b.
Returns
The euclidean distance from a to b.
public double
getDistance
(int32_t ax,int32_t ay)
Get the euclidean distance from me to a.
Parameters
-
ax
The x coordinate of point a. -
ay
The y coordinate of point a.
Returns
The euclidean distance from me to a.
public double
getDistance
(int32_t ax,int32_t ay,
Unit
b)
Get the euclidean distance from a to b.
Parameters
-
ax
The x coordinate of point a. -
ay
The y coordinate of point a. -
b
The second Unit.
Returns
The euclidean distance from a to b.
public double
getDistance
(int32_t ax,int32_t ay,int32_t bx,int32_t by)
Get the euclidean distance from a to b.
Parameters
-
ax
The x coordinate of point a. -
ay
The y coordinate of point a. -
bx
The x coordinate of point b. -
by
The y coordinate of point b.
Returns
The euclidean distance from a to b.
public void
gold
(
int
nGold,
int
nMode)
Do something with some gold.
Todo: Determine what the values for nMode are.
Parameters
-
nGold
The amount of gold to move around. -
nMode
What to do with the gold.
public
int
checkCollision
(
Unit
a,
Unit
b,
int
nBitMask)
Check if two units collide.
Parameters
public bool
playSound
(
int
nSoundId)
Play d2 sound by id.
Returns
true
public void
quit
()
Quit the game.
public void
quitGame
()
Quit Diablo II.
Allows the core to shutdown, than terminates the process.
public bool
say
(...)
Say the string equivalent of the each of the arguments.
Returns
true if at least one parameter was sent in.
public bool
clickParty
(
Party
player,
int
nMode)
Click one of the buttons in the party screen for the given player.
Parameters
-
player
The player who's button you wish to click. -
nMode
Which button to click.
0 - Allow loot corpse
1 - Hostile player
2 - Join party
3 - Leave party (doesn't matter which party is passed in)
public
int
weaponSwitch
(int32_t dummy)
Get which weapon switch is being used.
Switch the weapons.
Parameters
dummy
Any int other than 0.
Returns
Which weapon switch is active.
Parameters
dummy
0 to use this mode.
Returns
true
public void
transmute
()
Hit the transmute button.
public void
useStatPoint
(uint16_t statType,uint32_t count)
Use a stat point.
BE CAREFUL! This function directly sends packets without checks. If you call this function and do not have the points, or specify an invalid stat, you might get flagged/banned.
Todo: Come up with a reference for the statType values
Parameters
-
statType
The type of stat to add the points to -
count
The number of points to add
public void
useSkillPoint
(uint16_t skill,uint32_t count)
Use a skill point.
BE CAREFUL! This function directly sends packets without checks. If you call this function and do not have the points, or specify an invalid skill, you might get flagged/banned.
Todo: Come up with a reference for the skill values
Parameters
-
skill
The skill to add the points to -
count
The number points to spend
public void
takeScreenshot
()
Take a screenshot.
Performs the action that pressing print screen (by default) would do
public bool
moveNPC
(
Unit
npc,uint32_t x,uint32_t y)
Move NPC to a new location.
This is an exploit function.
Parameters
-
npc
NPC to move. -
x
X coord to move to. -
y
Y coord to move to.
Returns
true
public bool
getPacket
(...)
Send a packet to the client.
Params are length, val, length, val, ... Length is the number of bytes in the following value. Value is an integer, put in the packet little endian. Maximum packet length is 20.
This is an exploit function.
Returns
true
public bool
sendPacket
(...)
Send a packet to the server.
Params are length, val, length, val, ... Length is the number of bytes in the following value. Value is an integer, put in the packet little endian. Maximum packet length is 20.
This is an exploit function.
Returns
true
public String
getIP
()
Get the external IP by going to "http://automation.whatismyip.com/n09230945.asp" and parsing the result.
public Object
screenToAutomap
(Object arg)
Convert a point from screen coordinates to automap coordinates.
Parameters
arg
An object with x and y parameters specifying the point.
Returns
An object with x and y, containing the automap coordinate.
public Object
screenToAutomap
(
int
ix,
int
iy)
Convert a point from screen coordinates to automap coordinates.
Parameters
-
ix
The x coordinate. -
iy
The y coordinate.
Returns
An object with x and y, containing the automap coordinate.
public Object
automapToScreen
(Object arg)
Convert a point from automap coordinates to screen coordinates.
Parameters
arg
An object with x and y parameters specifying the point.
Returns
An object with x and y, containing the screen coordinate.
public Object
automapToScreen
(
int
ix,
int
iy)
Convert a point from automap coordinates to screen coordinates.
Parameters
-
ix
The x coordinate. -
iy
The y coordinate.
Returns
An object with x and y, containing the screen coordinate.
public String
md5
(String str)
Takes the md5 hash.
Parameters
str
The string to hash.
Returns
The md5 hash of the string.
public String
sha1
(String str)
Takes the sha1 hash.
Parameters
str
The string to hash.
Returns
The sha1 hash of the string.
public String
sha256
(String str)
Takes the sha256 hash.
Parameters
str
The string to hash.
Returns
The sha256 hash of the string.
public String
sha384
(String str)
Takes the sha384 hash.
Parameters
str
The string to hash.
Returns
The sha384 hash of the string.
public String
sha512
(String str)
Takes the sha512 hash.
Parameters
str
The string to hash.
Returns
The sha512 hash of the string.
public String
md5_file
(String file)
Take the md5 hash of a file.
Parameters
file
Filename relative to script path.
Returns
The md5 hash of the file.
public String
sha1_file
(String file)
Take the sha1 hash of a file.
Parameters
file
Filename relative to script path.
Returns
The sha1 hash of the file.
public String
sha256_file
(String file)
Take the sha256 hash of a file.
Parameters
file
Filename relative to script path.
Returns
The sha256 hash of the file.
public String
sha384_file
(String file)
Take the sha384 hash of a file.
Parameters
file
Filename relative to script path.
Returns
The sha384 hash of the file.
public String
sha512_file
(String file)
Take the sha512 hash of a file.
Parameters
file
Filename relative to script path.
Returns
The sha512 hash of the file.
ProfileType
namespace ProfileType enum.
Summary
Members | Descriptions |
---|---|
enum ProfileType |
Members
enum
ProfileType
Values | Descriptions |
---|---|
singlePlayer | |
battleNet | |
openBattleNet | |
tcpIpHost | |
tcpIpJoin |
Area
class Represent an Area of the map.
Summary
Members | Descriptions |
---|---|
public Exit exits |
Get an array of the Area's exits. |
public String name |
The name of the Area. |
public int x |
The x coordinate of the left side of the map. |
public int xsize |
The x size (width) of the map. |
public int y |
The y coordinate of the bottom (smallest y) of the map. |
public int ysize |
The y size (height) of the map. |
public int id |
The area id. |
Members
public
Exit
exits
Get an array of the Area's exits.
This includes arrays where you can walk between two areas and warp Unit s.
public String
name
The name of the Area.
public
int
x
The x coordinate of the left side of the map.
public
int
xsize
The x size (width) of the map.
public
int
y
The y coordinate of the bottom (smallest y) of the map.
public
int
ysize
The y size (height) of the map.
public
int
id
The area id.
See Unit::area.
Box
class A Box screen hook.
Todo: Explain (and understand) this better.
Verify all the documentation in this class.
Summary
Members | Descriptions |
---|---|
public int x |
The x coordinate (left) of the Box. |
public int y |
The y coordinate (top) of the Box. |
public int xsize |
The xsize (width) of the Box. |
public int ysize |
The ysize (height) of the Box. |
public bool visible |
Whether or not the Box is visible. |
public int align |
The horizontal alignment. |
public int zorder |
The z-order of the Box (what it covers up and is covered by). |
public ClickHandler click |
The click handler that gets called when the Box is clicked. |
public HoverHandler hover |
The hover handler that gets called when the Box gets hovered over. |
public int color |
The color of the Box. |
public int opacity |
How much of the controls underneath the Box should show through. |
public Box ( int x, int y, int x2, int y2, int color, int opacity, int align,bool automap,ClickHandler click,HoverHandler hover) |
Create a Box hook with the given parameters. |
public void remove () |
Remove the Box from the screen and destroy the corresponding object. |
Members
public
int
x
The x coordinate (left) of the Box.
public
int
y
The y coordinate (top) of the Box.
public
int
xsize
The xsize (width) of the Box.
public
int
ysize
The ysize (height) of the Box.
public bool
visible
Whether or not the Box is visible.
public
int
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
public
int
zorder
The z-order of the Box (what it covers up and is covered by).
public ClickHandler
click
The click handler that gets called when the Box is clicked.
public HoverHandler
hover
The hover handler that gets called when the Box gets hovered over.
public
int
color
The color of the Box.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
public
int
opacity
How much of the controls underneath the Box should show through.
public
Box
(
int
x,
int
y,
int
x2,
int
y2,
int
color,
int
opacity,
int
align,bool automap,ClickHandler click,HoverHandler hover)
Create a Box hook with the given parameters.
Parameters
-
x
The x coordinate (left) of the Box. -
y
The y coordinate (top) of the Box. -
x2
The xsize (width) of the Box. -
y2
The ysize (height) of the Box. -
color
The color of the Box.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
Parameters
-
opacity
See Explanation of opacity parameter. -
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
Parameters
-
automap
Whether the Box is in automap coordinate space (true) or screen coordinate space (false). -
click
The click handler that gets called when the Box is clicked. -
hover
The hover handler that gets called when the Box gets hovered over.
public void
remove
()
Remove the Box from the screen and destroy the corresponding object.
Control
class This class represents out of game (OOG) Control s.
Summary
Members | Descriptions |
---|---|
public String text |
The text of the Control. |
public double x |
The x coordinate of the Control. |
public double y |
The y coordinate of the Control. |
public double xsize |
The xsize (width) of the Control. |
public double ysize |
The ysize (height) of the Control. |
public double state |
The state (?) of the Control. |
public bool password |
Return whether or not the Control holds a password (starred out text). |
public double type |
The type of control. |
public double cursorPos |
Something... |
public double selectstart |
Someting... |
public double selectend |
Something... |
public double disabled |
Whether the Control is disabled or not. |
public Control getNext () |
Gets the next Control from the linked list. |
public void click () |
Click Control in the center of the Control. |
public void click (uint32_t x,uint32_t y) |
Click Control at the given location. |
public void setText (String text) |
Set the Control's text. |
public String[] getText () |
Get the texts from a label Control. |
Members
public String
text
The text of the Control.
public double
x
The x coordinate of the Control.
public double
y
The y coordinate of the Control.
public double
xsize
The xsize (width) of the Control.
public double
ysize
The ysize (height) of the Control.
public double
state
The state (?) of the Control.
Todo: Find a reference for these values.
public bool
password
Return whether or not the Control holds a password (starred out text).
public double
type
The type of control.
1 - TextBox
2 - Image
3 - Image2
4 - LabelBox
5 - ScrollBar
6 - Button
7 - List
8 - Timer
9 - Smack
10 - ProgressBar
11 - Popup
12 - AccountList
public double
cursorPos
Something...
Todo: Determine what this is.
public double
selectstart
Someting...
Todo: Determine what this is.
public double
selectend
Something...
Todo: Determine what this is.
public double
disabled
Whether the Control is disabled or not.
public
Control
getNext
()
Gets the next Control from the linked list.
This is done by finding the old Control based on type, location and size.
public void
click
()
Click Control in the center of the Control.
public void
click
(uint32_t x,uint32_t y)
Click Control at the given location.
This is equivalent with clicking at the given location.
Parameters
-
x
The x coordinate of the point to click. -
y
The y coordinate of the point to click.
public void
setText
(String text)
Set the Control's text.
Parameters
text
The text to set the Control's text field to.
public String[]
getText
()
Get the texts from a label Control.
Only works for labels.
Returns
An array of all the Control's texts.
D2BSScript
class Represents a script (a thread), created by either loading a file, or typing something in the console.
Summary
Members | Descriptions |
---|---|
public String name |
The relative filename of the script. |
public int type |
The type of script. |
public bool running |
Whether or not the script is running. |
public int threadid |
The thread id. |
public bool getNext () |
Get the next script. |
public void pause () |
Pause the script. |
public void resume () |
Resume the script. |
public void join () |
Wait for other script to finish. |
public void stop () |
Stop the script. |
public void send (...) |
Send some values to the script. |
Members
public String
name
The relative filename of the script.
If the script is from the console the filename will be reported as "Command Line".
public
int
type
The type of script.
0 - InGame
1 - OutOfGame or Command
public bool
running
Whether or not the script is running.
public
int
threadid
The thread id.
public bool
getNext
()
Get the next script.
Returns
Whether there was another script or not.
public void
pause
()
Pause the script.
public void
resume
()
Resume the script.
public void
join
()
Wait for other script to finish.
public void
stop
()
Stop the script.
public void
send
(...)
Send some values to the script.
Has the effect of calling the any listeners to scriptmsg with the parameters provided.
DBStatement
class A class describing ...
Todo: Get a better description (and understanding).
Summary
Members | Descriptions |
---|---|
public String sql |
The statement string. |
public bool ready |
Whether or not there is more data to be gotten. |
public Object getObject () |
An object with property names from the column names and property values coming from the data. |
public int getColumnCount () |
Get the column count. |
public double getColumnValue ( int colIndex) |
Get the value from the column specified by index. |
public String getColumnValue ( int colIndex) |
Get the value from the column specified by index. |
public getColumnName ( int colIndex) |
Get the name of the column at the given index. |
public bool go () |
Call sqlite3_step and close_db_stmt on the statement. |
public bool next () |
Call sqlite3_step on the statement. |
public int skip ( int rows) |
Skip a certain number of rows in the results. |
public bool reset () |
Call sqlite3_reset. |
public bool close () |
Close the statement. |
public bool bind ( int colnum,double val) |
Bind the given data to the given column. |
public bool bind ( int colnum, int val) |
Bind the given data to the given column. |
public bool bind ( int colnum,String val) |
Bind the given data to the given column. |
public bool bind ( int colnum,bool val) |
Bind the given data to the given column. |
Members
public String
sql
The statement string.
public bool
ready
Whether or not there is more data to be gotten.
public Object
getObject
()
An object with property names from the column names and property values coming from the data.
Returns
The object with all the data.
public
int
getColumnCount
()
Get the column count.
Returns
The column count.
public double
getColumnValue
(
int
colIndex)
Get the value from the column specified by index.
Parameters
colIndex
The index of the column to get data from.
Returns
The data.
public String
getColumnValue
(
int
colIndex)
Get the value from the column specified by index.
Parameters
colIndex
The index of the column to get data from.
Returns
The data.
public
getColumnName
(
int
colIndex)
Get the name of the column at the given index.
Parameters
colIndex
The index of the column to get data from.
Returns
The column name.
public bool
go
()
Call sqlite3_step and close_db_stmt on the statement.
Todo: Interpret what this means.
Returns
Whether the result is SQLITE_DONE.
public bool
next
()
Call sqlite3_step on the statement.
Todo: Interpret what this means and how's it's different from go().
Returns
Whether the result is SQLITE_ROW.
public
int
skip
(
int
rows)
Skip a certain number of rows in the results.
Parameters
rows
The number of rows to skip.
Returns
The number of rows actually skipped.
public bool
reset
()
Call sqlite3_reset.
Todo: Interpret what this does.
Returns
true.
public bool
close
()
Close the statement.
Returns
true.
public bool
bind
(
int
colnum,double val)
Bind the given data to the given column.
Parameters
-
colnum
The column number to bind to. -
val
The data to bind.
Returns
true.
public bool
bind
(
int
colnum,
int
val)
Bind the given data to the given column.
Parameters
-
colnum
The column number to bind to. -
val
The data to bind.
Returns
true.
public bool
bind
(
int
colnum,String val)
Bind the given data to the given column.
Parameters
-
colnum
The column number to bind to. -
val
The data to bind.
Returns
true.
public bool
bind
(
int
colnum,bool val)
Bind the given data to the given column.
Parameters
-
colnum
The column number to bind to. -
val
The data to bind.
Returns
true.
Exit
class Represents a method of getting from one Area to another.
Summary
Members | Descriptions |
---|---|
public int x |
The x coordinate of the exit. |
public int y |
The y coordinate of the exit. |
public int target |
The Area ID of the target level. |
public int type |
The Exit type. |
public int tileid |
The class ID of the Exit if it is a stairs type Exit, 0 otherwise. |
public int level |
The Area ID of the source side of the Exit. |
Members
public
int
x
The x coordinate of the exit.
public
int
y
The y coordinate of the exit.
public
int
target
The Area ID of the target level.
public
int
type
The Exit type.
1 - A walk through Exit
2 - A stairs type Exit
public
int
tileid
The class ID of the Exit if it is a stairs type Exit, 0 otherwise.
public
int
level
The Area ID of the source side of the Exit.
File
class This class handles the opening, reading and writing of files.
Summary
Members | Descriptions |
---|---|
public bool readable |
Whether or not the file can be read from. |
public bool writeable |
Whether or not the file is writeable. |
public bool seekable |
Whether or not the file is seekable. |
public int mode |
The mode the file was opened with. |
public bool binaryMode |
Whether the file was opened as a binary file or not. |
public int length |
The file length. |
public String path |
The relative path to the File (the filename/path given for opening). |
public int position |
The position in the File (where the next read or write will occur). |
public bool eof |
Whether or not the File is at end of file. |
public int accessed |
The last accessed time of the File. |
public int created |
The creation time of the File. |
public int modified |
The last modified time of the File. |
public bool autoflush |
Whether or not to autoflush the File. |
public File close () |
Close the current file and then return it. |
public File reopen () |
Reopen the file, equivalent to calling open with the same parameters as were used the first time. |
public String read ( int count) |
Read count chars from the file. |
public byte[] read ( int count) |
Read count bytes from the file. |
public String readLine () |
Read a line from the file and return it. |
public String[] readAllLines () |
Read all the lines from the file into a String array. |
public String readAll () |
Read the entire file and return as a String. |
public File write (...) |
Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the File. |
public File seek ( int n) |
Seek n bytes from the current location. |
public File seek ( int n,bool isLines,bool fromStart) |
Seek n bytes or lines (depending on isLines) from the current location or the start of file (depending on fromStart). |
public File flush () |
Flush the buffers for the File. |
public File reset () |
Seek back to the beginning of the File. |
public File end () |
Seek to the end of the File. |
Members
public bool
readable
Whether or not the file can be read from.
Based on whether the File is open, whether it is at the end of file, and whether there is an error pending.
public bool
writeable
Whether or not the file is writeable.
Based on whether the File is open, whether there is an error pending and whether the File was opened for writing or not.
public bool
seekable
Whether or not the file is seekable.
Based on whether the File is open and whether there is an error pending.
public
int
mode
The mode the file was opened with.
Compare with FILE_READ, FILE_WRITE and FILE_APPEND.
public bool
binaryMode
Whether the file was opened as a binary file or not.
public
int
length
The file length.
public String
path
The relative path to the File (the filename/path given for opening).
public
int
position
The position in the File (where the next read or write will occur).
public bool
eof
Whether or not the File is at end of file.
public
int
accessed
The last accessed time of the File.
public
int
created
The creation time of the File.
public
int
modified
The last modified time of the File.
public bool
autoflush
Whether or not to autoflush the File.
public
File
close
()
Close the current file and then return it.
Returns
The same File object.
public
File
reopen
()
Reopen the file, equivalent to calling open with the same parameters as were used the first time.
Returns
The same File object.
public String
read
(
int
count)
Read count chars from the file.
Used when the file was not opened in binary mode.
Parameters
count
The number of characters to read.
Returns
The characters that were read.
public byte[]
read
(
int
count)
Read count bytes from the file.
Used when the file was opened in binary mode.
Parameters
count
The number of bytes to read.
Returns
An array of the bytes read.
public String
readLine
()
Read a line from the file and return it.
Returns
The line.
public String[]
readAllLines
()
Read all the lines from the file into a String array.
Returns
An array of all the lines in the file.
public String
readAll
()
Read the entire file and return as a String.
Includes a seek to start from the beginning of the file, regardless of where the current position was.
Returns
The entire file in a String.
public
File
write
(...)
Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the File.
Returns
The File.
public
File
seek
(
int
n)
Seek n bytes from the current location.
Parameters
n
Number of bytes to move..
Returns
The File.
public
File
seek
(
int
n,bool isLines,bool fromStart)
Seek n bytes or lines (depending on isLines) from the current location or the start of file (depending on fromStart).
Parameters
-
n
Number of bytes or lines to move. -
isLines
Whether n is a number of lines, or just bytes. -
fromStart
Whether to start from the start of file, or the current location.
Returns
The File.
public
File
flush
()
Flush the buffers for the File.
Returns
The File.
public
File
reset
()
Seek back to the beginning of the File.
Returns
The File.
public
File
end
()
Seek to the end of the File.
Returns
The File.
FileTools
class A collection of tools to do things like move files and determine whether files exist.
Summary
Members | Descriptions |
---|---|
public bool writeText (String file,...) |
Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file. |
public bool appendText (String file,...) |
Append the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file. |
Members
public bool
writeText
(String file,...)
Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.
Parameters
file
The filename of the file to write to.
Returns
Whether or not the operation was successful.
public bool
appendText
(String file,...)
Append the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.
Parameters
file
The filename of the file to write to.
Returns
Whether or not the operation was successful.
Folder
class Represents a folder.
Summary
Members | Descriptions |
---|---|
public String name |
The path name to the directory. |
public Folder create (String name) |
Create a new directory. |
public bool remove () |
Remove the directory. |
public String[] getFiles () |
Get the filename for each of the files in the directory. |
public String[] getFolders () |
Get the name for each of the sub-directories in the current directory. |
Members
public String
name
The path name to the directory.
public
Folder
create
(String name)
Create a new directory.
Parameters
name
The name of the directory to create under the current directory.
Returns
The new Folder created.
public bool
remove
()
Remove the directory.
Must be empty to work properly.
Returns
true.
public String[]
getFiles
()
Get the filename for each of the files in the directory.
Returns
An array of all the filenames.
public String[]
getFolders
()
Get the name for each of the sub-directories in the current directory.
Returns
An array of all the folder names.
Frame
class This class represents a screen hook for a Frame.
Todo: Explain (and understand) this better.
Verify all the documentation in this class.
Summary
Members | Descriptions |
---|---|
public int x |
The x coordinate (left) of the Frame. |
public int y |
The y coordinate (top) of the Frame. |
public int xsize |
The xsize (width) of the Frame. |
public int ysize |
The ysize (height) of the Frame. |
public bool visible |
Whether or not the Frame is visible. |
public int align |
The horizontal alignment. |
public int zorder |
The z-order of the Frame (what it covers up and is covered by). |
public ClickHandler click |
The click handler that gets called when the Frame is clicked. |
public HoverHandler hover |
The hover handler that gets called when the Frame gets hovered over. |
public Frame ( int x, int y, int x2, int y2, int align,bool automap,ClickHandler click,HoverHandler hover) |
Create a Frame hook with the given parameters. |
public void remove () |
Remove the Frame from the screen and destroy the corresponding object. |
Members
public
int
x
The x coordinate (left) of the Frame.
public
int
y
The y coordinate (top) of the Frame.
public
int
xsize
The xsize (width) of the Frame.
public
int
ysize
The ysize (height) of the Frame.
public bool
visible
Whether or not the Frame is visible.
public
int
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
public
int
zorder
The z-order of the Frame (what it covers up and is covered by).
public ClickHandler
click
The click handler that gets called when the Frame is clicked.
public HoverHandler
hover
The hover handler that gets called when the Frame gets hovered over.
public
Frame
(
int
x,
int
y,
int
x2,
int
y2,
int
align,bool automap,ClickHandler click,HoverHandler hover)
Create a Frame hook with the given parameters.
Parameters
-
x
The x coordinate (left) of the Frame. -
y
The y coordinate (top) of the Frame. -
x2
The xsize (width) of the Frame. -
y2
The ysize (height) of the Frame. -
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
Parameters
-
automap
Whether the Frame is in automap coordinate space (true) or screen coordinate space (false). -
click
The click handler that gets called when the Frame is clicked. -
hover
The hover handler that gets called when the Frame gets hovered over.
public void
remove
()
Remove the Frame from the screen and destroy the corresponding object.
Image
class This class represents a screen hook for a Image.
Todo: Explain (and understand) this better.
Verify all the documentation in this class.
Summary
Members | Descriptions |
---|---|
public int x |
The x coordinate (left) of the Image. |
public int y |
The y coordinate (top) of the Image. |
public bool visible |
Whether or not the Image is visible. |
public int align |
The horizontal alignment. |
public int zorder |
The z-order of the Image (what it covers up and is covered by). |
public ClickHandler click |
The click handler that gets called when the Image is clicked. |
public HoverHandler hover |
The hover handler that gets called when the Image gets hovered over. |
public String location |
Location of the file to load for display. |
public Image (String szText, int x, int y, int color, int align,bool automap,ClickHandler click,HoverHandler hover) |
Create an Image hook with the given parameters. |
public void remove () |
Remove the Image from the screen and destroy the corresponding object. |
Members
public
int
x
The x coordinate (left) of the Image.
public
int
y
The y coordinate (top) of the Image.
public bool
visible
Whether or not the Image is visible.
public
int
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
public
int
zorder
The z-order of the Image (what it covers up and is covered by).
public ClickHandler
click
The click handler that gets called when the Image is clicked.
public HoverHandler
hover
The hover handler that gets called when the Image gets hovered over.
public String
location
Location of the file to load for display.
public
Image
(String szText,
int
x,
int
y,
int
color,
int
align,bool automap,ClickHandler click,HoverHandler hover)
Create an Image hook with the given parameters.
Parameters
-
szText
The filename to load the image from. -
x
The x coordinate (left) of the Image. -
y
The y coordinate (top) of the Image. -
color
The color of the Image.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
Parameters
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
Parameters
-
automap
Whether the Image is in automap coordinate space (true) or screen coordinate space (false). -
click
The click handler that gets called when the Image is clicked. -
hover
The hover handler that gets called when the Image gets hovered over.
public void
remove
()
Remove the Image from the screen and destroy the corresponding object.
Line
class A 2d line.
Todo: Verify all the documentation in this class.
Summary
Members | Descriptions |
---|---|
public int x |
The first x coordinate of the Line. |
public int y |
The first y coordinate of the Line. |
public int x2 |
The second x coordinate of the Line. |
public int y2 |
The second y coordinate of the Line. |
public bool visible |
Whether or not the Line is visible. |
public int color |
The color of the Line. |
public int zorder |
The z-order of the Line (what it covers up and is covered by). |
public ClickHandler click |
The click handler that gets called when the Line is clicked. |
public HoverHandler hover |
The hover handler that gets called when the Line gets hovered over. |
public Line ( int x, int y, int x2, int y2, int color,bool automap,ClickHandler click,HoverHandler hover) |
Create a Line hook with the given parameters. |
public void remove () |
Remove the Line from the screen and destroy the corresponding object. |
Members
public
int
x
The first x coordinate of the Line.
public
int
y
The first y coordinate of the Line.
public
int
x2
The second x coordinate of the Line.
public
int
y2
The second y coordinate of the Line.
public bool
visible
Whether or not the Line is visible.
public
int
color
The color of the Line.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
public
int
zorder
The z-order of the Line (what it covers up and is covered by).
public ClickHandler
click
The click handler that gets called when the Line is clicked.
public HoverHandler
hover
The hover handler that gets called when the Line gets hovered over.
public
Line
(
int
x,
int
y,
int
x2,
int
y2,
int
color,bool automap,ClickHandler click,HoverHandler hover)
Create a Line hook with the given parameters.
Parameters
-
x
The x coordinate (left) of the Line. -
y
The y coordinate (top) of the Line. -
x2
The xsize (width) of the Line. -
y2
The ysize (height) of the Line. -
color
The color of the Line.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
Parameters
-
automap
Whether the Line is in automap coordinate space (true) or screen coordinate space (false). -
click
The click handler that gets called when the Line is clicked. -
hover
The hover handler that gets called when the Line gets hovered over.
public void
remove
()
Remove the Line from the screen and destroy the corresponding object.
Me
class The class that represents the controlled unit.
Technically, also called Unit, but since C++ doesn't support class overloading, called it Me here instead.
Summary
Members | Descriptions |
---|---|
public int type |
The type of the unit. |
public int classId |
The class id of the object. |
public int mode |
The mode of the unit. |
public String name |
The name of the unit. |
public int mapid |
The seed used to create the map. |
public int act |
The act where the unit is currently located. |
public int gid |
The unit unique id. |
public int x |
The x location of the unit. |
public int y |
The y location of the unit. |
public int targetx |
The target x location of the unit. |
public int targety |
The target y location of the unit. |
public int area |
The id of the area (level) the unit is located in. |
public int hp |
The unit's current health. |
public int hpmax |
The unit's maximum health. |
public int mp |
The unit's current mana. |
public int mpmax |
The unit's maximum mana. |
public int stamina |
The unit's current stamina. |
public int staminamax |
The unit's maximum stamina. |
public int charlvl |
The character level. |
public int itemcount |
The number of items in inventory. |
public double owner |
The unit id of the owner of the unit. |
public int ownertype |
The type of owner. |
public int spectype |
The special type of the unit. |
public int direction |
The direction of the unit. |
public String code |
The three digit code for an item. |
public String prefix |
The magic prefix of the item. |
public String suffix |
The magic suffix of the item. |
public int prefixnum |
The id code for the magic prefix. |
public int suffixnum |
The id code for the magic suffix. |
public String fname |
The full name of an item. |
public int quality |
The item quality. |
public int node |
No clue. |
public int location |
The location of the item (ground, inventory, stash, etc.). |
public int sizex |
The x size of the item. |
public int sizey |
The y size of the item. |
public int itemType |
The type of the item. |
public String description |
The description of the item. |
public int bodylocation |
The equipped location of the item. |
public int ilvl |
Item level. |
public int runwalk |
Whether the controlled character is in the always run mode or not. |
public int weaponswitch |
Set the weapon switch. |
public String account |
The account name used to log on to the account. |
public String charname |
The character name. |
public int diff |
The difficulty of the game. |
public int maxdiff |
The maximum difficulty available. |
public String gamename |
The name of the game. |
public String gamepassword |
The password of the game. |
public String gameserverip |
A string representation of the IPv4 address of the game server. |
public double gamestarttime |
Some sort of representation of the start time of the game. |
public int gametype |
The game type, expansion or not. |
public bool itemoncursor |
Whether or not there is an item on the cursor. |
public bool ladder |
Whether or not the game is a ladder game. |
public int ping |
The ping in milliseconds. |
public int fps |
The frame rate. |
public int playertype |
Whether or not the gametype is hardcore. |
public String realm |
The realm name. |
public String realmshort |
The short realm name. |
public int mercrevivecost |
The cost to revive the merc. |
public int chickenhp |
The health at which to chicken if the character drops below. |
public int chickenmp |
The mana at which to chicken if the character drops below. |
public bool quitonhostile |
Whether to chicken if another player hostiles the controlled character. |
public bool blockKeys |
Block keys... |
public bool blockMouse |
Block mouse... |
public bool gameReady |
Whether or not the game window is in the game. |
public String profile |
The profile currently being used. |
public bool nopickup |
Whether the game is set to not pick up items or not. |
public double pid |
The process id of Diablo II. |
public int screensize |
The window size. |
public String windowtitle |
The window title. |
public bool ingame |
True if the game is not at menu. |
public bool quitonerror |
Whether or not to quit when there's an error. |
public int maxgametime |
The max time in milliseconds to stay in game before the game auto-quits. |
public bool getNext () |
Get the next unit that matches the originally given name or class id and originally specified mode. |
public bool getNext (String szName) |
Get the next unit that matches the given name and originally specified mode. |
public bool getNext ( int dwClassId) |
Get the next unit that matches the given class id and originally specified mode. |
public bool getNext (String szName, int dwMode) |
Get the next unit that matches the given name and mode. |
public bool getNext ( int dwClassId, int dwMode) |
Get the next unit that matches the given class id and mode. |
public void cancel () |
Cancel some form of interaction. |
public bool repair () |
Try to repair. |
public bool useMenu ( int menuItem) |
Use an NPC menu. |
public bool interact () |
Interact with the unit. |
public bool interact ( int destId) |
Interact with a waypoint. |
public Unit getItem (String name,uint32_t mode,uint32_t nUnitId) |
Get an item from inventory by name, mode and nUnitId. |
public Unit getItem (uint32_t classId,uint32_t mode,uint32_t nUnitId) |
Get an item from inventory by classId, mode and nUnitId. |
public Unit getItems () |
Get all items from inventory. |
public Unit getMerc () |
Get a player's merc. |
public int getMercHP () |
Get the merc's HP. |
public String getSkill ( int hand) |
Get skill name from hand. |
public int getSkill ( int hand) |
Get skill id from hand. |
public int getSkill ( int dummy) |
Get all skills. |
public int getSkill ( int nSkillId, int nExt) |
Calls D2COMMON_GetSkillLevel and returns the result. |
public Unit getParent () |
Gets the parent of a unit. |
public String getParent () |
Gets the parent of a unit. |
public void overhead (Object message) |
Puts the string equivalent of message over the unit. |
public void revive () |
Revive the character. |
public int getFlags () |
Returns the item flags. |
public double getStat ( int nStat, int nSubIndex) |
Get a stat by stat id and sub index. |
public int getStat ( int nStat, int nSubIndex) |
Get a stat by stat id and sub index. |
public int getStat ( int nStat, int nSubIndex) |
Get an array of all the stats of the item. |
public bool getState ( int nState) |
TODO: Handle getStat(-2);. |
public int getPrice ( Unit npc, int buysell) |
Get the price of the item at a given npc, with choice of buying or selling, in the current difficulty. |
public int getPrice ( int npcId, int buysell) |
Get the price of the item at a given npc (by id), which choice of buying or selling, in the current difficulty. |
public int getPrice ( Unit npc, int buysell, int difficulty) |
Get the price of the item at a given npc, with choice of buying or selling, in a given difficulty. |
public int getPrice ( int npcId, int buysell, int difficulty) |
Get the price of the item at a given npc (by id), with choice of buying or selling, in a given difficulty. |
public bool getEnchant ( int nEnchant) |
Determine whether or not a unit has a given enchant. |
public bool shop ( int dwMode) |
Shop with a given npc, either buying or selling. |
public bool setSkill (String skillName, int nHand) |
Set the skill on the given hand to be skill with name skillName. |
public bool setSkill ( int nSkillId, int nHand) |
Set the skill on the given hand to be skill with id nSkillId. |
public bool setSkill (String skillName, int nHand, Unit item) |
Set the skill on the given hand to be skill with name skillName. |
public bool setSkill ( int nSkillId, int nHand, Unit item) |
Set the skill on the given hand to be skill with id nSkillId. |
public void move ( int x, int y) |
Move to the given location. |
public void move () |
Move to this unit. |
public int getQuest ( int nAct, int nQuest) |
Get the quest flag for a quest specified by act and quest number. |
public int getMinionCount ( int nType) |
Get the number of minions of a certain type. |
public int getRepairCost ( int nNpcClassId) |
Get price to repair this unit at the current npc given by nNpcClassId. |
public int getItemCost ( int nMode, Unit npc) |
Get the cost to do something (buy, sell, repair) with the given item, at the given npc. |
public int getItemCost ( int nMode, Unit npc, int nDifficulty) |
Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty. |
public int getItemCost ( int nMode, int nNpcClassId) |
Get the cost to do something (buy, sell, repair) with the given item, at the given npc. |
public int getItemCost ( int nMode, int nNpcClassId, int nDifficulty) |
Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty. |
Members
public
int
type
The type of the unit.
0 - Player
1 - NPC
2 - Object
3 - Missile
4 - Item
5 - Warp
Source: botNET
public
int
classId
The class id of the object.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1002
http://forums.d2botnet.org/viewtopic.php?f=18&t=986 and
http://forums.d2botnet.org/viewtopic.php?f=18&t=985
public
int
mode
The mode of the unit.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=988
public String
name
The name of the unit.
public
int
mapid
The seed used to create the map.
public
int
act
The act where the unit is currently located.
public
int
gid
The unit unique id.
Referred to simply as the unit id. Used along with the unit type to uniquely identify the unit.
public
int
x
The x location of the unit.
public
int
y
The y location of the unit.
public
int
targetx
The target x location of the unit.
Where the game is taking the unit.
public
int
targety
The target y location of the unit.
Where the game is taking the unit.
public
int
area
The id of the area (level) the unit is located in.
public
int
hp
The unit's current health.
public
int
hpmax
The unit's maximum health.
public
int
mp
The unit's current mana.
public
int
mpmax
The unit's maximum mana.
public
int
stamina
The unit's current stamina.
public
int
staminamax
The unit's maximum stamina.
public
int
charlvl
The character level.
The level that determines stat points, skill levels, etc.
public
int
itemcount
The number of items in inventory.
public double
owner
The unit id of the owner of the unit.
public
int
ownertype
The type of owner.
public
int
spectype
The special type of the unit.
Represents things like unique, minion, boss, etc.
1 - "Normal" Boss 2 - Champion 4 - Boss 8 - Minion
public
int
direction
The direction of the unit.
Todo: Figure out what the direction is.
public String
code
The three digit code for an item.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=991
public String
prefix
The magic prefix of the item.
public String
suffix
The magic suffix of the item.
public
int
prefixnum
The id code for the magic prefix.
public
int
suffixnum
The id code for the magic suffix.
public String
fname
The full name of an item.
public
int
quality
The item quality.
1 - Low quality
2 - Normal
3 - Superior
4 - Magic
5 - Set
6 - Rare
7 - Unique
8 - Crafted
Source: botNET
public
int
node
No clue.
Todo: Get a clue.
public
int
location
The location of the item (ground, inventory, stash, etc.).
0 - Ground
1 - Equipped
2 - Belt
3 - Inventory
4 - Store
5 - Trade
6 - Cube
7 - Stash
public
int
sizex
The x size of the item.
public
int
sizey
The y size of the item.
public
int
itemType
The type of the item.
Todo: Put together a reference for item type.
public String
description
The description of the item.
public
int
bodylocation
The equipped location of the item.
0 - Not equipped
1 - Helmet
2 - Amulet
3 - Armor
4 - Right hand slot 1
5 - Left hand slot 1
6 - Right ring
7 - Left ring
8 - Belt
9 - Boots
10 - Gloves
11 - Right hand slot 2
12 - Left hand slot 2
public
int
ilvl
Item level.
Used for things like item stat rolling.
public
int
runwalk
Whether the controlled character is in the always run mode or not.
0 - Walk unless directed to run 1 - Always run
public
int
weaponswitch
Set the weapon switch.
public String
account
The account name used to log on to the account.
public String
charname
The character name.
public
int
diff
The difficulty of the game.
0 - Normal
1 - Nightmare
2 - Hell
public
int
maxdiff
The maximum difficulty available.
See Me::diff for details.
public String
gamename
The name of the game.
public String
gamepassword
The password of the game.
public String
gameserverip
A string representation of the IPv4 address of the game server.
public double
gamestarttime
Some sort of representation of the start time of the game.
Todo: Figure out what this represents.
public
int
gametype
The game type, expansion or not.
Todo: Determine what the values are.
public bool
itemoncursor
Whether or not there is an item on the cursor.
public bool
ladder
Whether or not the game is a ladder game.
public
int
ping
The ping in milliseconds.
public
int
fps
The frame rate.
public
int
playertype
Whether or not the gametype is hardcore.
public String
realm
The realm name.
public String
realmshort
The short realm name.
Todo: Determine the difference between this and realm.
public
int
mercrevivecost
The cost to revive the merc.
public
int
chickenhp
The health at which to chicken if the character drops below.
public
int
chickenmp
The mana at which to chicken if the character drops below.
public bool
quitonhostile
Whether to chicken if another player hostiles the controlled character.
public bool
blockKeys
Block keys...
Todo: Determine what this means.
public bool
blockMouse
Block mouse...
Todo: Determine what this means.
public bool
gameReady
Whether or not the game window is in the game.
public String
profile
The profile currently being used.
public bool
nopickup
Whether the game is set to not pick up items or not.
public double
pid
The process id of Diablo II.
public
int
screensize
The window size.
Todo: Determine what the numbers mean.
public String
windowtitle
The window title.
public bool
ingame
True if the game is not at menu.
Todo: Determine when this is different from gameReady. Maybe when going between acts for instance.
public bool
quitonerror
Whether or not to quit when there's an error.
Todo: Figure out if this means js errors.
public
int
maxgametime
The max time in milliseconds to stay in game before the game auto-quits.
public bool
getNext
()
Get the next unit that matches the originally given name or class id and originally specified mode.
Returns
Whether another unit was found.
public bool
getNext
(String szName)
Get the next unit that matches the given name and originally specified mode.
Parameters
szName
The name to look for.
Returns
Whether another unit was found.
public bool
getNext
(
int
dwClassId)
Get the next unit that matches the given class id and originally specified mode.
Parameters
dwClassId
The class id to look for.
Returns
Whether another unit was found.
public bool
getNext
(String szName,
int
dwMode)
Get the next unit that matches the given name and mode.
Parameters
-
szName
The name to look for. -
dwMode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for.
Returns
Whether another unit was found.
public bool
getNext
(
int
dwClassId,
int
dwMode)
Get the next unit that matches the given class id and mode.
Parameters
-
dwClassId
The class id to look for. -
dwMode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for.
Returns
Whether another unit was found.
public void
cancel
()
Cancel some form of interaction.
If there is scrolling text, cancel it. If you are interacting with an NPC, stop interacting. If you have an item on your cursor, drop it. Otherwise call D2CLIENT_CloseInteract.
public bool
repair
()
Try to repair.
Need to be able to find unit that you're trying to repair with. That means the unit needs to still be in the server unit hash table.
Returns
true if successful.
public bool
useMenu
(
int
menuItem)
Use an NPC menu.
Need to be able to find unit that you're trying to repair with. That means the unit needs to still be in the server unit hash table.
Parameters
menuItem
Index of the menu item to click.
Returns
true if menu was found.
public bool
interact
()
Interact with the unit.
If the unit is an item in inventory pick it up. Otherwise click it on the map.
public bool
interact
(
int
destId)
Interact with a waypoint.
If the unit is an object, assume it's a waypoint, and take it.
Parameters
destId
The area id of the destination to select.
public
Unit
getItem
(String name,uint32_t mode,uint32_t nUnitId)
Get an item from inventory by name, mode and nUnitId.
Parameters
-
name
The name of the unit to look for. -
mode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for. -
nUnitId
The unique id of the unit.
Returns
The first item found that matches the description.
public
Unit
getItem
(uint32_t classId,uint32_t mode,uint32_t nUnitId)
Get an item from inventory by classId, mode and nUnitId.
Parameters
-
classId
The class id of the unit. -
mode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for. -
nUnitId
The unique id of the unit.
Returns
The first item found that matches the description.
public
Unit
getItems
()
Get all items from inventory.
Returns
An array of all the items from inventory.
public
Unit
getMerc
()
Get a player's merc.
The unit being operated on should be a player.
Returns
The merc if there is one, null otherwise.
public
int
getMercHP
()
Get the merc's HP.
The reported HP is a percentage.
Returns
The merc's HP percentage.
public String
getSkill
(
int
hand)
Get skill name from hand.
Parameters
hand
Hand to get the skill name off.
0 - Right hand
1 - Left hand
Returns
Skill name.
public
int
getSkill
(
int
hand)
Get skill id from hand.
Parameters
hand
Hand to get the skill id off.
2 - Right hand
3 - Left hand
Returns
Skill id.
public
int
getSkill
(
int
dummy)
Get all skills.
Gets all skill ids, along with corresponding base and total skill levels.
Parameters
dummy
Should be 4.
Returns
An array of arrays of integers. Inside the inner array the 0th index is the skill id, the 1st index is the base skill level and the 2nd index is the total skill level. Only the first 256 skills are read.
public
int
getSkill
(
int
nSkillId,
int
nExt)
Calls D2COMMON_GetSkillLevel and returns the result.
Todo: Figure out what D2COMMON_GetSkillLevel does.
Returns
Whatever D2COMMON_GetSkillLevel returns.
public
Unit
getParent
()
Gets the parent of a unit.
This function is used for monster and item units.
Returns
The parent unit.
public String
getParent
()
Gets the parent of a unit.
This function is used for object units.
Returns
The parent's name.
public void
overhead
(Object message)
Puts the string equivalent of message over the unit.
public void
revive
()
Revive the character.
BE CAREFUL! This function directly sends packets without checks. If you call this function and are not dead, you might get flagged/banned.
public
int
getFlags
()
Returns the item flags.
Returns
Item flags:
0x00000001 - Equipped
0x00000008 - In socket
0x00000010 - Identified
0x00000040 - Weapon/shield is in the active weapon switch
0x00000080 - Weapon/shield is in the inactive weapon switch
0x00000100 - Item is broken
0x00000400 - Full rejuv
0x00000800 - Socketed
0x00002000 - In the trade or gamble screen
0x00004000 - Not in a socket
0x00010000 - Is an ear
0x00020000 - A starting item (worth only 1 gold)
0x00200000 - Rune, or potion, or mephisto's soulstone
0x00400000 - Ethereal
0x00800000 - Is an item
0x01000000 - Personalized
0x04000000 - Runeword
Source: http://subversion.assembla.com/svn/d2bs/scripts/YAMB/libs/YAMB/common/YAM-Common.dbl r1086
public double
getStat
(
int
nStat,
int
nSubIndex)
Get a stat by stat id and sub index.
Used for every stat except 6-11.
Parameters
-
nStat
The stat type. See http://forums.d2botnet.org/viewtopic.php?f=18&t=989 -
nSubIndex
A subindex to a certain type of stat. For instance a specific skill for the +1 to skill tab stat.
Returns
The stat value.
public
int
getStat
(
int
nStat,
int
nSubIndex)
Get a stat by stat id and sub index.
Used for stats 6-11.
Parameters
-
nStat
The stat type. See http://forums.d2botnet.org/viewtopic.php?f=18&t=989 -
nSubIndex
A subindex to a certain type of stat. For instance a specific skill for the +1 to skill tab stat.
Returns
The stat value.
public
int
getStat
(
int
nStat,
int
nSubIndex)
Get an array of all the stats of the item.
Parameters
-
nStat
Set to -1. -
nSubIndex
Ignored.
Returns
An array of the first 64 stats. The indices of the inner array are: 0 - nStat, 1 - nSubIndex, 2 - nValue.
public bool
getState
(
int
nState)
TODO: Handle getStat(-2);.
Return whether or not the unit has a given state.
Parameters
nState
The state id.
Returns
Whether or not the unit has the state.
public
int
getPrice
(
Unit
npc,
int
buysell)
Get the price of the item at a given npc, with choice of buying or selling, in the current difficulty.
Deprecated: Use getItemCost instead.
Todo: Determine the meaning of "buysell".
Parameters
-
npc
The npc to determine the price at. -
buysell
Unknown
Returns
The price requested.
public
int
getPrice
(
int
npcId,
int
buysell)
Get the price of the item at a given npc (by id), which choice of buying or selling, in the current difficulty.
Deprecated: Use getItemCost instead.
Todo: Determine the meaning of "buysell".
Parameters
-
npcId
The id of the npc to determine the price at. -
buysell
Unknown
Returns
The price requested.
public
int
getPrice
(
Unit
npc,
int
buysell,
int
difficulty)
Get the price of the item at a given npc, with choice of buying or selling, in a given difficulty.
Deprecated: Use getItemCost instead.
Todo: Determine the meaning of "buysell".
Parameters
-
npc
The npc to determine the price at. -
buysell
Unknown -
difficulty
The difficulty of interest: 0 - normal, 1 - nightmare, 2 - hell
Returns
The price requested.
public
int
getPrice
(
int
npcId,
int
buysell,
int
difficulty)
Get the price of the item at a given npc (by id), with choice of buying or selling, in a given difficulty.
Deprecated: Use getItemCost instead.
Todo: Determine the meaning of "buysell".
Parameters
-
npcId
The id of the npc to determine the price at. -
buysell
Unknown -
difficulty
The difficulty of interest: 0 - normal, 1 - nightmare, 2 - hell
Returns
The price requested.
public bool
getEnchant
(
int
nEnchant)
Determine whether or not a unit has a given enchant.
Parameters
nEnchant
Enchantment id.
Returns
Whether or not the unit has the enchantment.
public bool
shop
(
int
dwMode)
Shop with a given npc, either buying or selling.
Parameters
dwMode
What to do with the item. 1 - Sell, 2 - Buy, 6 - ?
Returns
Whether or not the shop went through.
public bool
setSkill
(String skillName,
int
nHand)
Set the skill on the given hand to be skill with name skillName.
Waits up to one second for the skill to be set.
Todo: Fix argc < 1, should be argc < 2
Parameters
-
skillName
Name of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right.
Returns
Whether operation was successful.
public bool
setSkill
(
int
nSkillId,
int
nHand)
Set the skill on the given hand to be skill with id nSkillId.
Waits up to one second for the skill to be set.
Todo: Fix argc < 1, should be argc < 2
Parameters
-
nSkillId
Id of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right.
Returns
Whether operation was successful.
public bool
setSkill
(String skillName,
int
nHand,
Unit
item)
Set the skill on the given hand to be skill with name skillName.
Waits up to one second for the skill to be set.
Todo: Fix argc < 1, should be argc < 2
Parameters
-
skillName
Name of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right. -
item
The item that the skill is attached to.
Returns
Whether operation was successful.
public bool
setSkill
(
int
nSkillId,
int
nHand,
Unit
item)
Set the skill on the given hand to be skill with id nSkillId.
Waits up to one second for the skill to be set.
Todo: Fix argc < 1, should be argc < 2
Parameters
-
nSkillId
Id of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right. -
item
The item that the skill is attached to.
Returns
Whether operation was successful.
public void
move
(
int
x,
int
y)
Move to the given location.
Parameters
-
x
The x location. -
y
The y location.
public void
move
()
Move to this unit.
public
int
getQuest
(
int
nAct,
int
nQuest)
Get the quest flag for a quest specified by act and quest number.
Parameters
-
nAct
The act of the quest. -
nQuest
The quest number.
Returns
The quest flag for the specified quest.
public
int
getMinionCount
(
int
nType)
Get the number of minions of a certain type.
Parameters
nType
The type of the minions.
Returns
The number of minions of the specified type.
public
int
getRepairCost
(
int
nNpcClassId)
Get price to repair this unit at the current npc given by nNpcClassId.
Parameters
nNpcClassId
The class id of the npc to get the price for repair at.
Returns
The price to repair the given unit.
public
int
getItemCost
(
int
nMode,
Unit
npc)
Get the cost to do something (buy, sell, repair) with the given item, at the given npc.
Parameters
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
npc
The npc to check the price with.
Returns
The price.
public
int
getItemCost
(
int
nMode,
Unit
npc,
int
nDifficulty)
Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.
Parameters
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
npc
The npc to check the price with. -
nDifficulty
The difficulty to check the price in.
Returns
The price.
public
int
getItemCost
(
int
nMode,
int
nNpcClassId)
Get the cost to do something (buy, sell, repair) with the given item, at the given npc.
Parameters
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
nNpcClassId
The class id of the npc to check the price with.
Returns
The price.
public
int
getItemCost
(
int
nMode,
int
nNpcClassId,
int
nDifficulty)
Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.
Parameters
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
nNpcClassId
The class id of the npc to check the price with. -
nDifficulty
The difficulty to check the price in.
Returns
The price.
Party
class Represents the items in the list in the Party screen.
Also called a RosterUnit.
Summary
Members | Descriptions |
---|---|
public int x |
The x coordinate of the location of the RosterUnit. |
public int y |
The y coordinate of the location of the RosterUnit. |
public int area |
The Area ID of the RosterUnit. |
public double gid |
The unique id of the RosterUnit. |
public int life |
The life of the RosterUnit. |
public int partyflag |
The Party flags of the RosterUnit. |
public int partyid |
The Party ID. |
public String name |
The name of the RosterUnit. |
public int classid |
The class ID of the RosterUnit. |
public int level |
The character level of the RosterUnit. |
public void getNext () |
Move to the next RosterUnit. |
Members
public
int
x
The x coordinate of the location of the RosterUnit.
public
int
y
The y coordinate of the location of the RosterUnit.
public
int
area
The Area ID of the RosterUnit.
public double
gid
The unique id of the RosterUnit.
public
int
life
The life of the RosterUnit.
Todo: Determine how one is to get the maximum life of the RosterUnit.
public
int
partyflag
The Party flags of the RosterUnit.
Todo: Determine the values that this can take on.
public
int
partyid
The Party ID.
Todo: Determine what a Party ID is.
public String
name
The name of the RosterUnit.
public
int
classid
The class ID of the RosterUnit.
See Unit::classId.
public
int
level
The character level of the RosterUnit.
Todo: Verify that this level is the character level.
public void
getNext
()
Move to the next RosterUnit.
PresetUnit
class Represents a PresetUnit (a type of Unit that is available as soon as the Area data is available).
Todo: Determine how location is determine based off roomx, roomy, x, and y.
Summary
Members | Descriptions |
---|---|
public int type |
The type ID. |
public int roomx |
The room X (?). |
public int roomy |
The room Y (?). |
public int x |
The X coordinate (?). |
public int y |
The Y coordinate (?). |
public int id |
The unique ID of the PresetUnit. |
public int level |
The Area ID of the Area the PresetUnit is in. |
Members
public
int
type
The type ID.
See Unit::type.
public
int
roomx
The room X (?).
public
int
roomy
The room Y (?).
public
int
x
The X coordinate (?).
public
int
y
The Y coordinate (?).
public
int
id
The unique ID of the PresetUnit.
public
int
level
The Area ID of the Area the PresetUnit is in.
Profile
class This class represents the details needed to get a player to a game or lobby.
This class hides the password. It provides the login() method to use the password.
Summary
Members | Descriptions |
---|---|
public ProfileType type |
The type of profile, see ProfileType. |
public String ip |
The IP of the game to connect to (TCP/IP join). |
public String username |
The username to use to connect to battle.net. |
public union Profile::@0 gateway |
The battle.net gateway to connect to. |
public String character |
The character to select. |
public int8_t difficulty |
The difficulty to use: 0 - normal, 1 - nightmare, 2 - hell. |
public uint32_t maxLoginTime |
The number of milliseconds to wait while logging in. |
public uint32_t maxCharacterSelectTime |
The number of milliseconds to wait for the characters to load. |
public Profile () |
Create a Profile for the currently set profile. |
public Profile (String profileName) |
Create a Profile for the named profile. |
public Profile (ProfileType pt,String charName,int8_t diff) |
Create a Profile with the given information. |
public Profile (ProfileType pt,String account,String pass,String charName,String gateway) |
Create a Profile with the given information. |
public Profile (ProfileType pt,String charName,String ip) |
Create a Profile with the given information. |
public void login () |
Log the profile in. |
Members
public ProfileType
type
The type of profile, see ProfileType.
public String
ip
The IP of the game to connect to (TCP/IP join).
public String
username
The username to use to connect to battle.net.
public union Profile::@0
gateway
The battle.net gateway to connect to.
public String
character
The character to select.
public int8_t
difficulty
The difficulty to use: 0 - normal, 1 - nightmare, 2 - hell.
public uint32_t
maxLoginTime
The number of milliseconds to wait while logging in.
public uint32_t
maxCharacterSelectTime
The number of milliseconds to wait for the characters to load.
public
Profile
()
Create a Profile for the currently set profile.
public
Profile
(String profileName)
Create a Profile for the named profile.
Parameters
profileName
Name of the profile to load.
public
Profile
(ProfileType pt,String charName,int8_t diff)
Create a Profile with the given information.
Parameters
-
pt
The type of profile, this constructor handles singlePlayer and tcpIpHost types. -
charName
Name of the character. -
diff
Difficulty, 0 - normal, 1 - nightmare, 2 - hell.
public
Profile
(ProfileType pt,String account,String pass,String charName,String gateway)
Create a Profile with the given information.
Parameters
-
pt
The type of profile, this constructor handles battleNet and openBattleNet types. -
account
Account name. -
pass
Password. -
charName
Name of the character. -
gateway
Search string for the gateway (any substring of the desired gateway, will take first gateway that matches).
public
Profile
(ProfileType pt,String charName,String ip)
Create a Profile with the given information.
Parameters
-
pt
The type of profile, this constructor handles singlePlayer and tcpIpHost types. -
charName
Name of the character. -
ip
IP address to connect to.
public void
login
()
Log the profile in.
Room
class Represents a "Room" in the game.
A Room is a rectangular piece of the map data. It has pointers to many lists, such as a list of PresetUnit s.
Summary
Members | Descriptions |
---|---|
public int number |
Get the Room number. |
public int x |
Get the x coordinate of the Room. |
public int y |
Get the y coordinate of the Room. |
public int xsize |
Get the x size (width) of the Room. |
public int ysize |
Get the y size (height) of the Room. |
public int subnumber |
No implementation. |
public int area |
Get the Area ID for the area which the Room is in. |
public int level |
Get the Area ID for the area which the Room is in. |
public int correcttomb |
Get the correct tomb. |
public bool getNext () |
Move to the next Room. |
public bool reveal () |
Reveal the Room on the map. |
public PresetUnit getPresetUnits ( int nType, int nClass) |
Get the PresetUnit s from the current Room. |
public int getCollision () |
Get the collision data for the Room. |
public Room getNearby () |
Get the "nearby" Rooms from pRoom2Near member. |
public int getStat ( int nStat) |
Get some property of the Room. |
public Room getFirst () |
Get the first Room of the level this Room is on. |
public bool unitInRoom ( Unit unit) |
Determine whether or not the Unit is in the Room. |
Members
public
int
number
Get the Room number.
Todo: Determine what a "room number" is.
public
int
x
Get the x coordinate of the Room.
public
int
y
Get the y coordinate of the Room.
public
int
xsize
Get the x size (width) of the Room.
public
int
ysize
Get the y size (height) of the Room.
public
int
subnumber
No implementation.
public
int
area
Get the Area ID for the area which the Room is in.
public
int
level
Get the Area ID for the area which the Room is in.
public
int
correcttomb
Get the correct tomb.
Todo: Determine if this is the Area ID of the correct tomb.
Todo: Determine what Room s this is valid on.
public bool
getNext
()
Move to the next Room.
Returns
Whether there was another Room to move to or not.
public bool
reveal
()
Reveal the Room on the map.
Returns
Whether or not the Room was successfully revealed.
public
PresetUnit
getPresetUnits
(
int
nType,
int
nClass)
Get the PresetUnit s from the current Room.
Parameters
-
nType
The type of Unit to get. See Unit::type. -
nClass
The class id of the Unit (s) to find. See Unit::classId.
Returns
An array of all the PresetUnit s from the current Room.
public
int
getCollision
()
Get the collision data for the Room.
Todo: Verify that the array does actually have reverse of usual dimensions.
Returns
An array with the collision data. The first dimension is the y coordinate, the second is the x coordinate.
public
Room
getNearby
()
Get the "nearby" Rooms from pRoom2Near member.
Returns
An array of the nearby Rooms.
public
int
getStat
(
int
nStat)
Get some property of the Room.
Parameters
nStat
Which property to get:
0 - xStart (room 1)
1 - yStart (room 1)
2 - xSize (room 1)
3 - ySize (room 1)
4 - posX (room 2)
5 - posY (room 2)
6 - sizeX (room 2)
7 - sizeY (room 2)
9 - posGameX (coll)
10 - posGameY (coll)
11 - sizeGameX (coll)
12 - sizeGameY (coll)
13 - posRoomX (coll)
14 - posGameY (coll)
15 - sizeRoomX (coll)
16 - sizeRoomY (coll)
Returns
The stat value.
public
Room
getFirst
()
Get the first Room of the level this Room is on.
Returns
The first Room.
public bool
unitInRoom
(
Unit
unit)
Determine whether or not the Unit is in the Room.
Parameters
unit
The unit to check.
Returns
Whether or not the Unit is in the Room.
Sandbox
class A separate context to run scripts in.
Summary
Members | Descriptions |
---|---|
public Sandbox () |
Create a Sandbox. |
public Object evaluate (String code) |
Evaluate the code passed in and return the result. |
public Object include (String file) |
Include a file from ScriptPath\libs\file. |
public bool isInclude (String file) |
Determine whether a file has been included yet or not. |
public void clearScope () |
Clear the scope of the Sandbox's global object. |
Members
public
Sandbox
()
Create a Sandbox.
This creates a separate context to run things in.
public Object
evaluate
(String code)
Evaluate the code passed in and return the result.
Parameters
code
The code to run, literally JavaScript code to run.
Returns
The result of the last expression statement.
public Object
include
(String file)
Include a file from ScriptPath\libs\file.
Parameters
file
The filename relative to ScriptPath\libs to include.
Returns
The result of the last expression statement.
public bool
isInclude
(String file)
Determine whether a file has been included yet or not.
Parameters
file
The filename relative to ScriptPath\libs to include.
Returns
Whether or not the file has been included.
public void
clearScope
()
Clear the scope of the Sandbox's global object.
Todo: Clarify what this means (i.e. post-conditions).
SQLite
class Class for dealing with an SQLite database.
Summary
Members | Descriptions |
---|---|
public String path |
Get the path used to open the database. |
public DBStatement statements |
Get all the statements that have been queried. |
public bool isOpen |
Whether or not the database is open. |
public int lastRowId |
Get the row id of the last inserted row. |
public double changes |
Get the number of rows modified/inserted/deleted by the last statement. |
public SQLite (String path,bool autoOpen) |
Create a database object which can be used to open SQLite databases and execute queries. |
public bool execute (String queryString) |
Execute a query on the database. |
public DBStatement query (String sql,...) |
Do a sqlite3_prepare_v2 on the database with sql, then call the appropriate sqlite3_bind_ functions on the remaining parameters. |
public bool open () |
Open the database. |
public bool close () |
Close the database. |
Members
public String
path
Get the path used to open the database.
public
DBStatement
statements
Get all the statements that have been queried.
public bool
isOpen
Whether or not the database is open.
public
int
lastRowId
Get the row id of the last inserted row.
public double
changes
Get the number of rows modified/inserted/deleted by the last statement.
public
SQLite
(String path,bool autoOpen)
Create a database object which can be used to open SQLite databases and execute queries.
Parameters
-
path
The path to the database to open. -
autoOpen
Whether to open the database immediately or not.
public bool
execute
(String queryString)
Execute a query on the database.
Parameters
queryString
The query string to execute.
Returns
true
public
DBStatement
query
(String sql,...)
Do a sqlite3_prepare_v2 on the database with sql, then call the appropriate sqlite3_bind_ functions on the remaining parameters.
Parameters
sql
The query to pass to sqlite3_prepare v2.
Todo: Determine what this function does (better documenation).
Returns
The resulting DBStatement.
public bool
open
()
Open the database.
Returns
true
public bool
close
()
Close the database.
Returns
true
Text
class A Text screen hook.
Todo: Verify all the documentation in this class.
Summary
Members | Descriptions |
---|---|
public int x |
The x coordinate (left) of the Text. |
public int y |
The y coordinate (top) of the Text. |
public bool visible |
Whether or not the Text is visible. |
public int align |
The horizontal alignment. |
public int zorder |
The z-order of the Text (what it covers up and is covered by). |
public ClickHandler click |
The click handler that gets called when the Text is clicked. |
public HoverHandler hover |
The hover handler that gets called when the Text gets hovered over. |
public int color |
The color of the Text. |
public int font |
Something that determines the font. |
public String text |
The string that the Text hook displays. |
public Text (String szText, int x, int y, int color, int font, int align,bool automap,ClickHandler click,HoverHandler hover) |
Create a Text hook with the given parameters. |
public void remove () |
Remove the Text hook from the screen and destroy the corresponding object. |
Members
public
int
x
The x coordinate (left) of the Text.
public
int
y
The y coordinate (top) of the Text.
public bool
visible
Whether or not the Text is visible.
public
int
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
public
int
zorder
The z-order of the Text (what it covers up and is covered by).
public ClickHandler
click
The click handler that gets called when the Text is clicked.
public HoverHandler
hover
The hover handler that gets called when the Text gets hovered over.
public
int
color
The color of the Text.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
public
int
font
Something that determines the font.
public String
text
The string that the Text hook displays.
public
Text
(String szText,
int
x,
int
y,
int
color,
int
font,
int
align,bool automap,ClickHandler click,HoverHandler hover)
Create a Text hook with the given parameters.
Parameters
-
szText
The string that the Text hook displays. -
x
The x coordinate (left) of the Text. -
y
The y coordinate (top) of the Text. -
color
The color of the Text.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
Parameters
-
font
Something that determines the font. -
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
Parameters
-
automap
Whether the Text is in automap coordinate space (true) or screen coordinate space (false). -
click
The click handler that gets called when the Text is clicked. -
hover
The hover handler that gets called when the Text gets hovered over.
public void
remove
()
Remove the Text hook from the screen and destroy the corresponding object.
Unit
class This class represents a unit (monster, wp, npc, character, etc) in the game.
Summary
Members | Descriptions |
---|---|
public int type |
The type of the unit. |
public int classid |
The class id of the object. |
public int mode |
The mode of the unit. |
public String name |
The name of the unit. |
public int act |
The act where the unit is currently located. |
public int gid |
The unit unique id. |
public int x |
The x location of the unit. |
public int y |
The y location of the unit. |
public int targetx |
The target x location of the unit. |
public int targety |
The target y location of the unit. |
public int area |
The id of the area (level) the unit is located in. |
public int hp |
The unit's current health. |
public int hpmax |
The unit's maximum health. |
public int mp |
The unit's current mana. |
public int mpmax |
The unit's maximum mana. |
public int stamina |
The unit's current stamina. |
public int staminamax |
The unit's maximum stamina. |
public int charlvl |
The character level. |
public int itemcount |
The number of items in inventory. |
public int owner |
The unit id of the owner of the unit. |
public int ownertype |
The type of owner. |
public int spectype |
The special type of the unit. |
public int direction |
The direction of the unit. |
public int uniqueid |
The unique id of a boss. |
public String code |
The three digit code for an item. |
public String prefix |
The magic prefix of the item. |
public String suffix |
The magic suffix of the item. |
public String[] prefixes |
The magic prefixes of the item. |
public String[] suffixes |
The magic suffixes of the item. |
public int prefixnum |
The id code for the magic prefix. |
public int suffixnum |
The id code for the magic suffix. |
public int prefixnums |
The id codes for the magic prefixes. |
public int suffixnums |
The id codes for the magic suffixes. |
public String fname |
The full name of an item. |
public int quality |
The item quality. |
public int node |
No clue. |
public int location |
The location of the item (ground, inventory, stash, etc.). |
public int sizex |
The x size of the item. |
public int sizey |
The y size of the item. |
public int itemType |
The type of the item. |
public String description |
The description of the item. |
public int bodylocation |
The equipped location of the item. |
public int ilvl |
Item level. |
public int lvlreq |
Level requirement (character level required to use the item). |
public int gfx |
Get the id for the graphic used for the item. |
public int runwalk |
Whether the controlled character is in the always run mode or not. |
public int weaponswitch |
Set the weapon switch. |
public int objtype |
The object type. |
public int islocked |
Whether or not the chest is locked. |
public bool getNext () |
Get the next unit that matches the originally given name or class id and originally specified mode. |
public bool getNext (String szName) |
Get the next unit that matches the given name and originally specified mode. |
public bool getNext (uint32_t dwClassId) |
Get the next unit that matches the given class id and originally specified mode. |
public bool getNext (String szName,uint32_t dwMode) |
Get the next unit that matches the given name and mode. |
public bool getNext (uint32_t dwClassId,uint32_t dwMode) |
Get the next unit that matches the given class id and mode. |
public void cancel () |
Cancel whatever's going on. |
public bool repair () |
Try to repair. |
public bool useMenu ( int menuItem) |
Use an NPC menu. |
public bool interact () |
Interact with the unit. |
public bool interact ( int destId) |
Interact with a waypoint. |
public Unit getItem (String name,uint32_t mode,uint32_t nUnitId) |
Get an item from inventory by name, mode and nUnitId. |
public Unit getItem (uint32_t classId,uint32_t mode,uint32_t nUnitId) |
Get an item from inventory by classId, mode and nUnitId. |
public Unit getItems () |
Get all items from inventory. |
public bool getMerc (bool dummy) |
Get whether this player has a merc. |
public Unit getMerc () |
Get a player's merc. |
public String getSkill ( int hand) |
Get skill name from hand. |
public int getSkill ( int hand) |
Get skill id from hand. |
public int getSkill ( int dummy) |
Get all skills. |
public int getSkill ( int nSkillId, int nExt) |
Calls D2COMMON_GetSkillLevel and returns the result. |
public Unit getParent () |
Gets the parent of a unit. |
public String getParent () |
Gets the parent of a unit. |
public void overhead (Object message) |
Puts the string equivalent of message over the unit. |
public int getFlags () |
Returns the item flags. |
public bool getFlag ( int flags) |
Same as getFlags, but returns a boolean. |
public double getStat ( int nStat, int nSubIndex) |
Get a stat by stat id and sub index. |
public int getStat ( int nStat, int nSubIndex) |
Get a stat by stat id and sub index. |
public int getStat ( int nStat, int nSubIndex) |
Get an array of all the stats of the item. |
public bool getState ( int nState) |
Return whether or not the unit has a given state. |
public int getPrice ( Unit npc, int buysell) |
Get the price of the item at a given npc, with choice of buying or selling, in the current difficulty. |
public int getPrice ( int npcId, int buysell) |
Get the price of the item at a given npc (by id), which choice of buying or selling, in the current difficulty. |
public int getPrice ( Unit npc, int buysell, int difficulty) |
Get the price of the item at a given npc, with choice of buying or selling, in a given difficulty. |
public int getPrice ( int npcId, int buysell, int difficulty) |
Get the price of the item at a given npc (by id), with choice of buying or selling, in a given difficulty. |
public bool getEnchant ( int nEnchant) |
Determine whether or not a unit has a given enchant. |
public bool shop ( int dwMode) |
Shop with a given npc, either buying or selling. |
public bool setSkill (String skillName, int nHand) |
Set the skill on the given hand to be skill with name skillName. |
public bool setSkill ( int nSkillId, int nHand) |
Set the skill on the given hand to be skill with id nSkillId. |
public void move ( int x, int y) |
Move to the given location. |
public void move () |
Move to this unit. |
public int getQuest ( int nAct, int nQuest) |
Get the quest flag for a quest specified by act and quest number. |
public int getMinionCount ( int nType) |
Get the number of minions of a certain type. |
public int getRepairCost ( int nNpcClassId) |
Get price to repair this unit at the current npc given by nNpcClassId. |
public int getItemCost ( int nMode, int nNpcClassId) |
Get the cost to do something (buy, sell, repair) with the given item, at the given npc. |
public int getItemCost ( int nMode, int nNpcClassId, int nDifficulty) |
Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty. |
public int getItemCost ( int nMode, Unit npc, int nDifficulty) |
Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty. |
public int getItemCost ( int nMode, Unit npc) |
Get the cost to do something (buy, sell, repair) with the given item, at the given npc. |
Members
public
int
type
The type of the unit.
0 - Player
1 - NPC
2 - Object
3 - Missile
4 - Item
5 - Warp
Source: botNET
public
int
classid
The class id of the object.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1002
http://forums.d2botnet.org/viewtopic.php?f=18&t=986 and
http://forums.d2botnet.org/viewtopic.php?f=18&t=985
public
int
mode
The mode of the unit.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=988
public String
name
The name of the unit.
public
int
act
The act where the unit is currently located.
public
int
gid
The unit unique id.
Referred to simply as the unit id. Used along with the unit type to uniquely identify the unit.
public
int
x
The x location of the unit.
public
int
y
The y location of the unit.
public
int
targetx
The target x location of the unit.
Where the game is taking the unit.
public
int
targety
The target y location of the unit.
Where the game is taking the unit.
public
int
area
The id of the area (level) the unit is located in.
Todo: Get a reference for the area IDs.
public
int
hp
The unit's current health.
public
int
hpmax
The unit's maximum health.
public
int
mp
The unit's current mana.
public
int
mpmax
The unit's maximum mana.
public
int
stamina
The unit's current stamina.
public
int
staminamax
The unit's maximum stamina.
public
int
charlvl
The character level.
The level that determines stat points, skill levels, etc.
public
int
itemcount
The number of items in inventory.
public
int
owner
The unit id of the owner of the unit.
public
int
ownertype
The type of owner.
public
int
spectype
The special type of the unit.
Represents things like unique, minion, boss, etc.
1 - "Normal" Boss 2 - Champion 4 - Boss 8 - Minion
public
int
direction
The direction of the unit.
Todo: Figure out what the direction is.
public
int
uniqueid
The unique id of a boss.
Taken from pUnit->pMonsterData->wUniqueNo. Not the same thing as the gid (unit id).
public String
code
The three digit code for an item.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=991
public String
prefix
The magic prefix of the item.
public String
suffix
The magic suffix of the item.
public String[]
prefixes
The magic prefixes of the item.
public String[]
suffixes
The magic suffixes of the item.
public
int
prefixnum
The id code for the magic prefix.
public
int
suffixnum
The id code for the magic suffix.
public
int
prefixnums
The id codes for the magic prefixes.
public
int
suffixnums
The id codes for the magic suffixes.
public String
fname
The full name of an item.
public
int
quality
The item quality.
1 - Low quality
2 - Normal
3 - Superior
4 - Magic
5 - Set
6 - Rare
7 - Unique
8 - Crafted
Source: botNET
public
int
node
No clue.
Todo: Get a clue.
public
int
location
The location of the item (ground, inventory, stash, etc.).
0 - Ground
1 - Equipped
2 - Belt
3 - Inventory
4 - Store
5 - Trade
6 - Cube
7 - Stash
Source: d2botnet code
public
int
sizex
The x size of the item.
public
int
sizey
The y size of the item.
public
int
itemType
The type of the item.
Todo: Put together a reference for item type.
public String
description
The description of the item.
public
int
bodylocation
The equipped location of the item.
0 - Not equipped
1 - Helmet
2 - Amulet
3 - Armor
4 - Right hand slot 1
5 - Left hand slot 1
6 - Right ring
7 - Left ring
8 - Belt
9 - Boots
10 - Gloves
11 - Right hand slot 2
12 - Left hand slot 2
public
int
ilvl
Item level.
Used for things like item stat rolling.
public
int
lvlreq
Level requirement (character level required to use the item).
public
int
gfx
Get the id for the graphic used for the item.
public
int
runwalk
Whether the controlled character is in the always run mode or not.
0 - Walk unless directed to run 1 - Always run
public
int
weaponswitch
Set the weapon switch.
public
int
objtype
The object type.
Todo: Figure out what this means.
public
int
islocked
Whether or not the chest is locked.
public bool
getNext
()
Get the next unit that matches the originally given name or class id and originally specified mode.
Returns
Whether another unit was found.
public bool
getNext
(String szName)
Get the next unit that matches the given name and originally specified mode.
Parameters
szName
The name to look for.
Returns
Whether another unit was found.
public bool
getNext
(uint32_t dwClassId)
Get the next unit that matches the given class id and originally specified mode.
Parameters
dwClassId
The class id to look for.
Returns
Whether another unit was found.
public bool
getNext
(String szName,uint32_t dwMode)
Get the next unit that matches the given name and mode.
Parameters
-
szName
The name to look for. -
dwMode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for.
Returns
Whether another unit was found.
public bool
getNext
(uint32_t dwClassId,uint32_t dwMode)
Get the next unit that matches the given class id and mode.
Parameters
-
dwClassId
The class id to look for. -
dwMode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for.
Returns
Whether another unit was found.
public void
cancel
()
Cancel whatever's going on.
If there's scrolling text clear it. If you're interacting to an NPC, stop. If there's an item on the cursor, drop it. Otherwise close any other interaction that might be going on.
public bool
repair
()
Try to repair.
Need to be able to find unit that you're trying to repair with. That means the unit needs to still be in the server unit hash table.
Returns
true if successful.
public bool
useMenu
(
int
menuItem)
Use an NPC menu.
Need to be able to find unit that you're trying to repair with. That means the unit needs to still be in the server unit hash table.
Parameters
menuItem
Index of the menu item to click.
Returns
true if menu was found.
public bool
interact
()
Interact with the unit.
If the unit is an item in inventory or stash pick it up. Otherwise click it on the map.
public bool
interact
(
int
destId)
Interact with a waypoint.
If the unit is an object, assume it's a waypoint, and take it.
Parameters
destId
The area id of the destination to select.
public
Unit
getItem
(String name,uint32_t mode,uint32_t nUnitId)
Get an item from inventory by name, mode and nUnitId.
Parameters
-
name
The name of the unit to look for. -
mode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for. -
nUnitId
The unique id of the unit.
Returns
The first item found that matches the description.
public
Unit
getItem
(uint32_t classId,uint32_t mode,uint32_t nUnitId)
Get an item from inventory by classId, mode and nUnitId.
Parameters
-
classId
The class id of the unit. -
mode
Either the mode being searched for, or a bitmask with bit 29 set and bits 0-28 corresponding to modes of units being searched for. -
nUnitId
The unique id of the unit.
Returns
The first item found that matches the description.
public
Unit
getItems
()
Get all items from inventory.
Returns
An array of all the items from inventory.
public bool
getMerc
(bool dummy)
Get whether this player has a merc.
The unit being operated on should be a player.
Parameters
dummy
Used to signify boolean result instead of object. Should be true.
Returns
true if the player has a live merc.
public
Unit
getMerc
()
Get a player's merc.
The unit being operated on should be a player.
Returns
The merc if there is one.
public String
getSkill
(
int
hand)
Get skill name from hand.
Parameters
hand
Hand to get the skill name off.
0 - Right hand
1 - Left hand
Returns
Skill name.
public
int
getSkill
(
int
hand)
Get skill id from hand.
Parameters
hand
Hand to get the skill id off.
2 - Right hand
3 - Left hand
Returns
Skill id.
public
int
getSkill
(
int
dummy)
Get all skills.
Gets all skill ids, along with corresponding base and total skill levels.
Parameters
dummy
Should be 4.
Returns
An array of arrays of integers. Inside the inner array the 0th index is the skill id, the 1st index is the base skill level and the 2nd index is the total skill level. Only the first 256 skills are read.
public
int
getSkill
(
int
nSkillId,
int
nExt)
Calls D2COMMON_GetSkillLevel and returns the result.
Todo: Figure out what D2COMMON_GetSkillLevel does.
Returns
Whatever D2COMMON_GetSkillLevel returns.
public
Unit
getParent
()
Gets the parent of a unit.
This function is used for monster and item units.
Returns
The parent unit.
public String
getParent
()
Gets the parent of a unit.
This function is used for object units.
Returns
The parent's name.
public void
overhead
(Object message)
Puts the string equivalent of message over the unit.
public
int
getFlags
()
Returns the item flags.
Returns
Item flags:
0x00000001 - Equipped
0x00000008 - In socket
0x00000010 - Identified
0x00000040 - Weapon/shield is in the active weapon switch
0x00000080 - Weapon/shield is in the inactive weapon switch
0x00000100 - Item is broken
0x00000400 - Full rejuv
0x00000800 - Socketed
0x00002000 - In the trade or gamble screen
0x00004000 - Not in a socket
0x00010000 - Is an ear
0x00020000 - A starting item (worth only 1 gold)
0x00200000 - Rune, or potion, or mephisto's soulstone
0x00400000 - Ethereal
0x00800000 - Is an item
0x01000000 - Personalized
0x04000000 - Runeword
Source: http://subversion.assembla.com/svn/d2bs/scripts/YAMB/libs/YAMB/common/YAM-Common.dbl r1086
public bool
getFlag
(
int
flags)
Same as getFlags, but returns a boolean.
Returns true if any of the flags given match the item flags.
Parameters
flags
Flags to check.
Returns
true if any of the flags are set in the item flags.
public double
getStat
(
int
nStat,
int
nSubIndex)
Get a stat by stat id and sub index.
Used for stat 13.
Parameters
-
nStat
The stat type. See http://forums.d2botnet.org/viewtopic.php?f=18&t=989 -
nSubIndex
A subindex to a certain type of stat. For instance a specific skill for the +1 to skill tab stat.
Returns
The stat value.
public
int
getStat
(
int
nStat,
int
nSubIndex)
Get a stat by stat id and sub index.
Used for everything except stat 13.
Parameters
-
nStat
The stat type. See http://forums.d2botnet.org/viewtopic.php?f=18&t=989 -
nSubIndex
A subindex to a certain type of stat. For instance a specific skill for the +1 to skill tab stat.
Returns
The stat value.
public
int
getStat
(
int
nStat,
int
nSubIndex)
Get an array of all the stats of the item.
Parameters
-
nStat
Set to -1. -
nSubIndex
Ignored.
Returns
An array of the first 64 stats. The indices of the inner array are: 0 - nStat, 1 - nSubIndex, 2 - nValue.
public bool
getState
(
int
nState)
Return whether or not the unit has a given state.
Parameters
nState
The state id.
Returns
Whether or not the unit has the state.
public
int
getPrice
(
Unit
npc,
int
buysell)
Get the price of the item at a given npc, with choice of buying or selling, in the current difficulty.
Todo: Determine the meaning of "buysell".
Parameters
-
npc
The npc to determine the price at. -
buysell
Unknown
Returns
The price requested.
public
int
getPrice
(
int
npcId,
int
buysell)
Get the price of the item at a given npc (by id), which choice of buying or selling, in the current difficulty.
Todo: Determine the meaning of "buysell".
Parameters
-
npcId
The id of the npc to determine the price at. -
buysell
Unknown
Returns
The price requested.
public
int
getPrice
(
Unit
npc,
int
buysell,
int
difficulty)
Get the price of the item at a given npc, with choice of buying or selling, in a given difficulty.
Todo: Determine the meaning of "buysell".
Parameters
-
npc
The npc to determine the price at. -
buysell
Unknown -
difficulty
The difficulty of interest: 0 - normal, 1 - nightmare, 2 - hell
Returns
The price requested.
public
int
getPrice
(
int
npcId,
int
buysell,
int
difficulty)
Get the price of the item at a given npc (by id), with choice of buying or selling, in a given difficulty.
Todo: Determine the meaning of "buysell".
Parameters
-
npcId
The id of the npc to determine the price at. -
buysell
Unknown -
difficulty
The difficulty of interest: 0 - normal, 1 - nightmare, 2 - hell
Returns
The price requested.
public bool
getEnchant
(
int
nEnchant)
Determine whether or not a unit has a given enchant.
Parameters
nEnchant
Enchantment id.
Returns
Whether or not the unit has the enchantment.
public bool
shop
(
int
dwMode)
Shop with a given npc, either buying or selling.
Parameters
dwMode
What to do with the item. 1 - Sell, 2 - Buy, 6 - ?
Returns
Whether or not the shop went through.
public bool
setSkill
(String skillName,
int
nHand)
Set the skill on the given hand to be skill with name skillName.
Waits up to one second for the skill to be set.
Todo: Fix argc < 1, should be argc < 2
Parameters
-
skillName
Name of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right.
Returns
Whether operation was successful.
public bool
setSkill
(
int
nSkillId,
int
nHand)
Set the skill on the given hand to be skill with id nSkillId.
Waits up to one second for the skill to be set.
Todo: Fix argc < 1, should be argc < 2
Parameters
-
nSkillId
Id of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right.
Returns
Whether operation was successful.
public void
move
(
int
x,
int
y)
Move to the given location.
Parameters
-
x
The x location. -
y
The y location.
public void
move
()
Move to this unit.
public
int
getQuest
(
int
nAct,
int
nQuest)
Get the quest flag for a quest specified by act and quest number.
Parameters
-
nAct
The act of the quest. -
nQuest
The quest number.
Returns
The quest flag for the specified quest.
public
int
getMinionCount
(
int
nType)
Get the number of minions of a certain type.
Parameters
nType
The type of the minions.
Returns
The number of minions of the specified type.
public
int
getRepairCost
(
int
nNpcClassId)
Get price to repair this unit at the current npc given by nNpcClassId.
Parameters
nNpcClassId
The class id of the npc to get the price for repair at.
Returns
The price to repair the given unit.
public
int
getItemCost
(
int
nMode,
int
nNpcClassId)
Get the cost to do something (buy, sell, repair) with the given item, at the given npc.
Parameters
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
nNpcClassId
The class id of the npc to check the price with.
Returns
The price.
public
int
getItemCost
(
int
nMode,
int
nNpcClassId,
int
nDifficulty)
Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.
Parameters
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
nNpcClassId
The class id of the npc to check the price with. -
nDifficulty
The difficulty to check the price in.
Returns
The price.
public
int
getItemCost
(
int
nMode,
Unit
npc,
int
nDifficulty)
Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.
Parameters
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
npc
The npc to check the price with. -
nDifficulty
The difficulty to check the price in.
Returns
The price.
public
int
getItemCost
(
int
nMode,
Unit
npc)
Get the cost to do something (buy, sell, repair) with the given item, at the given npc.
Parameters
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
npc
The npc to check the price with.
Returns
The price.
Generated by Moxygen