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. |
Get a unit by type, name, mode and nUnitId.
-
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.
The first unit found that matches the description.
Get a unit by type, classId, mode and nUnitId.
-
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.
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.
-
[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.
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.
-
[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.
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.
-
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.
The collision flags. For details see: http://forums.d2botnet.org/viewtopic.php?f=18&t=1212 .
Get the health points of the controlled unit's merc.
The health points.
public
int
getCursorType
()
Get the cursor type from p_D2CLIENT_RegularCursorType.
Todo: Determine what the return value means.
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.
nType
What type of cursor to get. 1 - ShopCursorType, other - RegularCursorType.
Todo: Determine what the return value means.
The cursor type.
public
int
getSkillByName
(String skillName)
Get skill ID by name.
skillName
The skill name.
The skill ID.
public String
getSkillById
(
int
skillId)
Get skill name by ID.
skillId
The skill ID.
The skill name.
public String
getLocaleString
(uint16_t localeId)
Get the String in the current locale that corresponds to the given id.
localeId
The id of the String.
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.
-
string
The string to get the size of. -
font
The font to use. -
asObject
False to return as an array.
The width and height of the text. 0 - width, 1 - height.
-
string
The string to get the size of. -
font
The font to use. -
asObject
True to return as an object.
The width and height of the text. Has properties .width and .height.
public
int
getThreadPriority
()
Get the priority of the current thread.
The priority.
Get whether or not a UI flag is set.
Todo: Get a reference for the UI IDs.
nUIId
The ID of the UI in question.
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.
nMode
What to return. 0 - TradeFlag, 2 - RecentTradeId.
The TradeFlag or RecentTradeId.
Currently broken, returns null.
Todo: Determine what these are.
nMode
What to return. 1 - RecentTradeName.
The RecentTradeName.
public bool
getWaypoint
(
int
nWaypointId)
Get whether the controlled unit has the given waypoint.
nWaypointId
The area id of the waypoint in question.
Whether or not the controlled unit has the waypoint.
public
D2BSScript
getScript
(bool currentScript)
Get the current or first context.
currentScript
Whether to get the current script (true) or the first (false).
A D2BSScript object for the request script.
public
D2BSScript
getScript
(
int
threadId)
Get a script by thread id.
threadId
The thread id of the script to get.
A D2BSScript object for the script from the given thread.
public
D2BSScript
getScript
(String name)
Get a script by filename.
name
The filename of the script to find.
A D2BSScript object for the script.
public
D2BSScript
getScript
()
Get the first script.
A D2BSScript representing the first script in the runtime.
Get the first room in area given by level id.
levelId
The id of the area to get the room from, or 0 to get the room the controlled unit is in.
The first room in the area.
Get the room that the given point is in from the given level id.
-
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.
The room at the given point.
Get the room that the given point is in.
-
x
The x coordinate to find a room for. -
y
The y coordinate to find a room for.
The room at the given point.
Get the first room in the current area.
The first room in the current area.
Get the first party.
The first party.
Get the party line for the player with the given name.
name
The name of the player to search for
The party line
Get the party line for the player with the given player id.
playerId
The party line
Get the party line that corresponds to the given unit.
player
Unit
The party line
public
PresetUnit
getPresetUnit
(uint32_t levelId,
int
nType,
int
nClassId)
Get the first PresetUnit of the given type and class id.
-
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 .
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.
-
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 .
An array of PresetUnit s found of type nType and class ID nClassId.
Get the Area where the controlled unit currently resides.
An Area object for the current object.
Get the Area for area ID nArea.
nArea
The area ID.
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.
-
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.
The stat.
-
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.
The stat.
-
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.
The stat.
-
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.
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.
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
The stat.
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
The stat.
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
The stat.
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
szStatName
The stat name.
Todo: Determine what these tables are.
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.
-
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.
The stat.
-
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.
The stat.
-
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.
The stat.
-
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.
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.
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
The stat.
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
The stat.
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
The stat.
-
nBaseStat
The stat to look up. -
nClassId
The class ID of the ... -
nStat
The stat ID.
Todo: Determine what these tables are.
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.
-
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
A Control object representing the Control found.
public bool
getPlayerFlag
(
int
nFirstUnitId,
int
nSecondUnitId,
int
nFlag)
Get the relation between two units.
-
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).
Whether or not the relationship is of the type specified.
public
int
getTickCount
()
Get the tick count.
Returns GetTickCount().
The tick count.
public
Unit
getInteractedNPC
()
Get the Unit that the controlled Unit is currently interacting with.
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.
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.
file
The filename of the script.
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
file
Filename of the file that might have been included.
Whether or not the file has been included.
public bool
include
(String file)
Include file from the scriptDir\libs directory.
file
Filename of the file to include.
Whether the inclusion was successful.
Conditionally stop current script.
stop
1 if current script should be stopped.
public void
stop
(bool stop)
Conditionnaly stop current script.
stop
True if current script should be stopped.
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.
-
low
The lowest possible integer to return. -
high
The highest possible integer to return.
A random integer in the range [low,high].
public void
copy
(String txt)
Copy txt to clipboard.
txt
Text to copy to the clipboard.
public String
paste
()
Get the text from the clipboard.
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.
-
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.
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.
-
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.
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.
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 ""
-
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.
Result data if mode was 0.
Get whether or not a key is pressed.
Returns the value of GetAsyncKeyState.
vKey
The virtual key code for the key in question. See: http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx
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.
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"
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.
-
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.
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.
Whether or not the strict flag is set.
public void
js_strict
(bool setStrictFlag)
Set or clear the JSOPTION_STRICT flag.
setStrictFlag
The new JSOPTION_STRICT state.
public String
version
()
Get the D2BS version string.
The D2BS version string.
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).
The sqlite version string.
public double
sqlite_memusage
()
Return the sqlite memory usage.
Get the Folder object for the directory scriptPath\name.
name
The name of the Folder to open.
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).
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).
profile
The profile to load.
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.
profile
The profile to get the character name from.
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.
-
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.
-
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.
-
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.
The current OOG location.
public void
loadMpq
(String path)
Load an mpq file.
path
The mpq file to load
public bool
submitItem
()
Submit the item on the cursor to the open screen (like the add sockets screen).
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.
-
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.
The mouse coordinates in an array. 0 - x, 1 - y.
-
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.
The mouse coordinates in an array. Has properties .x and .y.
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.
The new copy of the unit.
Click on the map with the given click type and possibly shift at the given unit.
-
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.
Whether or not the click was successful.
Click on the map with the given click type and possibly shift at the given unit.
-
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.
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.
-
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.
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.
-
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.
Whether or not the click was successful.
public bool
acceptTrade
(
int
action)
Get or do something to do with accepting trade.
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.
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.
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.
An array of objects of the lines, or undefined if no dialog up.
Beep with beep ID nBeepId.
nBeepId
ID of the beep to make. See: http://msdn.microsoft.com/en-us/library/ms680356%28VS.85%29.aspx .
Click an item.
item
The item to click on.
Click on a body location with a certain click type.
-
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
Click on a given item with the given click type.
-
nClickType
The click type. {0 - left click, 1 - right click, 4 - left click merc location} -
item
The item to click. -
nClickType
Click an item location with the given click type.
-
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.
a
The second Unit.
The euclidean distance from a.
public double
getDistance
(
Unit
a,
Unit
b)
Get the euclidean distance from a to b.
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.
-
a
The first Unit. -
bx
The x coordinate of point b. -
by
The y coordinate of point b.
The euclidean distance from a to b.
public double
getDistance
(int32_t ax,int32_t ay)
Get the euclidean distance from me to a.
-
ax
The x coordinate of point a. -
ay
The y coordinate of point a.
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.
-
ax
The x coordinate of point a. -
ay
The y coordinate of point a. -
b
The second Unit.
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.
-
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.
The euclidean distance from a to b.
Do something with some gold.
Todo: Determine what the values for nMode are.
-
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.
Play d2 sound by id.
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.
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.
-
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.
dummy
Any int other than 0.
Which weapon switch is active.
dummy
0 to use this mode.
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
-
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
-
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
Move NPC to a new location.
This is an exploit function.
-
npc
NPC to move. -
x
X coord to move to. -
y
Y coord to move to.
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.
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.
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.
arg
An object with x and y parameters specifying the point.
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.
-
ix
The x coordinate. -
iy
The y coordinate.
An object with x and y, containing the automap coordinate.
public Object
automapToScreen
(Object arg)
Convert a point from automap coordinates to screen coordinates.
arg
An object with x and y parameters specifying the point.
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.
-
ix
The x coordinate. -
iy
The y coordinate.
An object with x and y, containing the screen coordinate.
public String
md5
(String str)
Takes the md5 hash.
str
The string to hash.
The md5 hash of the string.
public String
sha1
(String str)
Takes the sha1 hash.
str
The string to hash.
The sha1 hash of the string.
public String
sha256
(String str)
Takes the sha256 hash.
str
The string to hash.
The sha256 hash of the string.
public String
sha384
(String str)
Takes the sha384 hash.
str
The string to hash.
The sha384 hash of the string.
public String
sha512
(String str)
Takes the sha512 hash.
str
The string to hash.
The sha512 hash of the string.
public String
md5_file
(String file)
Take the md5 hash of a file.
file
Filename relative to script path.
The md5 hash of the file.
public String
sha1_file
(String file)
Take the sha1 hash of a file.
file
Filename relative to script path.
The sha1 hash of the file.
public String
sha256_file
(String file)
Take the sha256 hash of a file.
file
Filename relative to script path.
The sha256 hash of the file.
public String
sha384_file
(String file)
Take the sha384 hash of a file.
file
Filename relative to script path.
The sha384 hash of the file.
public String
sha512_file
(String file)
Take the sha512 hash of a file.
file
Filename relative to script path.
The sha512 hash of the file.
ProfileType enum.
Members | Descriptions |
---|---|
enum ProfileType |
enum
ProfileType
Values | Descriptions |
---|---|
singlePlayer | |
battleNet | |
openBattleNet | |
tcpIpHost | |
tcpIpJoin |
Represent an Area of the map.
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. |
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.
The x coordinate of the left side of the map.
The x size (width) of the map.
The y coordinate of the bottom (smallest y) of the map.
The y size (height) of the map.
The area id.
See Unit::area.
A Box screen hook.
Todo: Explain (and understand) this better.
Verify all the documentation in this class.
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. |
The x coordinate (left) of the Box.
The y coordinate (top) of the Box.
The xsize (width) of the Box.
The ysize (height) of the Box.
public bool
visible
Whether or not the Box is visible.
The horizontal alignment.
0 - Left
1 - Right
2 - Center
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.
The color of the Box.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
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.
-
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
-
opacity
See Explanation of opacity parameter. -
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
-
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.
This class represents out of game (OOG) Control s.
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. |
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.
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.
-
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.
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.
An array of all the Control's texts.
Represents a script (a thread), created by either loading a file, or typing something in the console.
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. |
public String
name
The relative filename of the script.
If the script is from the console the filename will be reported as "Command Line".
The type of script.
0 - InGame
1 - OutOfGame or Command
public bool
running
Whether or not the script is running.
The thread id.
public bool
getNext
()
Get the next script.
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.
A class describing ...
Todo: Get a better description (and understanding).
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. |
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.
The object with all the data.
public
int
getColumnCount
()
Get the column count.
The column count.
public double
getColumnValue
(
int
colIndex)
Get the value from the column specified by index.
colIndex
The index of the column to get data from.
The data.
public String
getColumnValue
(
int
colIndex)
Get the value from the column specified by index.
colIndex
The index of the column to get data from.
The data.
public
getColumnName
(
int
colIndex)
Get the name of the column at the given index.
colIndex
The index of the column to get data from.
The column name.
public bool
go
()
Call sqlite3_step and close_db_stmt on the statement.
Todo: Interpret what this means.
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().
Whether the result is SQLITE_ROW.
Skip a certain number of rows in the results.
rows
The number of rows to skip.
The number of rows actually skipped.
public bool
reset
()
Call sqlite3_reset.
Todo: Interpret what this does.
true.
public bool
close
()
Close the statement.
true.
Bind the given data to the given column.
-
colnum
The column number to bind to. -
val
The data to bind.
true.
Bind the given data to the given column.
-
colnum
The column number to bind to. -
val
The data to bind.
true.
Bind the given data to the given column.
-
colnum
The column number to bind to. -
val
The data to bind.
true.
Bind the given data to the given column.
-
colnum
The column number to bind to. -
val
The data to bind.
true.
Represents a method of getting from one Area to another.
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. |
The x coordinate of the exit.
The y coordinate of the exit.
The Area ID of the target level.
The Exit type.
1 - A walk through Exit
2 - A stairs type Exit
The class ID of the Exit if it is a stairs type Exit, 0 otherwise.
The Area ID of the source side of the Exit.
This class handles the opening, reading and writing of files.
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. |
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.
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.
The file length.
public String
path
The relative path to the File (the filename/path given for opening).
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.
The last accessed time of the File.
The creation time of the File.
The last modified time of the File.
public bool
autoflush
Whether or not to autoflush the File.
Close the current file and then return it.
The same File object.
Reopen the file, equivalent to calling open with the same parameters as were used the first time.
The same File object.
Read count chars from the file.
Used when the file was not opened in binary mode.
count
The number of characters to read.
The characters that were read.
Read count bytes from the file.
Used when the file was opened in binary mode.
count
The number of bytes to read.
An array of the bytes read.
public String
readLine
()
Read a line from the file and return it.
The line.
public String[]
readAllLines
()
Read all the lines from the file into a String array.
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.
The entire file in a String.
Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the File.
The File.
Seek n bytes from the current location.
n
Number of bytes to move..
The File.
Seek n bytes or lines (depending on isLines) from the current location or the start of file (depending on fromStart).
-
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.
The File.
Flush the buffers for the File.
The File.
Seek back to the beginning of the File.
The File.
Seek to the end of the File.
The File.
A collection of tools to do things like move files and determine whether files exist.
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. |
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.
file
The filename of the file to write to.
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.
file
The filename of the file to write to.
Whether or not the operation was successful.
Represents a folder.
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. |
public String
name
The path name to the directory.
Create a new directory.
name
The name of the directory to create under the current directory.
The new Folder created.
public bool
remove
()
Remove the directory.
Must be empty to work properly.
true.
public String[]
getFiles
()
Get the filename for each of the files in the directory.
An array of all the filenames.
public String[]
getFolders
()
Get the name for each of the sub-directories in the current directory.
An array of all the folder names.
This class represents a screen hook for a Frame.
Todo: Explain (and understand) this better.
Verify all the documentation in this class.
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. |
The x coordinate (left) of the Frame.
The y coordinate (top) of the Frame.
The xsize (width) of the Frame.
The ysize (height) of the Frame.
public bool
visible
Whether or not the Frame is visible.
The horizontal alignment.
0 - Left
1 - Right
2 - Center
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.
-
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
-
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.
This class represents a screen hook for a Image.
Todo: Explain (and understand) this better.
Verify all the documentation in this class.
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. |
The x coordinate (left) of the Image.
The y coordinate (top) of the Image.
public bool
visible
Whether or not the Image is visible.
The horizontal alignment.
0 - Left
1 - Right
2 - Center
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.
-
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
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
-
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.
A 2d line.
Todo: Verify all the documentation in this class.
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. |
The first x coordinate of the Line.
The first y coordinate of the Line.
The second x coordinate of the Line.
The second y coordinate of the Line.
public bool
visible
Whether or not the Line is visible.
The color of the Line.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
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.
Create a Line hook with the given 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
-
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.
The class that represents the controlled unit.
Technically, also called Unit, but since C++ doesn't support class overloading, called it Me here instead.
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. |
The type of the unit.
0 - Player
1 - NPC
2 - Object
3 - Missile
4 - Item
5 - Warp
Source: botNET
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
The mode of the unit.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=988
public String
name
The name of the unit.
The seed used to create the map.
The act where the unit is currently located.
The unit unique id.
Referred to simply as the unit id. Used along with the unit type to uniquely identify the unit.
The x location of the unit.
The y location of the unit.
The target x location of the unit.
Where the game is taking the unit.
The target y location of the unit.
Where the game is taking the unit.
The id of the area (level) the unit is located in.
The unit's current health.
The unit's maximum health.
The unit's current mana.
The unit's maximum mana.
The unit's current stamina.
public
int
staminamax
The unit's maximum stamina.
The character level.
The level that determines stat points, skill levels, etc.
The number of items in inventory.
public double
owner
The unit id of the owner of the unit.
The type of owner.
The special type of the unit.
Represents things like unique, minion, boss, etc.
1 - "Normal" Boss 2 - Champion 4 - Boss 8 - Minion
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.
The id code for the magic prefix.
The id code for the magic suffix.
public String
fname
The full name of an item.
The item quality.
1 - Low quality
2 - Normal
3 - Superior
4 - Magic
5 - Set
6 - Rare
7 - Unique
8 - Crafted
Source: botNET
No clue.
Todo: Get a clue.
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
The x size of the item.
The y size of the item.
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
Item level.
Used for things like item stat rolling.
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.
The difficulty of the game.
0 - Normal
1 - Nightmare
2 - Hell
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.
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.
The ping in milliseconds.
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.
The health at which to chicken if the character drops below.
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.
Whether another unit was found.
public bool
getNext
(String szName)
Get the next unit that matches the given name and originally specified mode.
szName
The name to look for.
Whether another unit was found.
Get the next unit that matches the given class id and originally specified mode.
dwClassId
The class id to look for.
Whether another unit was found.
Get the next unit that matches the given name and mode.
-
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.
Whether another unit was found.
Get the next unit that matches the given class id and mode.
-
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.
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.
true if successful.
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.
menuItem
Index of the menu item to click.
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.
Interact with a waypoint.
If the unit is an object, assume it's a waypoint, and take it.
destId
The area id of the destination to select.
Get an item from inventory by name, mode and nUnitId.
-
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.
The first item found that matches the description.
Get an item from inventory by classId, mode and nUnitId.
-
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.
The first item found that matches the description.
Get all items from inventory.
An array of all the items from inventory.
Get a player's merc.
The unit being operated on should be a player.
The merc if there is one, null otherwise.
Get the merc's HP.
The reported HP is a percentage.
The merc's HP percentage.
Get skill name from hand.
hand
Hand to get the skill name off.
0 - Right hand
1 - Left hand
Skill name.
Get skill id from hand.
hand
Hand to get the skill id off.
2 - Right hand
3 - Left hand
Skill id.
Get all skills.
Gets all skill ids, along with corresponding base and total skill levels.
dummy
Should be 4.
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.
Calls D2COMMON_GetSkillLevel and returns the result.
Todo: Figure out what D2COMMON_GetSkillLevel does.
Whatever D2COMMON_GetSkillLevel returns.
Gets the parent of a unit.
This function is used for monster and item units.
The parent unit.
public String
getParent
()
Gets the parent of a unit.
This function is used for object units.
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.
Returns the item flags.
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
Get a stat by stat id and sub index.
Used for every stat except 6-11.
-
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.
The stat value.
Get a stat by stat id and sub index.
Used for stats 6-11.
-
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.
The stat value.
Get an array of all the stats of the item.
-
nStat
Set to -1. -
nSubIndex
Ignored.
An array of the first 64 stats. The indices of the inner array are: 0 - nStat, 1 - nSubIndex, 2 - nValue.
TODO: Handle getStat(-2);.
Return whether or not the unit has a given state.
nState
The state id.
Whether or not the unit has the state.
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".
-
npc
The npc to determine the price at. -
buysell
Unknown
The price requested.
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".
-
npcId
The id of the npc to determine the price at. -
buysell
Unknown
The price requested.
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".
-
npc
The npc to determine the price at. -
buysell
Unknown -
difficulty
The difficulty of interest: 0 - normal, 1 - nightmare, 2 - hell
The price requested.
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".
-
npcId
The id of the npc to determine the price at. -
buysell
Unknown -
difficulty
The difficulty of interest: 0 - normal, 1 - nightmare, 2 - hell
The price requested.
public bool
getEnchant
(
int
nEnchant)
Determine whether or not a unit has a given enchant.
nEnchant
Enchantment id.
Whether or not the unit has the enchantment.
Shop with a given npc, either buying or selling.
dwMode
What to do with the item. 1 - Sell, 2 - Buy, 6 - ?
Whether or not the shop went through.
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
-
skillName
Name of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right.
Whether operation was successful.
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
-
nSkillId
Id of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right.
Whether operation was successful.
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
-
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.
Whether operation was successful.
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
-
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.
Whether operation was successful.
Move to the given location.
-
x
The x location. -
y
The y location.
public void
move
()
Move to this unit.
Get the quest flag for a quest specified by act and quest number.
-
nAct
The act of the quest. -
nQuest
The quest number.
The quest flag for the specified quest.
public
int
getMinionCount
(
int
nType)
Get the number of minions of a certain type.
nType
The type of the minions.
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.
nNpcClassId
The class id of the npc to get the price for repair at.
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.
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
npc
The npc to check the price with.
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.
-
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.
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.
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
nNpcClassId
The class id of the npc to check the price with.
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.
-
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.
The price.
Represents the items in the list in the Party screen.
Also called a RosterUnit.
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. |
The x coordinate of the location of the RosterUnit.
The y coordinate of the location of the RosterUnit.
The Area ID of the RosterUnit.
public double
gid
The unique id of the RosterUnit.
The life of the RosterUnit.
Todo: Determine how one is to get the maximum life of the RosterUnit.
The Party flags of the RosterUnit.
Todo: Determine the values that this can take on.
The Party ID.
Todo: Determine what a Party ID is.
public String
name
The name of the RosterUnit.
The class ID of the RosterUnit.
See Unit::classId.
The character level of the RosterUnit.
Todo: Verify that this level is the character level.
public void
getNext
()
Move to the next RosterUnit.
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.
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. |
The type ID.
See Unit::type.
The room X (?).
The room Y (?).
The X coordinate (?).
The Y coordinate (?).
The unique ID of the PresetUnit.
The Area ID of the Area the PresetUnit is in.
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.
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. |
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.
profileName
Name of the profile to load.
public
Profile
(ProfileType pt,String charName,int8_t diff)
Create a Profile with the given information.
-
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.
-
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.
-
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.
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.
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. |
Get the Room number.
Todo: Determine what a "room number" is.
Get the x coordinate of the Room.
Get the y coordinate of the Room.
Get the x size (width) of the Room.
Get the y size (height) of the Room.
No implementation.
Get the Area ID for the area which the Room is in.
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.
Whether there was another Room to move to or not.
public bool
reveal
()
Reveal the Room on the map.
Whether or not the Room was successfully revealed.
public
PresetUnit
getPresetUnits
(
int
nType,
int
nClass)
Get the PresetUnit s from the current Room.
-
nType
The type of Unit to get. See Unit::type. -
nClass
The class id of the Unit (s) to find. See Unit::classId.
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.
An array with the collision data. The first dimension is the y coordinate, the second is the x coordinate.
Get the "nearby" Rooms from pRoom2Near member.
An array of the nearby Rooms.
Get some property of the Room.
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)
The stat value.
Get the first Room of the level this Room is on.
The first Room.
public bool
unitInRoom
(
Unit
unit)
Determine whether or not the Unit is in the Room.
unit
The unit to check.
Whether or not the Unit is in the Room.
A separate context to run scripts in.
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. |
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.
code
The code to run, literally JavaScript code to run.
The result of the last expression statement.
public Object
include
(String file)
Include a file from ScriptPath\libs\file.
file
The filename relative to ScriptPath\libs to include.
The result of the last expression statement.
public bool
isInclude
(String file)
Determine whether a file has been included yet or not.
file
The filename relative to ScriptPath\libs to include.
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).
Class for dealing with an SQLite database.
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. |
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.
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.
-
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.
queryString
The query string to execute.
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.
sql
The query to pass to sqlite3_prepare v2.
Todo: Determine what this function does (better documenation).
The resulting DBStatement.
public bool
open
()
Open the database.
true
public bool
close
()
Close the database.
true
A Text screen hook.
Todo: Verify all the documentation in this class.
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. |
The x coordinate (left) of the Text.
The y coordinate (top) of the Text.
public bool
visible
Whether or not the Text is visible.
The horizontal alignment.
0 - Left
1 - Right
2 - Center
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.
The color of the Text.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000
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.
-
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
-
font
Something that determines the font. -
align
The horizontal alignment.
0 - Left
1 - Right
2 - Center
-
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.
This class represents a unit (monster, wp, npc, character, etc) in the game.
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. |
The type of the unit.
0 - Player
1 - NPC
2 - Object
3 - Missile
4 - Item
5 - Warp
Source: botNET
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
The mode of the unit.
See: http://forums.d2botnet.org/viewtopic.php?f=18&t=988
public String
name
The name of the unit.
The act where the unit is currently located.
The unit unique id.
Referred to simply as the unit id. Used along with the unit type to uniquely identify the unit.
The x location of the unit.
The y location of the unit.
The target x location of the unit.
Where the game is taking the unit.
The target y location of the unit.
Where the game is taking the unit.
The id of the area (level) the unit is located in.
Todo: Get a reference for the area IDs.
The unit's current health.
The unit's maximum health.
The unit's current mana.
The unit's maximum mana.
The unit's current stamina.
public
int
staminamax
The unit's maximum stamina.
The character level.
The level that determines stat points, skill levels, etc.
The number of items in inventory.
The unit id of the owner of the unit.
The type of owner.
The special type of the unit.
Represents things like unique, minion, boss, etc.
1 - "Normal" Boss 2 - Champion 4 - Boss 8 - Minion
The direction of the unit.
Todo: Figure out what the direction is.
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.
The id code for the magic prefix.
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.
The item quality.
1 - Low quality
2 - Normal
3 - Superior
4 - Magic
5 - Set
6 - Rare
7 - Unique
8 - Crafted
Source: botNET
No clue.
Todo: Get a clue.
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
The x size of the item.
The y size of the item.
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
Item level.
Used for things like item stat rolling.
Level requirement (character level required to use the item).
Get the id for the graphic used for the item.
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.
The object type.
Todo: Figure out what this means.
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.
Whether another unit was found.
public bool
getNext
(String szName)
Get the next unit that matches the given name and originally specified mode.
szName
The name to look for.
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.
dwClassId
The class id to look for.
Whether another unit was found.
public bool
getNext
(String szName,uint32_t dwMode)
Get the next unit that matches the given name and mode.
-
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.
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.
-
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.
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.
true if successful.
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.
menuItem
Index of the menu item to click.
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.
Interact with a waypoint.
If the unit is an object, assume it's a waypoint, and take it.
destId
The area id of the destination to select.
Get an item from inventory by name, mode and nUnitId.
-
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.
The first item found that matches the description.
Get an item from inventory by classId, mode and nUnitId.
-
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.
The first item found that matches the description.
Get all items from inventory.
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.
dummy
Used to signify boolean result instead of object. Should be true.
true if the player has a live merc.
Get a player's merc.
The unit being operated on should be a player.
The merc if there is one.
Get skill name from hand.
hand
Hand to get the skill name off.
0 - Right hand
1 - Left hand
Skill name.
Get skill id from hand.
hand
Hand to get the skill id off.
2 - Right hand
3 - Left hand
Skill id.
Get all skills.
Gets all skill ids, along with corresponding base and total skill levels.
dummy
Should be 4.
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.
Calls D2COMMON_GetSkillLevel and returns the result.
Todo: Figure out what D2COMMON_GetSkillLevel does.
Whatever D2COMMON_GetSkillLevel returns.
Gets the parent of a unit.
This function is used for monster and item units.
The parent unit.
public String
getParent
()
Gets the parent of a unit.
This function is used for object units.
The parent's name.
public void
overhead
(Object message)
Puts the string equivalent of message over the unit.
Returns the item flags.
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
Same as getFlags, but returns a boolean.
Returns true if any of the flags given match the item flags.
flags
Flags to check.
true if any of the flags are set in the item flags.
Get a stat by stat id and sub index.
Used for stat 13.
-
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.
The stat value.
Get a stat by stat id and sub index.
Used for everything except stat 13.
-
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.
The stat value.
Get an array of all the stats of the item.
-
nStat
Set to -1. -
nSubIndex
Ignored.
An array of the first 64 stats. The indices of the inner array are: 0 - nStat, 1 - nSubIndex, 2 - nValue.
Return whether or not the unit has a given state.
nState
The state id.
Whether or not the unit has the state.
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".
-
npc
The npc to determine the price at. -
buysell
Unknown
The price requested.
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".
-
npcId
The id of the npc to determine the price at. -
buysell
Unknown
The price requested.
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".
-
npc
The npc to determine the price at. -
buysell
Unknown -
difficulty
The difficulty of interest: 0 - normal, 1 - nightmare, 2 - hell
The price requested.
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".
-
npcId
The id of the npc to determine the price at. -
buysell
Unknown -
difficulty
The difficulty of interest: 0 - normal, 1 - nightmare, 2 - hell
The price requested.
public bool
getEnchant
(
int
nEnchant)
Determine whether or not a unit has a given enchant.
nEnchant
Enchantment id.
Whether or not the unit has the enchantment.
Shop with a given npc, either buying or selling.
dwMode
What to do with the item. 1 - Sell, 2 - Buy, 6 - ?
Whether or not the shop went through.
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
-
skillName
Name of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right.
Whether operation was successful.
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
-
nSkillId
Id of the skill to put up. -
nHand
Hand to put the skill on. non-zero left, 0 - right.
Whether operation was successful.
Move to the given location.
-
x
The x location. -
y
The y location.
public void
move
()
Move to this unit.
Get the quest flag for a quest specified by act and quest number.
-
nAct
The act of the quest. -
nQuest
The quest number.
The quest flag for the specified quest.
public
int
getMinionCount
(
int
nType)
Get the number of minions of a certain type.
nType
The type of the minions.
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.
nNpcClassId
The class id of the npc to get the price for repair at.
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.
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
nNpcClassId
The class id of the npc to check the price with.
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.
-
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.
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.
-
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.
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.
-
nMode
What to do: 0 - buy, 1 - sell, 2 - repair. -
npc
The npc to check the price with.
The price.
Generated by Moxygen