noah- / d2bs

D2BS: Diablo 2 Botting System, a JS API to perform human-like actions utilizing Mozilla Spidermonkey
104 stars 66 forks source link

Summary

Members Descriptions
publicUnit`[getUnit](#group__globalFunctions_1ga6073f506327123ebf40219400e4d3f70)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) type,String name,uint32_t mode,uint32_t nUnitId)` Get a unit by type, name, mode and nUnitId.
publicUnit`[getUnit](#group__globalFunctions_1ga22c01b5a8480e8fbf540e43bad5ae2f8)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) 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,intdstY,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,intdstY,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 shortgetCollision(uint32_t nLevelId,int32_t nX,int32_t nY) Get the collision flags at a given point in a given area.
publicint`[getMercHP](#group__globalFunctions_1gac4217ed30da8eb07d8addca4cdb51a9d)()` Get the health points of the controlled unit's merc.
publicint`[getCursorType](#group__globalFunctions_1gaa0bc4f7877d6992600202b8dce442787)()` Get the cursor type from p_D2CLIENT_RegularCursorType.
publicint`[getCursorType](#group__globalFunctions_1ga9b3530843295a8ee8fa59a3130ae7409)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType)` Get the cursor type from p_D2CLIENT_RegularCursorType if nType != 1, from p_D2CLIENT_ShopCursorType if nType == 1.
publicint`[getSkillByName](#group__globalFunctions_1gaee860cd7482aff8e89519314a0f86955)(String skillName)` Get skill ID by name.
public StringgetSkillById(intskillId) Get skill name by ID.
public StringgetLocaleString(uint16_t localeId) Get the String in the current locale that corresponds to the given id.
publicint`[getTextSize](#group__globalFunctions_1ga19d918388535584b388c00c57d76ab47)(String string,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) font,bool asObject)` Get the width and height of the given text in the given font.
publicint`[getThreadPriority](#group__globalFunctions_1ga6ab5869695c97ce6e4fbc6899e16a75d)()` Get the priority of the current thread.
public boolgetUIFlag(intnUIId) Get whether or not a UI flag is set.
publicint`[getTradeInfo](#group__globalFunctions_1gaedebe009d3f6c0afeab5cb544f430767)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode)` Get the TradeFlag or RecentTradeId.
public boolgetWaypoint(intnWaypointId) Get whether the controlled unit has the given waypoint.
publicD2BSScript`[getScript](#group__globalFunctions_1ga8340268c49de1e5f34588c01b0cf971d)(bool currentScript)` Get the current or first context.
publicD2BSScript`[getScript](#group__globalFunctions_1ga02ad0d69faff60c7061a98a3e8a2b53b)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) threadId)` Get a script by thread id.
publicD2BSScript`[getScript](#group__globalFunctions_1gac202e144c149fa59378fd01585e6a2bd)(String name)` Get a script by filename.
publicD2BSScript`[getScript](#group__globalFunctions_1ga822bdc4cbce00ca342a05bc29ffae76e)()` Get the first script.
publicRoom`[getRoom](#group__globalFunctions_1ga0ec5e4d9e09bf924c1f96ce417290417)(uint32_t levelId)` Get the first room in area given by level id.
publicRoom`[getRoom](#group__globalFunctions_1ga6c10567ae9eac427ef0770edb2ab8c21)(uint32_t levelId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) x,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) y)` Get the room that the given point is in from the given level id.
publicRoom`[getRoom](#group__globalFunctions_1gacc763e01907b73ca5c405469cc58cf12)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) x,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) y)` Get the room that the given point is in.
publicRoom`[getRoom](#group__globalFunctions_1gafc051829ad79986ed98043fd46bd9a2c)()` Get the first room in the current area.
publicParty`[getParty](#group__globalFunctions_1gae1a5223caa888f3cc2429fad719fc7eb)()` Get the first party.
publicParty`[getParty](#group__globalFunctions_1ga6a0dc4f8e9bd582b1c8c4fc4da5e2f47)(String name)` Get the party line for the player with the given name.
publicParty`[getParty](#group__globalFunctions_1ga3fa567c623c83fe382918a7c6fb49978)(uint32_t playerId)` Get the party line for the player with the given player id.
publicParty`[getParty](#group__globalFunctions_1gab98faccffab8b30337ba357504c145c3)([Unit](#classUnit) player)` Get the party line that corresponds to the given unit.
publicPresetUnit`[getPresetUnit](#group__globalFunctions_1ga6bf8c5a903fcf00dcd2504e8f4dc4ff7)(uint32_t levelId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nClassId)` Get the first PresetUnit of the given type and class id.
publicPresetUnit`[getPresetUnits](#group__globalFunctions_1gaf77d2fb8bcab572d328c5764155be78d)(uint32_t levelId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nClassId)` Get an array of PresetUnit s of the given type and class id.
publicArea`[getArea](#group__globalFunctions_1ga096676595eb6e9e2361dffe28acd8397)()` Get the Area where the controlled unit currently resides.
publicArea`[getArea](#group__globalFunctions_1gae59e910620c20fb4fae45fc06d7cc351)(int32_t nArea)` Get the Area for area ID nArea.
public StringgetBaseStat(String szTableName,int32_t nClassId,String szStatName) Get the base stat from the given table with the given class ID and stat name.
public StringgetBaseStat(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 StringgetBaseStat(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 StringgetBaseStat(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.
publicControl`[getControl](#group__globalFunctions_1gaad0e54fb02bc1ce440b96204167da80f)(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 boolgetPlayerFlag(intnFirstUnitId,intnSecondUnitId,intnFlag) Get the relation between two units.
publicint`[getTickCount](#group__globalFunctions_1gad6eff12ded45cc505954f4763a71eae3)()` Get the tick count.
publicUnit`[getInteractedNPC](#group__globalFunctions_1ga3338c7af7db3773f41edb61bf9c5873c)()` Get the Unit that the controlled Unit is currently interacting with.
public voidprint(...) Print the String representation of the arguments to the console.
public voiddelay(uint32_t nDelay) Delay for nDelay milliseconds.
publicD2BSScript`[load](#group__globalFunctions_1gabb55e1126cb1e7626356bd529f6bc965)(String file,...)` Load file and create a thread with it's main function.
public boolisIncluded(String file) Determine whether a file has been included yet or not.
public boolinclude(String file) Include file from the scriptDir\libs directory.
public voidstop(intstop) Conditionally stop current script.
public voidstop(bool stop) Conditionnaly stop current script.
publicint`[rand](#group__globalFunctions_1ga6cbf7046bc4629083c0d50f6c5ce8843)(int32_t low,int32_t high)` Return a random number between low and high.
public voidcopy(String txt) Copy txt to clipboard.
public Stringpaste() Get the text from the clipboard.
publicint`[sendCopyData](#group__globalFunctions_1gad4e03d1abafaa3beab0e1cbb90ca8e37)(String windowClassName,String windowName,int32_t nModeId,String data)` Send data to another window by means of the WM_COPYDATA message.
publicint`[sendCopyData](#group__globalFunctions_1ga3dc20441410e40f237213140436a68d3)(HWND hWnd,String dummy,int32_t nModeId,String data)` Send data to another window by means of the WM_COPYDATA message.
public StringsendDDE(int32_t mode,String pszDDEServer,String pszTopic,String pszItem) Send data to a DDE server by means of DdeClientTransaction.
public boolkeystate(intvKey) Get whether or not a key is pressed.
public voidaddEventListener(String event,Function eventHandler) Add an event handler to the list of listeners for the given event.
public voidremoveEventListener(String event,Function eventHandler) Removes a previously added event from the listener list.
public voidclearEvent(String event) Clear the event handler list for given event.
public voidclearAllEvents() Clear all event handlers (from all events).
public booljs_strict() Get whether or not the JSOPTION_STRICT flag is set.
public voidjs_strict(bool setStrictFlag) Set or clear the JSOPTION_STRICT flag.
public Stringversion() Get the D2BS version string.
public voidversion(inta) Print the D2BS version string.
public voidscriptBroadcast(...) Broadcast a message to all other scripts.
public Stringsqlite_version() Get the sqlite version string (from sqlite3_version).
public doublesqlite_memusage() Return the sqlite memory usage.
publicFolder`[dopen](#group__globalFunctions_1ga9a23806a759b9bace15e57adbdb90f91)(String name)` Get the Folder object for the directory scriptPath\name.
public voiddebugLog(...) Log the String representation of the arguments.
public voidshowConsole() Show the console.
public voidhideConsole() Hide the console.
public voidlogin() 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 voidlogin(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 boolselectCharacter(String profile) Select the character from the given profile.
public voidcreateGame(String name,String pass,int32_t diff) Create a game with the given name and password in the given difficulty.
public voidjoinGame(String name,String pass) Join a game with the given name and password.
public voidaddProfile(String profile,String mode,String gateway,String username,String password,String charname,intspDifficulty) Create a profile with the given profile name, mode, gateway, username, password, character name and single player difficulty.
publicint`[getLocation](#group__globalFunctions_1ga21d43545897ce3af3692562593053480)()` Get the current OOG location.
public voidloadMpq(String path) Load an mpq file.
public boolsubmitItem() Submit the item on the cursor to the open screen (like the add sockets screen).
publicint`[getMouseCoords](#group__globalFunctions_1gadf9310ea4d054d7013f93e4e8e840af4)(bool nFlag,bool nReturn)` Get the mouse coordinates (in screen or map space) and return as an array.
publicUnit`[copyUnit](#group__globalFunctions_1ga8db0ed764b74081b12b217918f5f2f94)([Unit](#classUnit) other)` Copy the cached data associated with given unit.
public boolclickMap(uint16_t nClickType,uint16_t nShift,UnittoClick) Click on the map with the given click type and possibly shift at the given unit.
public boolclickMap(uint16_t nClickType,bool nShift,UnittoClick) Click on the map with the given click type and possibly shift at the given unit.
public boolclickMap(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 boolclickMap(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 boolacceptTrade(intaction) Get or do something to do with accepting trade.
public boolacceptTrade() Accept a trade if not already accepted, cancel a trade if already accepted.
public voidtradeOk() Hit the OK button to open the trade window.
public object[]getDialogLines() Get the lines of dialog of whatever you're talking to.
public voidbeep(intnBeepId) Beep with beep ID nBeepId.
public voidclickItem(Unititem) Click an item.
public voidclickItem(intnClickType,intnBodyLoc) Click on a body location with a certain click type.
public voidclickItem(intnClickType,Unititem) Click on a given item with the given click type.
public voidclickItem(intnClickType,intnX,intnY,intnLoc) Click an item location with the given click type.
public doublegetDistance(Unita) Get the euclidean distance from me to a.
public doublegetDistance(Unita,Unitb) Get the euclidean distance from a to b.
public doublegetDistance(Unita,int32_t bx,int32_t by) Get the euclidean distance from a to b.
public doublegetDistance(int32_t ax,int32_t ay) Get the euclidean distance from me to a.
public doublegetDistance(int32_t ax,int32_t ay,Unitb) Get the euclidean distance from a to b.
public doublegetDistance(int32_t ax,int32_t ay,int32_t bx,int32_t by) Get the euclidean distance from a to b.
public voidgold(intnGold,intnMode) Do something with some gold.
publicint`[checkCollision](#group__globalFunctions_1gacbe9f546980a44ff675f8c5b77d617d3)([Unit](#classUnit) a,[Unit](#classUnit) b,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nBitMask)` Check if two units collide.
public boolplaySound(intnSoundId) Play d2 sound by id.
public voidquit() Quit the game.
public voidquitGame() Quit Diablo II.
public boolsay(...) Say the string equivalent of the each of the arguments.
public boolclickParty(Partyplayer,intnMode) Click one of the buttons in the party screen for the given player.
publicint`[weaponSwitch](#group__globalFunctions_1gab9c5eb66ccf79108ee26a7f73943d0bc)(int32_t dummy)` Get which weapon switch is being used.
public voidtransmute() Hit the transmute button.
public voiduseStatPoint(uint16_t statType,uint32_t count) Use a stat point.
public voiduseSkillPoint(uint16_t skill,uint32_t count) Use a skill point.
public voidtakeScreenshot() Take a screenshot.
public boolmoveNPC(Unitnpc,uint32_t x,uint32_t y) Move NPC to a new location.
public boolgetPacket(...) Send a packet to the client.
public boolsendPacket(...) Send a packet to the server.
public StringgetIP() Get the external IP by going to "http://automation.whatismyip.com/n09230945.asp" and parsing the result.
public ObjectscreenToAutomap(Object arg) Convert a point from screen coordinates to automap coordinates.
public ObjectscreenToAutomap(intix,intiy) Convert a point from screen coordinates to automap coordinates.
public ObjectautomapToScreen(Object arg) Convert a point from automap coordinates to screen coordinates.
public ObjectautomapToScreen(intix,intiy) Convert a point from automap coordinates to screen coordinates.
public Stringmd5(String str) Takes the md5 hash.
public Stringsha1(String str) Takes the sha1 hash.
public Stringsha256(String str) Takes the sha256 hash.
public Stringsha384(String str) Takes the sha384 hash.
public Stringsha512(String str) Takes the sha512 hash.
public Stringmd5_file(String file) Take the md5 hash of a file.
public Stringsha1_file(String file) Take the sha1 hash of a file.
public Stringsha256_file(String file) Take the sha256 hash of a file.
public Stringsha384_file(String file) Take the sha384 hash of a file.
public Stringsha512_file(String file) Take the sha512 hash of a file.
namespaceProfileType ProfileType enum.
classArea Represent an Area of the map.
classBox A Box screen hook.
classControl This class represents out of game (OOG) Control s.
classD2BSScript Represents a script (a thread), created by either loading a file, or typing something in the console.
classDBStatement A class describing ...
classExit Represents a method of getting from one Area to another.
classFile This class handles the opening, reading and writing of files.
classFileTools A collection of tools to do things like move files and determine whether files exist.
classFolder Represents a folder.
classFrame This class represents a screen hook for a Frame.
classImage This class represents a screen hook for a Image.
classLine A 2d line.
classMe The class that represents the controlled unit.
classParty Represents the items in the list in the Party screen.
classPresetUnit Represents a PresetUnit (a type of Unit that is available as soon as the Area data is available).
classProfile This class represents the details needed to get a player to a game or lobby.
classRoom Represents a "Room" in the game.
classSandbox A separate context to run scripts in.
classSQLite Class for dealing with an SQLite database.
classText A Text screen hook.
classUnit This class represents a unit (monster, wp, npc, character, etc) in the game.

Members

publicUnit`[getUnit](#group__globalFunctions_1ga6073f506327123ebf40219400e4d3f70)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) type,String name,uint32_t mode,uint32_t nUnitId)`

Get a unit by type, name, mode and nUnitId.

Parameters

Returns

The first unit found that matches the description.

publicUnit`[getUnit](#group__globalFunctions_1ga22c01b5a8480e8fbf540e43bad5ae2f8)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) type,uint32_t classId,uint32_t mode,uint32_t nUnitId)`

Get a unit by type, classId, mode and nUnitId.

Parameters

Returns

The first unit found that matches the description.

public object[]getPath(uint32_t Area,uint32_t srcX,uint32_t srcY,uint32_t dstX,intdstY,uint32_t reductionType,uint32_t Radius)

Creates a path (walking or teleporting) from the source to the destination.

Returns an array of points that form a path from the source to the destination. Takes Area ID(s), source and destination points, walking or teleporting and range as parameters.

Parameters

Returns

The path as an array of objects with x and y properties.

public object[]getPath(uint32_t Area,uint32_t srcX,uint32_t srcY,uint32_t dstX,intdstY,uint32_t reductionType,uint32_t Radius,bool(*)(int32_t x, int32_t y) reject,bool(*)(object curPt,int i, object[] pts)reduce,int32_t(*)(int32_t x, int32_t y) mutate)

Creates a path (walking or teleporting) from the source to the destination.

Returns an array of points that form a path from the source to the destination. Takes Area ID, source and destination points, walking or teleporting, range and reduction or not as parameters.

Parameters

Returns

The path as an array of objects with x and y properties.

public unsigned shortgetCollision(uint32_t nLevelId,int32_t nX,int32_t nY)

Get the collision flags at a given point in a given area.

Parameters

Returns

The collision flags. For details see: http://forums.d2botnet.org/viewtopic.php?f=18&t=1212 .

publicint`[getMercHP](#group__globalFunctions_1gac4217ed30da8eb07d8addca4cdb51a9d)()`

Get the health points of the controlled unit's merc.

Returns

The health points.

publicint`[getCursorType](#group__globalFunctions_1gaa0bc4f7877d6992600202b8dce442787)()`

Get the cursor type from p_D2CLIENT_RegularCursorType.

Todo: Determine what the return value means.

Returns

The regular cursor type.

publicint`[getCursorType](#group__globalFunctions_1ga9b3530843295a8ee8fa59a3130ae7409)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType)`

Get the cursor type from p_D2CLIENT_RegularCursorType if nType != 1, from p_D2CLIENT_ShopCursorType if nType == 1.

Parameters

Todo: Determine what the return value means.

Returns

The cursor type.

publicint`[getSkillByName](#group__globalFunctions_1gaee860cd7482aff8e89519314a0f86955)(String skillName)`

Get skill ID by name.

Parameters

Returns

The skill ID.

public StringgetSkillById(intskillId)

Get skill name by ID.

Parameters

Returns

The skill name.

public StringgetLocaleString(uint16_t localeId)

Get the String in the current locale that corresponds to the given id.

Parameters

Returns

The String in the current locale.

publicint`[getTextSize](#group__globalFunctions_1ga19d918388535584b388c00c57d76ab47)(String string,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) font,bool asObject)`

Get the width and height of the given text in the given font.

Parameters

Returns

The width and height of the text. 0 - width, 1 - height.

Parameters

Returns

The width and height of the text. Has properties .width and .height.

publicint`[getThreadPriority](#group__globalFunctions_1ga6ab5869695c97ce6e4fbc6899e16a75d)()`

Get the priority of the current thread.

Returns

The priority.

public boolgetUIFlag(intnUIId)

Get whether or not a UI flag is set.

Todo: Get a reference for the UI IDs.

Parameters

Returns

Whether or not the flag is set.

publicint`[getTradeInfo](#group__globalFunctions_1gaedebe009d3f6c0afeab5cb544f430767)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode)`

Get the TradeFlag or RecentTradeId.

Get the RecentTradeName.

Todo: Determine what this means.

Parameters

Returns

The TradeFlag or RecentTradeId.

Currently broken, returns null.

Todo: Determine what these are.

Parameters

Returns

The RecentTradeName.

public boolgetWaypoint(intnWaypointId)

Get whether the controlled unit has the given waypoint.

Parameters

Returns

Whether or not the controlled unit has the waypoint.

publicD2BSScript`[getScript](#group__globalFunctions_1ga8340268c49de1e5f34588c01b0cf971d)(bool currentScript)`

Get the current or first context.

Parameters

Returns

A D2BSScript object for the request script.

publicD2BSScript`[getScript](#group__globalFunctions_1ga02ad0d69faff60c7061a98a3e8a2b53b)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) threadId)`

Get a script by thread id.

Parameters

Returns

A D2BSScript object for the script from the given thread.

publicD2BSScript`[getScript](#group__globalFunctions_1gac202e144c149fa59378fd01585e6a2bd)(String name)`

Get a script by filename.

Parameters

Returns

A D2BSScript object for the script.

publicD2BSScript`[getScript](#group__globalFunctions_1ga822bdc4cbce00ca342a05bc29ffae76e)()`

Get the first script.

Returns

A D2BSScript representing the first script in the runtime.

publicRoom`[getRoom](#group__globalFunctions_1ga0ec5e4d9e09bf924c1f96ce417290417)(uint32_t levelId)`

Get the first room in area given by level id.

Parameters

Returns

The first room in the area.

publicRoom`[getRoom](#group__globalFunctions_1ga6c10567ae9eac427ef0770edb2ab8c21)(uint32_t levelId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) x,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) y)`

Get the room that the given point is in from the given level id.

Parameters

Returns

The room at the given point.

publicRoom`[getRoom](#group__globalFunctions_1gacc763e01907b73ca5c405469cc58cf12)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) x,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) y)`

Get the room that the given point is in.

Parameters

Returns

The room at the given point.

publicRoom`[getRoom](#group__globalFunctions_1gafc051829ad79986ed98043fd46bd9a2c)()`

Get the first room in the current area.

Returns

The first room in the current area.

publicParty`[getParty](#group__globalFunctions_1gae1a5223caa888f3cc2429fad719fc7eb)()`

Get the first party.

Returns

The first party.

publicParty`[getParty](#group__globalFunctions_1ga6a0dc4f8e9bd582b1c8c4fc4da5e2f47)(String name)`

Get the party line for the player with the given name.

Parameters

Returns

The party line

publicParty`[getParty](#group__globalFunctions_1ga3fa567c623c83fe382918a7c6fb49978)(uint32_t playerId)`

Get the party line for the player with the given player id.

Parameters

Returns

The party line

publicParty`[getParty](#group__globalFunctions_1gab98faccffab8b30337ba357504c145c3)([Unit](#classUnit) player)`

Get the party line that corresponds to the given unit.

Parameters

Returns

The party line

publicPresetUnit`[getPresetUnit](#group__globalFunctions_1ga6bf8c5a903fcf00dcd2504e8f4dc4ff7)(uint32_t levelId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nClassId)`

Get the first PresetUnit of the given type and class id.

Parameters

Returns

The first PresetUnit found of type nType and class ID nClassId.

publicPresetUnit`[getPresetUnits](#group__globalFunctions_1gaf77d2fb8bcab572d328c5764155be78d)(uint32_t levelId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nClassId)`

Get an array of PresetUnit s of the given type and class id.

Parameters

Returns

An array of PresetUnit s found of type nType and class ID nClassId.

publicArea`[getArea](#group__globalFunctions_1ga096676595eb6e9e2361dffe28acd8397)()`

Get the Area where the controlled unit currently resides.

Returns

An Area object for the current object.

publicArea`[getArea](#group__globalFunctions_1gae59e910620c20fb4fae45fc06d7cc351)(int32_t nArea)`

Get the Area for area ID nArea.

Parameters

Returns

An Area object.

public StringgetBaseStat(String szTableName,int32_t nClassId,String szStatName)

Get the base stat from the given table with the given class ID and stat name.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

public StringgetBaseStat(int32_t nBaseStat,int32_t nClassId,String szStatName)

Get the base stat from the given table with the given class ID and stat name.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

public StringgetBaseStat(String szTableName,int32_t nClassId,int32_t nStat)

Get the base stat from the given table with the given class ID and stat ID.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

public StringgetBaseStat(int32_t nBaseStat,int32_t nClassId,int32_t nStat)

Get the base stat from the given table with the given class ID and stat ID.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

Parameters

Todo: Determine what these tables are.

Returns

The stat.

publicControl`[getControl](#group__globalFunctions_1gaad0e54fb02bc1ce440b96204167da80f)(int32_t nType,int32_t nX,int32_t nY,int32_t nXSize,int32_t nYSize)`

Get the control specified by type, location and size.

-1 indicates parameter not to be matched against.

Parameters

Todo: Get a reference for nType

Returns

A Control object representing the Control found.

public boolgetPlayerFlag(intnFirstUnitId,intnSecondUnitId,intnFlag)

Get the relation between two units.

Parameters

Todo: Determine what the flags are.

Todo: Should this return bool instead of int? (i.e. change the d2bs code).

Returns

Whether or not the relationship is of the type specified.

publicint`[getTickCount](#group__globalFunctions_1gad6eff12ded45cc505954f4763a71eae3)()`

Get the tick count.

Returns GetTickCount().

Returns

The tick count.

publicUnit`[getInteractedNPC](#group__globalFunctions_1ga3338c7af7db3773f41edb61bf9c5873c)()`

Get the Unit that the controlled Unit is currently interacting with.

Returns

The Unit currently being interacted with.

public voidprint(...)

Print the String representation of the arguments to the console.

public voiddelay(uint32_t nDelay)

Delay for nDelay milliseconds.

This is done by suspending the context, sleeping, then resuming the context for short (<50 ms) delays. For longer delays the context is suspended, 50ms are slept away, the context is resumed, sequence repeats until time slept is greater then nDelay ms.

Parameters

publicD2BSScript`[load](#group__globalFunctions_1gabb55e1126cb1e7626356bd529f6bc965)(String file,...)`

Load file and create a thread with it's main function.

File taken from scriptDir\file. All remaining parameters are passed to the script.

Parameters

Returns

If successful returns the new script object representing the thread of the thread. Otherwise it returns null.

public boolisIncluded(String file)

Determine whether a file has been included yet or not.

File taken from scriptDir\libs\file

Parameters

Returns

Whether or not the file has been included.

public boolinclude(String file)

Include file from the scriptDir\libs directory.

Parameters

Returns

Whether the inclusion was successful.

public voidstop(intstop)

Conditionally stop current script.

Parameters

public voidstop(bool stop)

Conditionnaly stop current script.

Parameters

publicint`[rand](#group__globalFunctions_1ga6cbf7046bc4629083c0d50f6c5ce8843)(int32_t low,int32_t high)`

Return a random number between low and high.

Uses C rand() when out of game, and D2GAME_D2Rand with the game seed while in game.

Parameters

Returns

A random integer in the range [low,high].

public voidcopy(String txt)

Copy txt to clipboard.

Parameters

public Stringpaste()

Get the text from the clipboard.

Returns

The text from the clipboard.

publicint`[sendCopyData](#group__globalFunctions_1gad4e03d1abafaa3beab0e1cbb90ca8e37)(String windowClassName,String windowName,int32_t nModeId,String data)`

Send data to another window by means of the WM_COPYDATA message.

Uses FindWindow to get the HWND and SendMessage to send the message.

Parameters

Returns

The result of SendMessage.

publicint`[sendCopyData](#group__globalFunctions_1ga3dc20441410e40f237213140436a68d3)(HWND hWnd,String dummy,int32_t nModeId,String data)`

Send data to another window by means of the WM_COPYDATA message.

Uses SendMessage to send the message to hWnd.

Parameters

Returns

The result of SendMessage.

public StringsendDDE(int32_t mode,String pszDDEServer,String pszTopic,String pszItem)

Send data to a DDE server by means of DdeClientTransaction.

Parameters

0 - Do command given by pszItem with an XTYP_REQUEST and get the resulting data.

1 - Do command given by pszItem with an XTYP_POKE sending ""

2 - Do command with an XTYP_EXECUTE sending ""

Parameters

Returns

Result data if mode was 0.

public boolkeystate(intvKey)

Get whether or not a key is pressed.

Returns the value of GetAsyncKeyState.

Parameters

Returns

Whether not the key is pressed.

public voidaddEventListener(String event,Function eventHandler)

Add an event handler to the list of listeners for the given event.

Parameters

melife (uint32_t dwLife)

memana (uint32_t dwMana)

keyup (uint32_t key)

keydown (uint32_t key)

bool keyupblock (uint32_t key) - Returns true to block event from Diablo II

bool keydownblock (uint32_t key) - Returns true to block event from Diablo II

playerassign (uint32_t unitId)

mouseclick (uint32_t button, uint32_t x, uint32_t y, bool bUp)

mousemove (uint32_t x, uint32_t y)

scriptmsg (...)

golddrop (uint32_t gId, uint32_t Mode)

chatmsg (String lpszNick, String lpszMsg)

bool chatmsgblocker (String lpszNick, String lpszMsg) - Returns true to block event from Diablo II

whispermsg (String lpszNick, String lpszMsg)

bool whispermsgblocker (String lpszNick, String lpszMsg) - Returns true to block event from Diablo II

copydata (int32_t dwMode, String lpszMsg)

itemaction (uint32_t gId, uint32_t mode, String code, Bool global)

gameevent (BYTE mode, DWORD param1, DWORD param2, String name1, String name2)

From http://www.blizzhackers.cc/viewtopic.php?t=392307 Dark_Mage-

mode:

0x00 - "%Name1(%Name2) dropped due to time out." 0x01 - "%Name1(%Name2) dropped due to errors." 0x02 - "%Name1(%Name2) joined our world. Diablo's minions grow stronger." 0x03 - "%Name1(%Name2) left our world. Diablo's minions weaken." 0x04 - "%Name1 is not in the game." 0x05 - "%Name1 is not logged in."

0x06 - "%Name1 was Slain by %Name2" BYTE Param2 = Unit Type of Slayer (0x00 = Player, 0x01 = NPC) if Type = Player, Name2 = Slayer Character Name & DWORD Param1 = Slayer Character Type if Type = NPC, DWORD Param1 = Monster Id Code from MPQ (points to string for Name2) if Type = NPC & Monster is Unique, Name2 = Unique Monster Id

0x07 - Player Relations (Bottom Left Text) DWORD Param1 = Player Id Player Id = Pointer to Character Name BYTE Param2 = Action Taken Actions: 0x01 - "%Player permits you to loot his corpse." 0x02 - "%Player permits you to loot her corpse." 0x03 - "%Player has declared hostility towards you." 0x04 - "%Player is no longer hostile towards you." 0x05 - "%Player invites you to ally against the forces of evil." 0x06 - "%Player has canceled party invite." 0x07 - "%Player has joined your party to fight the forces of evil." 0x08 - "You are now allied with %Player." 0x09 - "%Player has left your party." 0x0a - "%Player no longer allows you to access his corpse." 0x0b - "%Player no longer allows you to access her corpse."

0x08 - "%Name1 is busy." 0x09 - "You must wait a short time to trade with that player."

0x0a - "%Name1 has items in his box." if Name1 = 0x00, "You have items in your box."

0x0b - 0x0c - 0x0d - "%Name1 is not listening to you." 0x0e - Received on 'Not enough mana' speech. 0x0f - "Realm going down in %Param1 minutes." 0x10 - "You must wait a short time to declare hostility with that player." 0x11 - "%Param1 Stones of Jordan Sold to Merchants" 0x12 - "Diablo Walks the Earth"

Parameters

public voidremoveEventListener(String event,Function eventHandler)

Removes a previously added event from the listener list.

Parameters

public voidclearEvent(String event)

Clear the event handler list for given event.

Parameters

public voidclearAllEvents()

Clear all event handlers (from all events).

public booljs_strict()

Get whether or not the JSOPTION_STRICT flag is set.

Returns

Whether or not the strict flag is set.

public voidjs_strict(bool setStrictFlag)

Set or clear the JSOPTION_STRICT flag.

Parameters

public Stringversion()

Get the D2BS version string.

Returns

The D2BS version string.

public voidversion(inta)

Print the D2BS version string.

public voidscriptBroadcast(...)

Broadcast a message to all other scripts.

D2BS calls each scripts scriptmsg event listeners with the messages passed in.

public Stringsqlite_version()

Get the sqlite version string (from sqlite3_version).

Returns

The sqlite version string.

public doublesqlite_memusage()

Return the sqlite memory usage.

publicFolder`[dopen](#group__globalFunctions_1ga9a23806a759b9bace15e57adbdb90f91)(String name)`

Get the Folder object for the directory scriptPath\name.

Parameters

Returns

A Folder object representing the Folder name.

public voiddebugLog(...)

Log the String representation of the arguments.

public voidshowConsole()

Show the console.

public voidhideConsole()

Hide the console.

public voidlogin()

Loads the default (either from config or copydata or DDE) profile from d2bs.ini and gets to the lobby (for battle.net chars) or into a game (for single player characters).

Exceptions

"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 voidlogin(String profile)

Loads the profile from d2bs.ini and gets to the lobby (for battle.net chars) or into a game (for single player characters).

Parameters

Exceptions

"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 boolselectCharacter(String profile)

Select the character from the given profile.

Keeps all details except the character name from old profile.

Parameters

Returns

Whether or not character swap was successful.

public voidcreateGame(String name,String pass,int32_t diff)

Create a game with the given name and password in the given difficulty.

Parameters

public voidjoinGame(String name,String pass)

Join a game with the given name and password.

Parameters

public voidaddProfile(String profile,String mode,String gateway,String username,String password,String charname,intspDifficulty)

Create a profile with the given profile name, mode, gateway, username, password, character name and single player difficulty.

Parameters

publicint`[getLocation](#group__globalFunctions_1ga21d43545897ce3af3692562593053480)()`

Get the current OOG location.

Todo: Create a reference for the return values.

Returns

The current OOG location.

public voidloadMpq(String path)

Load an mpq file.

Parameters

public boolsubmitItem()

Submit the item on the cursor to the open screen (like the add sockets screen).

Returns

Whether or not it was successful.

publicint`[getMouseCoords](#group__globalFunctions_1gadf9310ea4d054d7013f93e4e8e840af4)(bool nFlag,bool nReturn)`

Get the mouse coordinates (in screen or map space) and return as an array.

Get the mouse coordinates (in screen or map space) and return as an Object.

Parameters

Returns

The mouse coordinates in an array. 0 - x, 1 - y.

Parameters

Returns

The mouse coordinates in an array. Has properties .x and .y.

publicUnit`[copyUnit](#group__globalFunctions_1ga8db0ed764b74081b12b217918f5f2f94)([Unit](#classUnit) other)`

Copy the cached data associated with given unit.

This is things like type and unit id.

Todo: Figure out why anyone would want to copy a unit.

Returns

The new copy of the unit.

public boolclickMap(uint16_t nClickType,uint16_t nShift,UnittoClick)

Click on the map with the given click type and possibly shift at the given unit.

Parameters

Todo: Get a reference for nClickType.

Returns

Whether or not the click was successful.

public boolclickMap(uint16_t nClickType,bool nShift,UnittoClick)

Click on the map with the given click type and possibly shift at the given unit.

Parameters

Todo: Get a reference for nClickType.

Returns

Whether or not the click was successful.

public boolclickMap(uint16_t nClickType,uint16_t nShift,uint16_t nX,uint16_t nY)

Click on the map with the given click type and possibly shift at the given point.

Parameters

Todo: Get a reference for nClickType.

Returns

Whether or not the click was successful.

public boolclickMap(uint16_t nClickType,bool nShift,uint16_t nX,uint16_t nY)

Click on the map with the given click type and possibly shift at the given point.

Parameters

Todo: Get a reference for nClickType.

Returns

Whether or not the click was successful.

public boolacceptTrade(intaction)

Get or do something to do with accepting trade.

Parameters

1 - Get whether trade we've accepted trade already or not.

2 - Get the trade flag ...

3 - Get whether the check is red or not.

Returns

The flag specified by action.

public boolacceptTrade()

Accept a trade if not already accepted, cancel a trade if already accepted.

Todo: Verify that I understand this correctly.

Returns

Whether or not trade was accepted.

public voidtradeOk()

Hit the OK button to open the trade window.

Throws an error if client not in a proper state to click ok.

public object[]getDialogLines()

Get the lines of dialog of whatever you're talking to.

Each object has a text property which gives the text and a selectable property which is a boolean as to whether you can click on that line or not.

Returns

An array of objects of the lines, or undefined if no dialog up.

public voidbeep(intnBeepId)

Beep with beep ID nBeepId.

Parameters

public voidclickItem(Unititem)

Click an item.

Parameters

public voidclickItem(intnClickType,intnBodyLoc)

Click on a body location with a certain click type.

Parameters

0 - Not equipped

1 - Helmet

2 - Amulet

3 - Armor

4 - Right hand slot 1

5 - Left hand slot 1

6 - Right ring

7 - Left ring

8 - Belt

9 - Boots

10 - Gloves

11 - Right hand slot 2

12 - Left hand slot 2

public voidclickItem(intnClickType,Unititem)

Click on a given item with the given click type.

Parameters

public voidclickItem(intnClickType,intnX,intnY,intnLoc)

Click an item location with the given click type.

Parameters

2 - Belt

3 - Inventory

4 - Player trade

6 - Cube

7 - Stash

public doublegetDistance(Unita)

Get the euclidean distance from me to a.

Parameters

Returns

The euclidean distance from a.

public doublegetDistance(Unita,Unitb)

Get the euclidean distance from a to b.

Parameters

Returns

The euclidean distance from a to b.

public doublegetDistance(Unita,int32_t bx,int32_t by)

Get the euclidean distance from a to b.

Parameters

Returns

The euclidean distance from a to b.

public doublegetDistance(int32_t ax,int32_t ay)

Get the euclidean distance from me to a.

Parameters

Returns

The euclidean distance from me to a.

public doublegetDistance(int32_t ax,int32_t ay,Unitb)

Get the euclidean distance from a to b.

Parameters

Returns

The euclidean distance from a to b.

public doublegetDistance(int32_t ax,int32_t ay,int32_t bx,int32_t by)

Get the euclidean distance from a to b.

Parameters

Returns

The euclidean distance from a to b.

public voidgold(intnGold,intnMode)

Do something with some gold.

Todo: Determine what the values for nMode are.

Parameters

publicint`[checkCollision](#group__globalFunctions_1gacbe9f546980a44ff675f8c5b77d617d3)([Unit](#classUnit) a,[Unit](#classUnit) b,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nBitMask)`

Check if two units collide.

Parameters

public boolplaySound(intnSoundId)

Play d2 sound by id.

Returns

true

public voidquit()

Quit the game.

public voidquitGame()

Quit Diablo II.

Allows the core to shutdown, than terminates the process.

public boolsay(...)

Say the string equivalent of the each of the arguments.

Returns

true if at least one parameter was sent in.

public boolclickParty(Partyplayer,intnMode)

Click one of the buttons in the party screen for the given player.

Parameters

0 - Allow loot corpse

1 - Hostile player

2 - Join party

3 - Leave party (doesn't matter which party is passed in)

publicint`[weaponSwitch](#group__globalFunctions_1gab9c5eb66ccf79108ee26a7f73943d0bc)(int32_t dummy)`

Get which weapon switch is being used.

Switch the weapons.

Parameters

Returns

Which weapon switch is active.

Parameters

Returns

true

public voidtransmute()

Hit the transmute button.

public voiduseStatPoint(uint16_t statType,uint32_t count)

Use a stat point.

BE CAREFUL! This function directly sends packets without checks. If you call this function and do not have the points, or specify an invalid stat, you might get flagged/banned.

Todo: Come up with a reference for the statType values

Parameters

public voiduseSkillPoint(uint16_t skill,uint32_t count)

Use a skill point.

BE CAREFUL! This function directly sends packets without checks. If you call this function and do not have the points, or specify an invalid skill, you might get flagged/banned.

Todo: Come up with a reference for the skill values

Parameters

public voidtakeScreenshot()

Take a screenshot.

Performs the action that pressing print screen (by default) would do

public boolmoveNPC(Unitnpc,uint32_t x,uint32_t y)

Move NPC to a new location.

This is an exploit function.

Parameters

Returns

true

public boolgetPacket(...)

Send a packet to the client.

Params are length, val, length, val, ... Length is the number of bytes in the following value. Value is an integer, put in the packet little endian. Maximum packet length is 20.

This is an exploit function.

Returns

true

public boolsendPacket(...)

Send a packet to the server.

Params are length, val, length, val, ... Length is the number of bytes in the following value. Value is an integer, put in the packet little endian. Maximum packet length is 20.

This is an exploit function.

Returns

true

public StringgetIP()

Get the external IP by going to "http://automation.whatismyip.com/n09230945.asp" and parsing the result.

public ObjectscreenToAutomap(Object arg)

Convert a point from screen coordinates to automap coordinates.

Parameters

Returns

An object with x and y, containing the automap coordinate.

public ObjectscreenToAutomap(intix,intiy)

Convert a point from screen coordinates to automap coordinates.

Parameters

Returns

An object with x and y, containing the automap coordinate.

public ObjectautomapToScreen(Object arg)

Convert a point from automap coordinates to screen coordinates.

Parameters

Returns

An object with x and y, containing the screen coordinate.

public ObjectautomapToScreen(intix,intiy)

Convert a point from automap coordinates to screen coordinates.

Parameters

Returns

An object with x and y, containing the screen coordinate.

public Stringmd5(String str)

Takes the md5 hash.

Parameters

Returns

The md5 hash of the string.

public Stringsha1(String str)

Takes the sha1 hash.

Parameters

Returns

The sha1 hash of the string.

public Stringsha256(String str)

Takes the sha256 hash.

Parameters

Returns

The sha256 hash of the string.

public Stringsha384(String str)

Takes the sha384 hash.

Parameters

Returns

The sha384 hash of the string.

public Stringsha512(String str)

Takes the sha512 hash.

Parameters

Returns

The sha512 hash of the string.

public Stringmd5_file(String file)

Take the md5 hash of a file.

Parameters

Returns

The md5 hash of the file.

public Stringsha1_file(String file)

Take the sha1 hash of a file.

Parameters

Returns

The sha1 hash of the file.

public Stringsha256_file(String file)

Take the sha256 hash of a file.

Parameters

Returns

The sha256 hash of the file.

public Stringsha384_file(String file)

Take the sha384 hash of a file.

Parameters

Returns

The sha384 hash of the file.

public Stringsha512_file(String file)

Take the sha512 hash of a file.

Parameters

Returns

The sha512 hash of the file.

namespace ProfileType

ProfileType enum.

Summary

Members Descriptions
enumProfileType

Members

enumProfileType

Values Descriptions
singlePlayer
battleNet
openBattleNet
tcpIpHost
tcpIpJoin

class Area

Represent an Area of the map.

Summary

Members Descriptions
publicExit`[exits`](#classArea_1a56bbc920b4b5ca70d070a8157824a1de) Get an array of the Area's exits.
public Stringname The name of the Area.
publicint`[x`](#classArea_1a7b57ea354fbe94f9480d28e07857e4c3) The x coordinate of the left side of the map.
publicint`[xsize`](#classArea_1ac030cf51b89f3c58b1672b84f57d8573) The x size (width) of the map.
publicint`[y`](#classArea_1adca338a7f47c9e2cba5f8a4b6cb862a5) The y coordinate of the bottom (smallest y) of the map.
publicint`[ysize`](#classArea_1ade6c62f10571d7318680fe9e5e28496f) The y size (height) of the map.
publicint`[id`](#classArea_1a7871c593963912cebd55208e71b3d16f) The area id.

Members

publicExit`[exits`](#classArea_1a56bbc920b4b5ca70d070a8157824a1de)

Get an array of the Area's exits.

This includes arrays where you can walk between two areas and warp Unit s.

public Stringname

The name of the Area.

publicint`[x`](#classArea_1a7b57ea354fbe94f9480d28e07857e4c3)

The x coordinate of the left side of the map.

publicint`[xsize`](#classArea_1ac030cf51b89f3c58b1672b84f57d8573)

The x size (width) of the map.

publicint`[y`](#classArea_1adca338a7f47c9e2cba5f8a4b6cb862a5)

The y coordinate of the bottom (smallest y) of the map.

publicint`[ysize`](#classArea_1ade6c62f10571d7318680fe9e5e28496f)

The y size (height) of the map.

publicint`[id`](#classArea_1a7871c593963912cebd55208e71b3d16f)

The area id.

See Unit::area.

class Box

A Box screen hook.

Todo: Explain (and understand) this better.

Verify all the documentation in this class.

Summary

Members Descriptions
publicint`[x`](#classBox_1a180c7a450afc2e8cfe4dddb50eeaa4f2) The x coordinate (left) of the Box.
publicint`[y`](#classBox_1a1b13c5067471d1052c6f3191f260c785) The y coordinate (top) of the Box.
publicint`[xsize`](#classBox_1a26d7213ca75ae43589b05354efe153d6) The xsize (width) of the Box.
publicint`[ysize`](#classBox_1a81988ee738d5c278c72bb1016addd712) The ysize (height) of the Box.
public boolvisible Whether or not the Box is visible.
publicint`[align`](#classBox_1a1703dbd7e3fdce5b0fd8f9250cc99ade) The horizontal alignment.
publicint`[zorder`](#classBox_1a3f51df7eadec72ac84ca1bede15ea008) The z-order of the Box (what it covers up and is covered by).
public ClickHandlerclick The click handler that gets called when the Box is clicked.
public HoverHandlerhover The hover handler that gets called when the Box gets hovered over.
publicint`[color`](#classBox_1aa9c08a5f737f77a0d4a6d61192dadeb6) The color of the Box.
publicint`[opacity`](#classBox_1af39fa1fbcc7398a6334531934f85a878) How much of the controls underneath the Box should show through.
publicBox(intx,inty,intx2,inty2,intcolor,intopacity,intalign,bool automap,ClickHandler click,HoverHandler hover) Create a Box hook with the given parameters.
public voidremove() Remove the Box from the screen and destroy the corresponding object.

Members

publicint`[x`](#classBox_1a180c7a450afc2e8cfe4dddb50eeaa4f2)

The x coordinate (left) of the Box.

publicint`[y`](#classBox_1a1b13c5067471d1052c6f3191f260c785)

The y coordinate (top) of the Box.

publicint`[xsize`](#classBox_1a26d7213ca75ae43589b05354efe153d6)

The xsize (width) of the Box.

publicint`[ysize`](#classBox_1a81988ee738d5c278c72bb1016addd712)

The ysize (height) of the Box.

public boolvisible

Whether or not the Box is visible.

publicint`[align`](#classBox_1a1703dbd7e3fdce5b0fd8f9250cc99ade)

The horizontal alignment.

0 - Left

1 - Right

2 - Center

publicint`[zorder`](#classBox_1a3f51df7eadec72ac84ca1bede15ea008)

The z-order of the Box (what it covers up and is covered by).

public ClickHandlerclick

The click handler that gets called when the Box is clicked.

public HoverHandlerhover

The hover handler that gets called when the Box gets hovered over.

publicint`[color`](#classBox_1aa9c08a5f737f77a0d4a6d61192dadeb6)

The color of the Box.

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000

publicint`[opacity`](#classBox_1af39fa1fbcc7398a6334531934f85a878)

How much of the controls underneath the Box should show through.

publicBox(intx,inty,intx2,inty2,intcolor,intopacity,intalign,bool automap,ClickHandler click,HoverHandler hover)

Create a Box hook with the given parameters.

Parameters

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000

Parameters

0 - Left

1 - Right

2 - Center

Parameters

public voidremove()

Remove the Box from the screen and destroy the corresponding object.

class Control

This class represents out of game (OOG) Control s.

Summary

Members Descriptions
public Stringtext The text of the Control.
public doublex The x coordinate of the Control.
public doubley The y coordinate of the Control.
public doublexsize The xsize (width) of the Control.
public doubleysize The ysize (height) of the Control.
public doublestate The state (?) of the Control.
public boolpassword Return whether or not the Control holds a password (starred out text).
public doubletype The type of control.
public doublecursorPos Something...
public doubleselectstart Someting...
public doubleselectend Something...
public doubledisabled Whether the Control is disabled or not.
publicControl`[getNext](#classControl_1a4894f8dd6595425524cd468938ed327c)()` Gets the next Control from the linked list.
public voidclick() Click Control in the center of the Control.
public voidclick(uint32_t x,uint32_t y) Click Control at the given location.
public voidsetText(String text) Set the Control's text.
public String[]getText() Get the texts from a label Control.

Members

public Stringtext

The text of the Control.

public doublex

The x coordinate of the Control.

public doubley

The y coordinate of the Control.

public doublexsize

The xsize (width) of the Control.

public doubleysize

The ysize (height) of the Control.

public doublestate

The state (?) of the Control.

Todo: Find a reference for these values.

public boolpassword

Return whether or not the Control holds a password (starred out text).

public doubletype

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 doublecursorPos

Something...

Todo: Determine what this is.

public doubleselectstart

Someting...

Todo: Determine what this is.

public doubleselectend

Something...

Todo: Determine what this is.

public doubledisabled

Whether the Control is disabled or not.

publicControl`[getNext](#classControl_1a4894f8dd6595425524cd468938ed327c)()`

Gets the next Control from the linked list.

This is done by finding the old Control based on type, location and size.

public voidclick()

Click Control in the center of the Control.

public voidclick(uint32_t x,uint32_t y)

Click Control at the given location.

This is equivalent with clicking at the given location.

Parameters

public voidsetText(String text)

Set the Control's text.

Parameters

public String[]getText()

Get the texts from a label Control.

Only works for labels.

Returns

An array of all the Control's texts.

class D2BSScript

Represents a script (a thread), created by either loading a file, or typing something in the console.

Summary

Members Descriptions
public Stringname The relative filename of the script.
publicint`[type`](#classD2BSScript_1aee04c264935a168134c967506123d49c) The type of script.
public boolrunning Whether or not the script is running.
publicint`[threadid`](#classD2BSScript_1a85c1a8f5ec4bef0563d07209a1f1d2a1) The thread id.
public boolgetNext() Get the next script.
public voidpause() Pause the script.
public voidresume() Resume the script.
public voidjoin() Wait for other script to finish.
public voidstop() Stop the script.
public voidsend(...) Send some values to the script.

Members

public Stringname

The relative filename of the script.

If the script is from the console the filename will be reported as "Command Line".

publicint`[type`](#classD2BSScript_1aee04c264935a168134c967506123d49c)

The type of script.

0 - InGame

1 - OutOfGame or Command

public boolrunning

Whether or not the script is running.

publicint`[threadid`](#classD2BSScript_1a85c1a8f5ec4bef0563d07209a1f1d2a1)

The thread id.

public boolgetNext()

Get the next script.

Returns

Whether there was another script or not.

public voidpause()

Pause the script.

public voidresume()

Resume the script.

public voidjoin()

Wait for other script to finish.

public voidstop()

Stop the script.

public voidsend(...)

Send some values to the script.

Has the effect of calling the any listeners to scriptmsg with the parameters provided.

class DBStatement

A class describing ...

Todo: Get a better description (and understanding).

Summary

Members Descriptions
public Stringsql The statement string.
public boolready Whether or not there is more data to be gotten.
public ObjectgetObject() An object with property names from the column names and property values coming from the data.
publicint`[getColumnCount](#classDBStatement_1acd872f8af18dccfa9e6a65d0e7451d25)()` Get the column count.
public doublegetColumnValue(intcolIndex) Get the value from the column specified by index.
public StringgetColumnValue(intcolIndex) Get the value from the column specified by index.
publicgetColumnName(intcolIndex) Get the name of the column at the given index.
public boolgo() Call sqlite3_step and close_db_stmt on the statement.
public boolnext() Call sqlite3_step on the statement.
publicint`[skip](#classDBStatement_1a52b6771be336a56bbc8f02bcb99e55c7)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) rows)` Skip a certain number of rows in the results.
public boolreset() Call sqlite3_reset.
public boolclose() Close the statement.
public boolbind(intcolnum,double val) Bind the given data to the given column.
public boolbind(intcolnum,intval) Bind the given data to the given column.
public boolbind(intcolnum,String val) Bind the given data to the given column.
public boolbind(intcolnum,bool val) Bind the given data to the given column.

Members

public Stringsql

The statement string.

public boolready

Whether or not there is more data to be gotten.

public ObjectgetObject()

An object with property names from the column names and property values coming from the data.

Returns

The object with all the data.

publicint`[getColumnCount](#classDBStatement_1acd872f8af18dccfa9e6a65d0e7451d25)()`

Get the column count.

Returns

The column count.

public doublegetColumnValue(intcolIndex)

Get the value from the column specified by index.

Parameters

Returns

The data.

public StringgetColumnValue(intcolIndex)

Get the value from the column specified by index.

Parameters

Returns

The data.

publicgetColumnName(intcolIndex)

Get the name of the column at the given index.

Parameters

Returns

The column name.

public boolgo()

Call sqlite3_step and close_db_stmt on the statement.

Todo: Interpret what this means.

Returns

Whether the result is SQLITE_DONE.

public boolnext()

Call sqlite3_step on the statement.

Todo: Interpret what this means and how's it's different from go().

Returns

Whether the result is SQLITE_ROW.

publicint`[skip](#classDBStatement_1a52b6771be336a56bbc8f02bcb99e55c7)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) rows)`

Skip a certain number of rows in the results.

Parameters

Returns

The number of rows actually skipped.

public boolreset()

Call sqlite3_reset.

Todo: Interpret what this does.

Returns

true.

public boolclose()

Close the statement.

Returns

true.

public boolbind(intcolnum,double val)

Bind the given data to the given column.

Parameters

Returns

true.

public boolbind(intcolnum,intval)

Bind the given data to the given column.

Parameters

Returns

true.

public boolbind(intcolnum,String val)

Bind the given data to the given column.

Parameters

Returns

true.

public boolbind(intcolnum,bool val)

Bind the given data to the given column.

Parameters

Returns

true.

class Exit

Represents a method of getting from one Area to another.

Summary

Members Descriptions
publicint`[x`](#classExit_1ad611f082650a2cb50c55e45a22aeea77) The x coordinate of the exit.
publicint`[y`](#classExit_1a46d25b3b696f875747de1f4ddfbbf1a5) The y coordinate of the exit.
publicint`[target`](#classExit_1a6980668d676c2c6c4c465f05a65fbe20) The Area ID of the target level.
publicint`[type`](#classExit_1ad79ae2186aea695de8bba1cb25147b6b) The Exit type.
publicint`[tileid`](#classExit_1a173070014dcf8334a334f8005035d8b5) The class ID of the Exit if it is a stairs type Exit, 0 otherwise.
publicint`[level`](#classExit_1ad626cb965b1345961c7c98808a5c4cd9) The Area ID of the source side of the Exit.

Members

publicint`[x`](#classExit_1ad611f082650a2cb50c55e45a22aeea77)

The x coordinate of the exit.

publicint`[y`](#classExit_1a46d25b3b696f875747de1f4ddfbbf1a5)

The y coordinate of the exit.

publicint`[target`](#classExit_1a6980668d676c2c6c4c465f05a65fbe20)

The Area ID of the target level.

publicint`[type`](#classExit_1ad79ae2186aea695de8bba1cb25147b6b)

The Exit type.

1 - A walk through Exit

2 - A stairs type Exit

publicint`[tileid`](#classExit_1a173070014dcf8334a334f8005035d8b5)

The class ID of the Exit if it is a stairs type Exit, 0 otherwise.

publicint`[level`](#classExit_1ad626cb965b1345961c7c98808a5c4cd9)

The Area ID of the source side of the Exit.

class File

This class handles the opening, reading and writing of files.

Summary

Members Descriptions
public boolreadable Whether or not the file can be read from.
public boolwriteable Whether or not the file is writeable.
public boolseekable Whether or not the file is seekable.
publicint`[mode`](#classFile_1ad69e4f31f332da4ce62d4dbbf905fc3b) The mode the file was opened with.
public boolbinaryMode Whether the file was opened as a binary file or not.
publicint`[length`](#classFile_1a29b6bf8632786b651f99746906cefafb) The file length.
public Stringpath The relative path to the File (the filename/path given for opening).
publicint`[position`](#classFile_1a336836eda3d033e4005283f2f1604cb3) The position in the File (where the next read or write will occur).
public booleof Whether or not the File is at end of file.
publicint`[accessed`](#classFile_1a5a63aa7adeaaffddbd52b7c15aea8c87) The last accessed time of the File.
publicint`[created`](#classFile_1a7ff0ed452a129324a9a5fcbee803a373) The creation time of the File.
publicint`[modified`](#classFile_1af946c3c5984c1e0580db67bd80c24215) The last modified time of the File.
public boolautoflush Whether or not to autoflush the File.
publicFile`[close](#classFile_1ab8f676c747765ad97655928f1c2baf04)()` Close the current file and then return it.
publicFile`[reopen](#classFile_1a6fe4ccb2fea82b46e091aa7c46df4dbe)()` Reopen the file, equivalent to calling open with the same parameters as were used the first time.
public Stringread(intcount) Read count chars from the file.
public byte[]read(intcount) Read count bytes from the file.
public StringreadLine() Read a line from the file and return it.
public String[]readAllLines() Read all the lines from the file into a String array.
public StringreadAll() Read the entire file and return as a String.
publicFile`[write](#classFile_1a90860f54a694ad17207855c4ff0c6053)(...)` Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the File.
publicFile`[seek](#classFile_1ad3b8e538df678492e7f5e0330c613809)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) n)` Seek n bytes from the current location.
publicFile`[seek](#classFile_1ad88c69806c5f39b110cc8277cb7dc7f6)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) 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).
publicFile`[flush](#classFile_1a53a7ee7193e77c0fe8c139f0965e3720)()` Flush the buffers for the File.
publicFile`[reset](#classFile_1ae367f8c9c2b0fa514d9a15feea63cfe5)()` Seek back to the beginning of the File.
publicFile`[end](#classFile_1ae1809bb15e04ae6085b444f3e8fbc943)()` Seek to the end of the File.

Members

public boolreadable

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 boolwriteable

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 boolseekable

Whether or not the file is seekable.

Based on whether the File is open and whether there is an error pending.

publicint`[mode`](#classFile_1ad69e4f31f332da4ce62d4dbbf905fc3b)

The mode the file was opened with.

Compare with FILE_READ, FILE_WRITE and FILE_APPEND.

public boolbinaryMode

Whether the file was opened as a binary file or not.

publicint`[length`](#classFile_1a29b6bf8632786b651f99746906cefafb)

The file length.

public Stringpath

The relative path to the File (the filename/path given for opening).

publicint`[position`](#classFile_1a336836eda3d033e4005283f2f1604cb3)

The position in the File (where the next read or write will occur).

public booleof

Whether or not the File is at end of file.

publicint`[accessed`](#classFile_1a5a63aa7adeaaffddbd52b7c15aea8c87)

The last accessed time of the File.

publicint`[created`](#classFile_1a7ff0ed452a129324a9a5fcbee803a373)

The creation time of the File.

publicint`[modified`](#classFile_1af946c3c5984c1e0580db67bd80c24215)

The last modified time of the File.

public boolautoflush

Whether or not to autoflush the File.

publicFile`[close](#classFile_1ab8f676c747765ad97655928f1c2baf04)()`

Close the current file and then return it.

Returns

The same File object.

publicFile`[reopen](#classFile_1a6fe4ccb2fea82b46e091aa7c46df4dbe)()`

Reopen the file, equivalent to calling open with the same parameters as were used the first time.

Returns

The same File object.

public Stringread(intcount)

Read count chars from the file.

Used when the file was not opened in binary mode.

Parameters

Returns

The characters that were read.

public byte[]read(intcount)

Read count bytes from the file.

Used when the file was opened in binary mode.

Parameters

Returns

An array of the bytes read.

public StringreadLine()

Read a line from the file and return it.

Returns

The line.

public String[]readAllLines()

Read all the lines from the file into a String array.

Returns

An array of all the lines in the file.

public StringreadAll()

Read the entire file and return as a String.

Includes a seek to start from the beginning of the file, regardless of where the current position was.

Returns

The entire file in a String.

publicFile`[write](#classFile_1a90860f54a694ad17207855c4ff0c6053)(...)`

Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the File.

Returns

The File.

publicFile`[seek](#classFile_1ad3b8e538df678492e7f5e0330c613809)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) n)`

Seek n bytes from the current location.

Parameters

Returns

The File.

publicFile`[seek](#classFile_1ad88c69806c5f39b110cc8277cb7dc7f6)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) n,bool isLines,bool fromStart)`

Seek n bytes or lines (depending on isLines) from the current location or the start of file (depending on fromStart).

Parameters

Returns

The File.

publicFile`[flush](#classFile_1a53a7ee7193e77c0fe8c139f0965e3720)()`

Flush the buffers for the File.

Returns

The File.

publicFile`[reset](#classFile_1ae367f8c9c2b0fa514d9a15feea63cfe5)()`

Seek back to the beginning of the File.

Returns

The File.

publicFile`[end](#classFile_1ae1809bb15e04ae6085b444f3e8fbc943)()`

Seek to the end of the File.

Returns

The File.

class FileTools

A collection of tools to do things like move files and determine whether files exist.

Summary

Members Descriptions
public boolwriteText(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 boolappendText(String file,...) Append the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.

Members

public boolwriteText(String file,...)

Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.

Parameters

Returns

Whether or not the operation was successful.

public boolappendText(String file,...)

Append the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.

Parameters

Returns

Whether or not the operation was successful.

class Folder

Represents a folder.

Summary

Members Descriptions
public Stringname The path name to the directory.
publicFolder`[create](#classFolder_1a3a0bac848c1e110eb40dde3cd48393b8)(String name)` Create a new directory.
public boolremove() Remove the directory.
public String[]getFiles() Get the filename for each of the files in the directory.
public String[]getFolders() Get the name for each of the sub-directories in the current directory.

Members

public Stringname

The path name to the directory.

publicFolder`[create](#classFolder_1a3a0bac848c1e110eb40dde3cd48393b8)(String name)`

Create a new directory.

Parameters

Returns

The new Folder created.

public boolremove()

Remove the directory.

Must be empty to work properly.

Returns

true.

public String[]getFiles()

Get the filename for each of the files in the directory.

Returns

An array of all the filenames.

public String[]getFolders()

Get the name for each of the sub-directories in the current directory.

Returns

An array of all the folder names.

class Frame

This class represents a screen hook for a Frame.

Todo: Explain (and understand) this better.

Verify all the documentation in this class.

Summary

Members Descriptions
publicint`[x`](#classFrame_1a0e43afae34b6d1fb613a42fa5e027d01) The x coordinate (left) of the Frame.
publicint`[y`](#classFrame_1a465bb636563d27695e1505e778e08c57) The y coordinate (top) of the Frame.
publicint`[xsize`](#classFrame_1a3217f35f7ca8516a5f636edc928badbf) The xsize (width) of the Frame.
publicint`[ysize`](#classFrame_1adb6e9d30c3b3452aae2b3744701b4b89) The ysize (height) of the Frame.
public boolvisible Whether or not the Frame is visible.
publicint`[align`](#classFrame_1a7344aa54a7eeaa68fdf7fa42b0fa0a29) The horizontal alignment.
publicint`[zorder`](#classFrame_1a7b6c33df644c92758f289fd76e905b89) The z-order of the Frame (what it covers up and is covered by).
public ClickHandlerclick The click handler that gets called when the Frame is clicked.
public HoverHandlerhover The hover handler that gets called when the Frame gets hovered over.
publicFrame(intx,inty,intx2,inty2,intalign,bool automap,ClickHandler click,HoverHandler hover) Create a Frame hook with the given parameters.
public voidremove() Remove the Frame from the screen and destroy the corresponding object.

Members

publicint`[x`](#classFrame_1a0e43afae34b6d1fb613a42fa5e027d01)

The x coordinate (left) of the Frame.

publicint`[y`](#classFrame_1a465bb636563d27695e1505e778e08c57)

The y coordinate (top) of the Frame.

publicint`[xsize`](#classFrame_1a3217f35f7ca8516a5f636edc928badbf)

The xsize (width) of the Frame.

publicint`[ysize`](#classFrame_1adb6e9d30c3b3452aae2b3744701b4b89)

The ysize (height) of the Frame.

public boolvisible

Whether or not the Frame is visible.

publicint`[align`](#classFrame_1a7344aa54a7eeaa68fdf7fa42b0fa0a29)

The horizontal alignment.

0 - Left

1 - Right

2 - Center

publicint`[zorder`](#classFrame_1a7b6c33df644c92758f289fd76e905b89)

The z-order of the Frame (what it covers up and is covered by).

public ClickHandlerclick

The click handler that gets called when the Frame is clicked.

public HoverHandlerhover

The hover handler that gets called when the Frame gets hovered over.

publicFrame(intx,inty,intx2,inty2,intalign,bool automap,ClickHandler click,HoverHandler hover)

Create a Frame hook with the given parameters.

Parameters

0 - Left

1 - Right

2 - Center

Parameters

public voidremove()

Remove the Frame from the screen and destroy the corresponding object.

class Image

This class represents a screen hook for a Image.

Todo: Explain (and understand) this better.

Verify all the documentation in this class.

Summary

Members Descriptions
publicint`[x`](#classImage_1a7f8f4530212c93856e611030e46c82af) The x coordinate (left) of the Image.
publicint`[y`](#classImage_1a9b03b7d8dd6f69cb5a444bdd0edd786e) The y coordinate (top) of the Image.
public boolvisible Whether or not the Image is visible.
publicint`[align`](#classImage_1a943ad156731bd86b94d77e4f617e0fe8) The horizontal alignment.
publicint`[zorder`](#classImage_1a8f7cef488ff6a72dde9dea8a5c14e39b) The z-order of the Image (what it covers up and is covered by).
public ClickHandlerclick The click handler that gets called when the Image is clicked.
public HoverHandlerhover The hover handler that gets called when the Image gets hovered over.
public Stringlocation Location of the file to load for display.
publicImage(String szText,intx,inty,intcolor,intalign,bool automap,ClickHandler click,HoverHandler hover) Create an Image hook with the given parameters.
public voidremove() Remove the Image from the screen and destroy the corresponding object.

Members

publicint`[x`](#classImage_1a7f8f4530212c93856e611030e46c82af)

The x coordinate (left) of the Image.

publicint`[y`](#classImage_1a9b03b7d8dd6f69cb5a444bdd0edd786e)

The y coordinate (top) of the Image.

public boolvisible

Whether or not the Image is visible.

publicint`[align`](#classImage_1a943ad156731bd86b94d77e4f617e0fe8)

The horizontal alignment.

0 - Left

1 - Right

2 - Center

publicint`[zorder`](#classImage_1a8f7cef488ff6a72dde9dea8a5c14e39b)

The z-order of the Image (what it covers up and is covered by).

public ClickHandlerclick

The click handler that gets called when the Image is clicked.

public HoverHandlerhover

The hover handler that gets called when the Image gets hovered over.

public Stringlocation

Location of the file to load for display.

publicImage(String szText,intx,inty,intcolor,intalign,bool automap,ClickHandler click,HoverHandler hover)

Create an Image hook with the given parameters.

Parameters

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000

Parameters

0 - Left

1 - Right

2 - Center

Parameters

public voidremove()

Remove the Image from the screen and destroy the corresponding object.

class Line

A 2d line.

Todo: Verify all the documentation in this class.

Summary

Members Descriptions
publicint`[x`](#classLine_1aced699d771efdaea44224fb76035ad64) The first x coordinate of the Line.
publicint`[y`](#classLine_1aba0b47fa036eff1c6cbc4369389a0cf8) The first y coordinate of the Line.
publicint`[x2`](#classLine_1a4f08d1038eba337d6f0fb32713e528f1) The second x coordinate of the Line.
publicint`[y2`](#classLine_1ae31c92ab0df730a2fdd34201ce6feb9d) The second y coordinate of the Line.
public boolvisible Whether or not the Line is visible.
publicint`[color`](#classLine_1a9efd376d9b6ac16dd115bd7bfbf9c923) The color of the Line.
publicint`[zorder`](#classLine_1ab5abf5a8115842ca5e99a827966a332b) The z-order of the Line (what it covers up and is covered by).
public ClickHandlerclick The click handler that gets called when the Line is clicked.
public HoverHandlerhover The hover handler that gets called when the Line gets hovered over.
publicLine(intx,inty,intx2,inty2,intcolor,bool automap,ClickHandler click,HoverHandler hover) Create a Line hook with the given parameters.
public voidremove() Remove the Line from the screen and destroy the corresponding object.

Members

publicint`[x`](#classLine_1aced699d771efdaea44224fb76035ad64)

The first x coordinate of the Line.

publicint`[y`](#classLine_1aba0b47fa036eff1c6cbc4369389a0cf8)

The first y coordinate of the Line.

publicint`[x2`](#classLine_1a4f08d1038eba337d6f0fb32713e528f1)

The second x coordinate of the Line.

publicint`[y2`](#classLine_1ae31c92ab0df730a2fdd34201ce6feb9d)

The second y coordinate of the Line.

public boolvisible

Whether or not the Line is visible.

publicint`[color`](#classLine_1a9efd376d9b6ac16dd115bd7bfbf9c923)

The color of the Line.

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000

publicint`[zorder`](#classLine_1ab5abf5a8115842ca5e99a827966a332b)

The z-order of the Line (what it covers up and is covered by).

public ClickHandlerclick

The click handler that gets called when the Line is clicked.

public HoverHandlerhover

The hover handler that gets called when the Line gets hovered over.

publicLine(intx,inty,intx2,inty2,intcolor,bool automap,ClickHandler click,HoverHandler hover)

Create a Line hook with the given parameters.

Parameters

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000

Parameters

public voidremove()

Remove the Line from the screen and destroy the corresponding object.

class Me

The class that represents the controlled unit.

Technically, also called Unit, but since C++ doesn't support class overloading, called it Me here instead.

Summary

Members Descriptions
publicint`[type`](#classMe_1a52c5b4db63a7b8446dc8107fc07cdf3d) The type of the unit.
publicint`[classId`](#classMe_1afc46c25e98a712ddbab9fe5b1895c581) The class id of the object.
publicint`[mode`](#classMe_1aaaa649505660616f54b0ee92776a25b8) The mode of the unit.
public Stringname The name of the unit.
publicint`[mapid`](#classMe_1aeca5382b1726287c31235f5cc9d4d22d) The seed used to create the map.
publicint`[act`](#classMe_1a9ac2b33c84c6cd3b15afa9b42929fc3f) The act where the unit is currently located.
publicint`[gid`](#classMe_1a1c9269b25de87db3987394c129ef4416) The unit unique id.
publicint`[x`](#classMe_1a6e1986e643022cf0768b14b83f14d01b) The x location of the unit.
publicint`[y`](#classMe_1aa554298f46bbfaf83a341b5e3d86b2e5) The y location of the unit.
publicint`[targetx`](#classMe_1ae57bbfa40548f63d807ec5ead0301024) The target x location of the unit.
publicint`[targety`](#classMe_1afe98390a5d4f85c8acd10b6312616c7f) The target y location of the unit.
publicint`[area`](#classMe_1a20c97fb4d7a65f1125b2ef94edc93382) The id of the area (level) the unit is located in.
publicint`[hp`](#classMe_1ada4675cf13005bce0c1562c903dc44c5) The unit's current health.
publicint`[hpmax`](#classMe_1a76936aa550e766f03719a350a0166a08) The unit's maximum health.
publicint`[mp`](#classMe_1a2818fdee3d22e50df4d044294978efc4) The unit's current mana.
publicint`[mpmax`](#classMe_1aff3b5b0dd48925f742d96385f0cc3391) The unit's maximum mana.
publicint`[stamina`](#classMe_1ab53e765f014b5a962dc0cf0374d61047) The unit's current stamina.
publicint`[staminamax`](#classMe_1a27dc070bdfcf26014c8e05f8c3d45d54) The unit's maximum stamina.
publicint`[charlvl`](#classMe_1ad1de73d82c060287cddb8c5e111c4763) The character level.
publicint`[itemcount`](#classMe_1ad1ccf5dc94d072c2ceb7b505868e2058) The number of items in inventory.
public doubleowner The unit id of the owner of the unit.
publicint`[ownertype`](#classMe_1a6f9f7bbef6962920fe9306a620f204b6) The type of owner.
publicint`[spectype`](#classMe_1ad244e2f81cefed6a58bc2b3aed36b9f3) The special type of the unit.
publicint`[direction`](#classMe_1a6ee239b2452d3c06e33de7e1725be36a) The direction of the unit.
public Stringcode The three digit code for an item.
public Stringprefix The magic prefix of the item.
public Stringsuffix The magic suffix of the item.
publicint`[prefixnum`](#classMe_1ae54c6d4c87d2ad0f7f1c9a6b1f4381fc) The id code for the magic prefix.
publicint`[suffixnum`](#classMe_1a3d523157c13fcf3229ecc1b9d7724367) The id code for the magic suffix.
public Stringfname The full name of an item.
publicint`[quality`](#classMe_1ace5f9a9c6a8139fbe30ca258e2f1bdc5) The item quality.
publicint`[node`](#classMe_1a71440306ac4fa9414da959b615f24200) No clue.
publicint`[location`](#classMe_1a8932e926ae2bd373885fd45b2ef78907) The location of the item (ground, inventory, stash, etc.).
publicint`[sizex`](#classMe_1a2a1356d1bb2c3fdbda515446a06b626f) The x size of the item.
publicint`[sizey`](#classMe_1ad5a059256862e2a27e4473f299c1c2a0) The y size of the item.
publicint`[itemType`](#classMe_1a5cbdd81b5607c8098994228fe5ab7151) The type of the item.
public Stringdescription The description of the item.
publicint`[bodylocation`](#classMe_1aa895c745c9f4f909986ddbacd7d31e73) The equipped location of the item.
publicint`[ilvl`](#classMe_1a742c6b149eeaafd2e947662a2a7a3c61) Item level.
publicint`[runwalk`](#classMe_1ab3fd8214e6809542ea1b99f0a2cd2929) Whether the controlled character is in the always run mode or not.
publicint`[weaponswitch`](#classMe_1adb2a8033d013320f821b7afefab5749a) Set the weapon switch.
public Stringaccount The account name used to log on to the account.
public Stringcharname The character name.
publicint`[diff`](#classMe_1adddc240680097fd939d1afba7a1661cf) The difficulty of the game.
publicint`[maxdiff`](#classMe_1afc952d96b2b29fbee19791b2e6234e97) The maximum difficulty available.
public Stringgamename The name of the game.
public Stringgamepassword The password of the game.
public Stringgameserverip A string representation of the IPv4 address of the game server.
public doublegamestarttime Some sort of representation of the start time of the game.
publicint`[gametype`](#classMe_1ad31342341ab64e1444961ff1059c8a05) The game type, expansion or not.
public boolitemoncursor Whether or not there is an item on the cursor.
public boolladder Whether or not the game is a ladder game.
publicint`[ping`](#classMe_1aee8c765131a0ce6a04a5a78198d90910) The ping in milliseconds.
publicint`[fps`](#classMe_1a26cbb5b87c79ba3d8fd43e56cce260c7) The frame rate.
publicint`[playertype`](#classMe_1a8cf7291feb3bc8ebeb35dd5baf373427) Whether or not the gametype is hardcore.
public Stringrealm The realm name.
public Stringrealmshort The short realm name.
publicint`[mercrevivecost`](#classMe_1a913adbc2fce146ef6c9f5268a76ebfc5) The cost to revive the merc.
publicint`[chickenhp`](#classMe_1a215c51bfd214de4bff2eeefdc5ecd5ab) The health at which to chicken if the character drops below.
publicint`[chickenmp`](#classMe_1a7e95aede9d9b33b217e2c74b0aed9865) The mana at which to chicken if the character drops below.
public boolquitonhostile Whether to chicken if another player hostiles the controlled character.
public boolblockKeys Block keys...
public boolblockMouse Block mouse...
public boolgameReady Whether or not the game window is in the game.
public Stringprofile The profile currently being used.
public boolnopickup Whether the game is set to not pick up items or not.
public doublepid The process id of Diablo II.
publicint`[screensize`](#classMe_1acf69e064892375059446599a1494fea6) The window size.
public Stringwindowtitle The window title.
public boolingame True if the game is not at menu.
public boolquitonerror Whether or not to quit when there's an error.
publicint`[maxgametime`](#classMe_1ad4f57667eb1a3bd8e45288c9f3fe923a) The max time in milliseconds to stay in game before the game auto-quits.
public boolgetNext() Get the next unit that matches the originally given name or class id and originally specified mode.
public boolgetNext(String szName) Get the next unit that matches the given name and originally specified mode.
public boolgetNext(intdwClassId) Get the next unit that matches the given class id and originally specified mode.
public boolgetNext(String szName,intdwMode) Get the next unit that matches the given name and mode.
public boolgetNext(intdwClassId,intdwMode) Get the next unit that matches the given class id and mode.
public voidcancel() Cancel some form of interaction.
public boolrepair() Try to repair.
public booluseMenu(intmenuItem) Use an NPC menu.
public boolinteract() Interact with the unit.
public boolinteract(intdestId) Interact with a waypoint.
publicUnit`[getItem](#classMe_1ab6277b88eedb3985e94a7b2ec2d0ed5e)(String name,uint32_t mode,uint32_t nUnitId)` Get an item from inventory by name, mode and nUnitId.
publicUnit`[getItem](#classMe_1a1678e3178379630e2b4208e011129094)(uint32_t classId,uint32_t mode,uint32_t nUnitId)` Get an item from inventory by classId, mode and nUnitId.
publicUnit`[getItems](#classMe_1aa3a172ada3c1e477299cf697f3722076)()` Get all items from inventory.
publicUnit`[getMerc](#classMe_1a12c1ae747f947cc96bcda92d517e4fd4)()` Get a player's merc.
publicint`[getMercHP](#classMe_1a8b9d83bd2cc1d39c89c47c2f3d97f398)()` Get the merc's HP.
public StringgetSkill(inthand) Get skill name from hand.
publicint`[getSkill](#classMe_1a482e347e3d2131af87a6aca7019bf4fd)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) hand)` Get skill id from hand.
publicint`[getSkill](#classMe_1a68d6118cef94eb973cfa1591ea890e3f)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) dummy)` Get all skills.
publicint`[getSkill](#classMe_1a8319dc883867a8e9f6cc101ecbee0aa5)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSkillId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nExt)` Calls D2COMMON_GetSkillLevel and returns the result.
publicUnit`[getParent](#classMe_1a211afa5299fc94407dc2a6d78ebadd8c)()` Gets the parent of a unit.
public StringgetParent() Gets the parent of a unit.
public voidoverhead(Object message) Puts the string equivalent of message over the unit.
public voidrevive() Revive the character.
publicint`[getFlags](#classMe_1a2901a55f39537ba49f5c90cfb8efe1a3)()` Returns the item flags.
public doublegetStat(intnStat,intnSubIndex) Get a stat by stat id and sub index.
publicint`[getStat](#classMe_1a95d5d3cf98c32092985203abcadb172d)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSubIndex)` Get a stat by stat id and sub index.
publicint`[getStat](#classMe_1a34c73953d580d9eae5a32d67d26a7ea0)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSubIndex)` Get an array of all the stats of the item.
public boolgetState(intnState) TODO: Handle getStat(-2);.
publicint`[getPrice](#classMe_1ab11bd84870974d2573c76661841b4584)([Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell)` Get the price of the item at a given npc, with choice of buying or selling, in the current difficulty.
publicint`[getPrice](#classMe_1a3d5496648a0727819638f23c7a4eb271)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) npcId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell)` Get the price of the item at a given npc (by id), which choice of buying or selling, in the current difficulty.
publicint`[getPrice](#classMe_1a5242237cafb7693f78ac1f3e250fd113)([Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) difficulty)` Get the price of the item at a given npc, with choice of buying or selling, in a given difficulty.
publicint`[getPrice](#classMe_1ae9a1131724c2be79d5b23fb695594774)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) npcId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) difficulty)` Get the price of the item at a given npc (by id), with choice of buying or selling, in a given difficulty.
public boolgetEnchant(intnEnchant) Determine whether or not a unit has a given enchant.
public boolshop(intdwMode) Shop with a given npc, either buying or selling.
public boolsetSkill(String skillName,intnHand) Set the skill on the given hand to be skill with name skillName.
public boolsetSkill(intnSkillId,intnHand) Set the skill on the given hand to be skill with id nSkillId.
public boolsetSkill(String skillName,intnHand,Unititem) Set the skill on the given hand to be skill with name skillName.
public boolsetSkill(intnSkillId,intnHand,Unititem) Set the skill on the given hand to be skill with id nSkillId.
public voidmove(intx,inty) Move to the given location.
public voidmove() Move to this unit.
publicint`[getQuest](#classMe_1a9ba75f0259540bc166cf7b8cbdbade86)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nAct,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nQuest)` Get the quest flag for a quest specified by act and quest number.
publicint`[getMinionCount](#classMe_1accccb22ea6e3a2618fe740270374d6e6)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType)` Get the number of minions of a certain type.
publicint`[getRepairCost](#classMe_1a79e916f09dcbe81785c07c3c6bb9505f)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId)` Get price to repair this unit at the current npc given by nNpcClassId.
publicint`[getItemCost](#classMe_1a5589dba170b74d8af4e1c0dd5b176626)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[Unit](#classUnit) npc)` Get the cost to do something (buy, sell, repair) with the given item, at the given npc.
publicint`[getItemCost](#classMe_1abcb1d466bcdac846dbb10c7ba4724caf)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nDifficulty)` Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.
publicint`[getItemCost](#classMe_1ad2deea07e13b5acaa68d0c09bbe75698)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId)` Get the cost to do something (buy, sell, repair) with the given item, at the given npc.
publicint`[getItemCost](#classMe_1a81997bd2784832f7e1a88863483e0289)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nDifficulty)` Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.

Members

publicint`[type`](#classMe_1a52c5b4db63a7b8446dc8107fc07cdf3d)

The type of the unit.

0 - Player

1 - NPC

2 - Object

3 - Missile

4 - Item

5 - Warp

Source: botNET

publicint`[classId`](#classMe_1afc46c25e98a712ddbab9fe5b1895c581)

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

publicint`[mode`](#classMe_1aaaa649505660616f54b0ee92776a25b8)

The mode of the unit.

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=988

public Stringname

The name of the unit.

publicint`[mapid`](#classMe_1aeca5382b1726287c31235f5cc9d4d22d)

The seed used to create the map.

publicint`[act`](#classMe_1a9ac2b33c84c6cd3b15afa9b42929fc3f)

The act where the unit is currently located.

publicint`[gid`](#classMe_1a1c9269b25de87db3987394c129ef4416)

The unit unique id.

Referred to simply as the unit id. Used along with the unit type to uniquely identify the unit.

publicint`[x`](#classMe_1a6e1986e643022cf0768b14b83f14d01b)

The x location of the unit.

publicint`[y`](#classMe_1aa554298f46bbfaf83a341b5e3d86b2e5)

The y location of the unit.

publicint`[targetx`](#classMe_1ae57bbfa40548f63d807ec5ead0301024)

The target x location of the unit.

Where the game is taking the unit.

publicint`[targety`](#classMe_1afe98390a5d4f85c8acd10b6312616c7f)

The target y location of the unit.

Where the game is taking the unit.

publicint`[area`](#classMe_1a20c97fb4d7a65f1125b2ef94edc93382)

The id of the area (level) the unit is located in.

publicint`[hp`](#classMe_1ada4675cf13005bce0c1562c903dc44c5)

The unit's current health.

publicint`[hpmax`](#classMe_1a76936aa550e766f03719a350a0166a08)

The unit's maximum health.

publicint`[mp`](#classMe_1a2818fdee3d22e50df4d044294978efc4)

The unit's current mana.

publicint`[mpmax`](#classMe_1aff3b5b0dd48925f742d96385f0cc3391)

The unit's maximum mana.

publicint`[stamina`](#classMe_1ab53e765f014b5a962dc0cf0374d61047)

The unit's current stamina.

publicint`[staminamax`](#classMe_1a27dc070bdfcf26014c8e05f8c3d45d54)

The unit's maximum stamina.

publicint`[charlvl`](#classMe_1ad1de73d82c060287cddb8c5e111c4763)

The character level.

The level that determines stat points, skill levels, etc.

publicint`[itemcount`](#classMe_1ad1ccf5dc94d072c2ceb7b505868e2058)

The number of items in inventory.

public doubleowner

The unit id of the owner of the unit.

publicint`[ownertype`](#classMe_1a6f9f7bbef6962920fe9306a620f204b6)

The type of owner.

type

publicint`[spectype`](#classMe_1ad244e2f81cefed6a58bc2b3aed36b9f3)

The special type of the unit.

Represents things like unique, minion, boss, etc.

1 - "Normal" Boss 2 - Champion 4 - Boss 8 - Minion

publicint`[direction`](#classMe_1a6ee239b2452d3c06e33de7e1725be36a)

The direction of the unit.

Todo: Figure out what the direction is.

public Stringcode

The three digit code for an item.

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=991

public Stringprefix

The magic prefix of the item.

public Stringsuffix

The magic suffix of the item.

publicint`[prefixnum`](#classMe_1ae54c6d4c87d2ad0f7f1c9a6b1f4381fc)

The id code for the magic prefix.

publicint`[suffixnum`](#classMe_1a3d523157c13fcf3229ecc1b9d7724367)

The id code for the magic suffix.

public Stringfname

The full name of an item.

publicint`[quality`](#classMe_1ace5f9a9c6a8139fbe30ca258e2f1bdc5)

The item quality.

1 - Low quality

2 - Normal

3 - Superior

4 - Magic

5 - Set

6 - Rare

7 - Unique

8 - Crafted

Source: botNET

publicint`[node`](#classMe_1a71440306ac4fa9414da959b615f24200)

No clue.

Todo: Get a clue.

publicint`[location`](#classMe_1a8932e926ae2bd373885fd45b2ef78907)

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

publicint`[sizex`](#classMe_1a2a1356d1bb2c3fdbda515446a06b626f)

The x size of the item.

publicint`[sizey`](#classMe_1ad5a059256862e2a27e4473f299c1c2a0)

The y size of the item.

publicint`[itemType`](#classMe_1a5cbdd81b5607c8098994228fe5ab7151)

The type of the item.

Todo: Put together a reference for item type.

public Stringdescription

The description of the item.

publicint`[bodylocation`](#classMe_1aa895c745c9f4f909986ddbacd7d31e73)

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

publicint`[ilvl`](#classMe_1a742c6b149eeaafd2e947662a2a7a3c61)

Item level.

Used for things like item stat rolling.

publicint`[runwalk`](#classMe_1ab3fd8214e6809542ea1b99f0a2cd2929)

Whether the controlled character is in the always run mode or not.

0 - Walk unless directed to run 1 - Always run

publicint`[weaponswitch`](#classMe_1adb2a8033d013320f821b7afefab5749a)

Set the weapon switch.

public Stringaccount

The account name used to log on to the account.

public Stringcharname

The character name.

publicint`[diff`](#classMe_1adddc240680097fd939d1afba7a1661cf)

The difficulty of the game.

0 - Normal

1 - Nightmare

2 - Hell

publicint`[maxdiff`](#classMe_1afc952d96b2b29fbee19791b2e6234e97)

The maximum difficulty available.

See Me::diff for details.

public Stringgamename

The name of the game.

public Stringgamepassword

The password of the game.

public Stringgameserverip

A string representation of the IPv4 address of the game server.

public doublegamestarttime

Some sort of representation of the start time of the game.

Todo: Figure out what this represents.

publicint`[gametype`](#classMe_1ad31342341ab64e1444961ff1059c8a05)

The game type, expansion or not.

Todo: Determine what the values are.

public boolitemoncursor

Whether or not there is an item on the cursor.

public boolladder

Whether or not the game is a ladder game.

publicint`[ping`](#classMe_1aee8c765131a0ce6a04a5a78198d90910)

The ping in milliseconds.

publicint`[fps`](#classMe_1a26cbb5b87c79ba3d8fd43e56cce260c7)

The frame rate.

publicint`[playertype`](#classMe_1a8cf7291feb3bc8ebeb35dd5baf373427)

Whether or not the gametype is hardcore.

public Stringrealm

The realm name.

public Stringrealmshort

The short realm name.

Todo: Determine the difference between this and realm.

publicint`[mercrevivecost`](#classMe_1a913adbc2fce146ef6c9f5268a76ebfc5)

The cost to revive the merc.

publicint`[chickenhp`](#classMe_1a215c51bfd214de4bff2eeefdc5ecd5ab)

The health at which to chicken if the character drops below.

publicint`[chickenmp`](#classMe_1a7e95aede9d9b33b217e2c74b0aed9865)

The mana at which to chicken if the character drops below.

public boolquitonhostile

Whether to chicken if another player hostiles the controlled character.

public boolblockKeys

Block keys...

Todo: Determine what this means.

public boolblockMouse

Block mouse...

Todo: Determine what this means.

public boolgameReady

Whether or not the game window is in the game.

public Stringprofile

The profile currently being used.

public boolnopickup

Whether the game is set to not pick up items or not.

public doublepid

The process id of Diablo II.

publicint`[screensize`](#classMe_1acf69e064892375059446599a1494fea6)

The window size.

Todo: Determine what the numbers mean.

public Stringwindowtitle

The window title.

public boolingame

True if the game is not at menu.

Todo: Determine when this is different from gameReady. Maybe when going between acts for instance.

public boolquitonerror

Whether or not to quit when there's an error.

Todo: Figure out if this means js errors.

publicint`[maxgametime`](#classMe_1ad4f57667eb1a3bd8e45288c9f3fe923a)

The max time in milliseconds to stay in game before the game auto-quits.

public boolgetNext()

Get the next unit that matches the originally given name or class id and originally specified mode.

Returns

Whether another unit was found.

public boolgetNext(String szName)

Get the next unit that matches the given name and originally specified mode.

Parameters

Returns

Whether another unit was found.

public boolgetNext(intdwClassId)

Get the next unit that matches the given class id and originally specified mode.

Parameters

Returns

Whether another unit was found.

public boolgetNext(String szName,intdwMode)

Get the next unit that matches the given name and mode.

Parameters

Returns

Whether another unit was found.

public boolgetNext(intdwClassId,intdwMode)

Get the next unit that matches the given class id and mode.

Parameters

Returns

Whether another unit was found.

public voidcancel()

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 boolrepair()

Try to repair.

Need to be able to find unit that you're trying to repair with. That means the unit needs to still be in the server unit hash table.

Returns

true if successful.

public booluseMenu(intmenuItem)

Use an NPC menu.

Need to be able to find unit that you're trying to repair with. That means the unit needs to still be in the server unit hash table.

Parameters

Returns

true if menu was found.

public boolinteract()

Interact with the unit.

If the unit is an item in inventory pick it up. Otherwise click it on the map.

public boolinteract(intdestId)

Interact with a waypoint.

If the unit is an object, assume it's a waypoint, and take it.

Parameters

publicUnit`[getItem](#classMe_1ab6277b88eedb3985e94a7b2ec2d0ed5e)(String name,uint32_t mode,uint32_t nUnitId)`

Get an item from inventory by name, mode and nUnitId.

Parameters

Returns

The first item found that matches the description.

publicUnit`[getItem](#classMe_1a1678e3178379630e2b4208e011129094)(uint32_t classId,uint32_t mode,uint32_t nUnitId)`

Get an item from inventory by classId, mode and nUnitId.

Parameters

Returns

The first item found that matches the description.

publicUnit`[getItems](#classMe_1aa3a172ada3c1e477299cf697f3722076)()`

Get all items from inventory.

Returns

An array of all the items from inventory.

publicUnit`[getMerc](#classMe_1a12c1ae747f947cc96bcda92d517e4fd4)()`

Get a player's merc.

The unit being operated on should be a player.

Returns

The merc if there is one, null otherwise.

publicint`[getMercHP](#classMe_1a8b9d83bd2cc1d39c89c47c2f3d97f398)()`

Get the merc's HP.

The reported HP is a percentage.

Returns

The merc's HP percentage.

public StringgetSkill(inthand)

Get skill name from hand.

Parameters

0 - Right hand

1 - Left hand

Returns

Skill name.

publicint`[getSkill](#classMe_1a482e347e3d2131af87a6aca7019bf4fd)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) hand)`

Get skill id from hand.

Parameters

2 - Right hand

3 - Left hand

Returns

Skill id.

publicint`[getSkill](#classMe_1a68d6118cef94eb973cfa1591ea890e3f)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) dummy)`

Get all skills.

Gets all skill ids, along with corresponding base and total skill levels.

Parameters

Returns

An array of arrays of integers. Inside the inner array the 0th index is the skill id, the 1st index is the base skill level and the 2nd index is the total skill level. Only the first 256 skills are read.

publicint`[getSkill](#classMe_1a8319dc883867a8e9f6cc101ecbee0aa5)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSkillId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nExt)`

Calls D2COMMON_GetSkillLevel and returns the result.

Todo: Figure out what D2COMMON_GetSkillLevel does.

Returns

Whatever D2COMMON_GetSkillLevel returns.

publicUnit`[getParent](#classMe_1a211afa5299fc94407dc2a6d78ebadd8c)()`

Gets the parent of a unit.

This function is used for monster and item units.

Returns

The parent unit.

public StringgetParent()

Gets the parent of a unit.

This function is used for object units.

Returns

The parent's name.

public voidoverhead(Object message)

Puts the string equivalent of message over the unit.

public voidrevive()

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.

publicint`[getFlags](#classMe_1a2901a55f39537ba49f5c90cfb8efe1a3)()`

Returns the item flags.

Returns

Item flags:

0x00000001 - Equipped

0x00000008 - In socket

0x00000010 - Identified

0x00000040 - Weapon/shield is in the active weapon switch

0x00000080 - Weapon/shield is in the inactive weapon switch

0x00000100 - Item is broken

0x00000400 - Full rejuv

0x00000800 - Socketed

0x00002000 - In the trade or gamble screen

0x00004000 - Not in a socket

0x00010000 - Is an ear

0x00020000 - A starting item (worth only 1 gold)

0x00200000 - Rune, or potion, or mephisto's soulstone

0x00400000 - Ethereal

0x00800000 - Is an item

0x01000000 - Personalized

0x04000000 - Runeword

Source: http://subversion.assembla.com/svn/d2bs/scripts/YAMB/libs/YAMB/common/YAM-Common.dbl r1086

public doublegetStat(intnStat,intnSubIndex)

Get a stat by stat id and sub index.

Used for every stat except 6-11.

Parameters

Returns

The stat value.

publicint`[getStat](#classMe_1a95d5d3cf98c32092985203abcadb172d)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSubIndex)`

Get a stat by stat id and sub index.

Used for stats 6-11.

Parameters

Returns

The stat value.

publicint`[getStat](#classMe_1a34c73953d580d9eae5a32d67d26a7ea0)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSubIndex)`

Get an array of all the stats of the item.

Parameters

Returns

An array of the first 64 stats. The indices of the inner array are: 0 - nStat, 1 - nSubIndex, 2 - nValue.

public boolgetState(intnState)

TODO: Handle getStat(-2);.

Return whether or not the unit has a given state.

Parameters

Returns

Whether or not the unit has the state.

publicint`[getPrice](#classMe_1ab11bd84870974d2573c76661841b4584)([Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell)`

Get the price of the item at a given npc, with choice of buying or selling, in the current difficulty.

Deprecated: Use getItemCost instead.

Todo: Determine the meaning of "buysell".

Parameters

Returns

The price requested.

publicint`[getPrice](#classMe_1a3d5496648a0727819638f23c7a4eb271)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) npcId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell)`

Get the price of the item at a given npc (by id), which choice of buying or selling, in the current difficulty.

Deprecated: Use getItemCost instead.

Todo: Determine the meaning of "buysell".

Parameters

Returns

The price requested.

publicint`[getPrice](#classMe_1a5242237cafb7693f78ac1f3e250fd113)([Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) difficulty)`

Get the price of the item at a given npc, with choice of buying or selling, in a given difficulty.

Deprecated: Use getItemCost instead.

Todo: Determine the meaning of "buysell".

Parameters

Returns

The price requested.

publicint`[getPrice](#classMe_1ae9a1131724c2be79d5b23fb695594774)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) npcId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) difficulty)`

Get the price of the item at a given npc (by id), with choice of buying or selling, in a given difficulty.

Deprecated: Use getItemCost instead.

Todo: Determine the meaning of "buysell".

Parameters

Returns

The price requested.

public boolgetEnchant(intnEnchant)

Determine whether or not a unit has a given enchant.

Parameters

Returns

Whether or not the unit has the enchantment.

public boolshop(intdwMode)

Shop with a given npc, either buying or selling.

Parameters

Returns

Whether or not the shop went through.

public boolsetSkill(String skillName,intnHand)

Set the skill on the given hand to be skill with name skillName.

Waits up to one second for the skill to be set.

Todo: Fix argc < 1, should be argc < 2

Parameters

Returns

Whether operation was successful.

public boolsetSkill(intnSkillId,intnHand)

Set the skill on the given hand to be skill with id nSkillId.

Waits up to one second for the skill to be set.

Todo: Fix argc < 1, should be argc < 2

Parameters

Returns

Whether operation was successful.

public boolsetSkill(String skillName,intnHand,Unititem)

Set the skill on the given hand to be skill with name skillName.

Waits up to one second for the skill to be set.

Todo: Fix argc < 1, should be argc < 2

Parameters

Returns

Whether operation was successful.

public boolsetSkill(intnSkillId,intnHand,Unititem)

Set the skill on the given hand to be skill with id nSkillId.

Waits up to one second for the skill to be set.

Todo: Fix argc < 1, should be argc < 2

Parameters

Returns

Whether operation was successful.

public voidmove(intx,inty)

Move to the given location.

Parameters

public voidmove()

Move to this unit.

publicint`[getQuest](#classMe_1a9ba75f0259540bc166cf7b8cbdbade86)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nAct,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nQuest)`

Get the quest flag for a quest specified by act and quest number.

Parameters

Returns

The quest flag for the specified quest.

publicint`[getMinionCount](#classMe_1accccb22ea6e3a2618fe740270374d6e6)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType)`

Get the number of minions of a certain type.

Parameters

Returns

The number of minions of the specified type.

publicint`[getRepairCost](#classMe_1a79e916f09dcbe81785c07c3c6bb9505f)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId)`

Get price to repair this unit at the current npc given by nNpcClassId.

Parameters

Returns

The price to repair the given unit.

publicint`[getItemCost](#classMe_1a5589dba170b74d8af4e1c0dd5b176626)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[Unit](#classUnit) npc)`

Get the cost to do something (buy, sell, repair) with the given item, at the given npc.

Parameters

Returns

The price.

publicint`[getItemCost](#classMe_1abcb1d466bcdac846dbb10c7ba4724caf)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nDifficulty)`

Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.

Parameters

Returns

The price.

publicint`[getItemCost](#classMe_1ad2deea07e13b5acaa68d0c09bbe75698)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId)`

Get the cost to do something (buy, sell, repair) with the given item, at the given npc.

Parameters

Returns

The price.

publicint`[getItemCost](#classMe_1a81997bd2784832f7e1a88863483e0289)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nDifficulty)`

Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.

Parameters

Returns

The price.

class Party

Represents the items in the list in the Party screen.

Also called a RosterUnit.

Summary

Members Descriptions
publicint`[x`](#classParty_1a2152cde81a80e8292d45a02cf5fd1f81) The x coordinate of the location of the RosterUnit.
publicint`[y`](#classParty_1a7b27f3dc2f2cf8428bcf88369f974644) The y coordinate of the location of the RosterUnit.
publicint`[area`](#classParty_1a673a0ec1ad99bdc49b0cab8fed947876) The Area ID of the RosterUnit.
public doublegid The unique id of the RosterUnit.
publicint`[life`](#classParty_1a61a88341743f372a3b9556e528c7403c) The life of the RosterUnit.
publicint`[partyflag`](#classParty_1aed25455e977af2f00d59dc34bae5adab) The Party flags of the RosterUnit.
publicint`[partyid`](#classParty_1abc7e22a4373225cef75b49598ae4ef10) The Party ID.
public Stringname The name of the RosterUnit.
publicint`[classid`](#classParty_1ac5ec74e94715df07ca680b1247074627) The class ID of the RosterUnit.
publicint`[level`](#classParty_1ad32c6abaa6e2f25660b7e00a12f1c7a4) The character level of the RosterUnit.
public voidgetNext() Move to the next RosterUnit.

Members

publicint`[x`](#classParty_1a2152cde81a80e8292d45a02cf5fd1f81)

The x coordinate of the location of the RosterUnit.

publicint`[y`](#classParty_1a7b27f3dc2f2cf8428bcf88369f974644)

The y coordinate of the location of the RosterUnit.

publicint`[area`](#classParty_1a673a0ec1ad99bdc49b0cab8fed947876)

The Area ID of the RosterUnit.

public doublegid

The unique id of the RosterUnit.

publicint`[life`](#classParty_1a61a88341743f372a3b9556e528c7403c)

The life of the RosterUnit.

Todo: Determine how one is to get the maximum life of the RosterUnit.

publicint`[partyflag`](#classParty_1aed25455e977af2f00d59dc34bae5adab)

The Party flags of the RosterUnit.

Todo: Determine the values that this can take on.

publicint`[partyid`](#classParty_1abc7e22a4373225cef75b49598ae4ef10)

The Party ID.

Todo: Determine what a Party ID is.

public Stringname

The name of the RosterUnit.

publicint`[classid`](#classParty_1ac5ec74e94715df07ca680b1247074627)

The class ID of the RosterUnit.

See Unit::classId.

publicint`[level`](#classParty_1ad32c6abaa6e2f25660b7e00a12f1c7a4)

The character level of the RosterUnit.

Todo: Verify that this level is the character level.

public voidgetNext()

Move to the next RosterUnit.

class PresetUnit

Represents a PresetUnit (a type of Unit that is available as soon as the Area data is available).

Todo: Determine how location is determine based off roomx, roomy, x, and y.

Summary

Members Descriptions
publicint`[type`](#classPresetUnit_1aeb44ea9243dc41da4cfa2796ae14e276) The type ID.
publicint`[roomx`](#classPresetUnit_1ad3178939e97c6a2bcadff92ee6e8dbba) The room X (?).
publicint`[roomy`](#classPresetUnit_1a661012095ec30341597c37e437bc60b0) The room Y (?).
publicint`[x`](#classPresetUnit_1a52f264129d70ba87ae8e7de714264994) The X coordinate (?).
publicint`[y`](#classPresetUnit_1a6d875aeb1be7022712bcba59ba256733) The Y coordinate (?).
publicint`[id`](#classPresetUnit_1af1a516a03965b9e23cf2a4ab77bf4f62) The unique ID of the PresetUnit.
publicint`[level`](#classPresetUnit_1aa3ae3f2724bf489f6341dc905537623f) The Area ID of the Area the PresetUnit is in.

Members

publicint`[type`](#classPresetUnit_1aeb44ea9243dc41da4cfa2796ae14e276)

The type ID.

See Unit::type.

publicint`[roomx`](#classPresetUnit_1ad3178939e97c6a2bcadff92ee6e8dbba)

The room X (?).

publicint`[roomy`](#classPresetUnit_1a661012095ec30341597c37e437bc60b0)

The room Y (?).

publicint`[x`](#classPresetUnit_1a52f264129d70ba87ae8e7de714264994)

The X coordinate (?).

publicint`[y`](#classPresetUnit_1a6d875aeb1be7022712bcba59ba256733)

The Y coordinate (?).

publicint`[id`](#classPresetUnit_1af1a516a03965b9e23cf2a4ab77bf4f62)

The unique ID of the PresetUnit.

publicint`[level`](#classPresetUnit_1aa3ae3f2724bf489f6341dc905537623f)

The Area ID of the Area the PresetUnit is in.

class Profile

This class represents the details needed to get a player to a game or lobby.

This class hides the password. It provides the login() method to use the password.

Summary

Members Descriptions
public ProfileTypetype The type of profile, see ProfileType.
public Stringip The IP of the game to connect to (TCP/IP join).
public Stringusername The username to use to connect to battle.net.
public union Profile::@0gateway The battle.net gateway to connect to.
public Stringcharacter The character to select.
public int8_tdifficulty The difficulty to use: 0 - normal, 1 - nightmare, 2 - hell.
public uint32_tmaxLoginTime The number of milliseconds to wait while logging in.
public uint32_tmaxCharacterSelectTime The number of milliseconds to wait for the characters to load.
publicProfile() Create a Profile for the currently set profile.
publicProfile(String profileName) Create a Profile for the named profile.
publicProfile(ProfileType pt,String charName,int8_t diff) Create a Profile with the given information.
publicProfile(ProfileType pt,String account,String pass,String charName,String gateway) Create a Profile with the given information.
publicProfile(ProfileType pt,String charName,String ip) Create a Profile with the given information.
public voidlogin() Log the profile in.

Members

public ProfileTypetype

The type of profile, see ProfileType.

public Stringip

The IP of the game to connect to (TCP/IP join).

public Stringusername

The username to use to connect to battle.net.

public union Profile::@0gateway

The battle.net gateway to connect to.

public Stringcharacter

The character to select.

public int8_tdifficulty

The difficulty to use: 0 - normal, 1 - nightmare, 2 - hell.

public uint32_tmaxLoginTime

The number of milliseconds to wait while logging in.

public uint32_tmaxCharacterSelectTime

The number of milliseconds to wait for the characters to load.

publicProfile()

Create a Profile for the currently set profile.

publicProfile(String profileName)

Create a Profile for the named profile.

Parameters

publicProfile(ProfileType pt,String charName,int8_t diff)

Create a Profile with the given information.

Parameters

publicProfile(ProfileType pt,String account,String pass,String charName,String gateway)

Create a Profile with the given information.

Parameters

publicProfile(ProfileType pt,String charName,String ip)

Create a Profile with the given information.

Parameters

public voidlogin()

Log the profile in.

class Room

Represents a "Room" in the game.

A Room is a rectangular piece of the map data. It has pointers to many lists, such as a list of PresetUnit s.

Summary

Members Descriptions
publicint`[number`](#classRoom_1ace0776823076279027a43e37096f44a2) Get the Room number.
publicint`[x`](#classRoom_1a7e5d5a363ed3c93efc6b1c321f0ec957) Get the x coordinate of the Room.
publicint`[y`](#classRoom_1a8bfbccf2843aab2175743f8d9b5ffe48) Get the y coordinate of the Room.
publicint`[xsize`](#classRoom_1a7c90b0e176a112beb7e8dcc808576e8b) Get the x size (width) of the Room.
publicint`[ysize`](#classRoom_1ae4dbb7c19fc3faa8e876c03aa8ed7fb9) Get the y size (height) of the Room.
publicint`[subnumber`](#classRoom_1adf03f03ffb94895c18f291a325e51fb2) No implementation.
publicint`[area`](#classRoom_1a0e12c557e6658e021fc94dfe950ace67) Get the Area ID for the area which the Room is in.
publicint`[level`](#classRoom_1a5d8cf5f2d71723e3244654603a5ae84f) Get the Area ID for the area which the Room is in.
publicint`[correcttomb`](#classRoom_1af1e1126e1534f1653ce6b5fcd77026a4) Get the correct tomb.
public boolgetNext() Move to the next Room.
public boolreveal() Reveal the Room on the map.
publicPresetUnit`[getPresetUnits](#classRoom_1a0ddb9c16273a4e9d11365b9f927e74aa)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nClass)` Get the PresetUnit s from the current Room.
publicint`[getCollision](#classRoom_1af6cedb196d4c1f1ad52e4f9076593248)()` Get the collision data for the Room.
publicRoom`[getNearby](#classRoom_1a43d7c3ae8cf396e9883e79c5d5a4b902)()` Get the "nearby" Rooms from pRoom2Near member.
publicint`[getStat](#classRoom_1aa43b095fa97e00fd593d949b354ba920)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat)` Get some property of the Room.
publicRoom`[getFirst](#classRoom_1ad9a6e43e97d1f9368eeecc578dcd6e26)()` Get the first Room of the level this Room is on.
public boolunitInRoom(Unitunit) Determine whether or not the Unit is in the Room.

Members

publicint`[number`](#classRoom_1ace0776823076279027a43e37096f44a2)

Get the Room number.

Todo: Determine what a "room number" is.

publicint`[x`](#classRoom_1a7e5d5a363ed3c93efc6b1c321f0ec957)

Get the x coordinate of the Room.

publicint`[y`](#classRoom_1a8bfbccf2843aab2175743f8d9b5ffe48)

Get the y coordinate of the Room.

publicint`[xsize`](#classRoom_1a7c90b0e176a112beb7e8dcc808576e8b)

Get the x size (width) of the Room.

publicint`[ysize`](#classRoom_1ae4dbb7c19fc3faa8e876c03aa8ed7fb9)

Get the y size (height) of the Room.

publicint`[subnumber`](#classRoom_1adf03f03ffb94895c18f291a325e51fb2)

No implementation.

publicint`[area`](#classRoom_1a0e12c557e6658e021fc94dfe950ace67)

Get the Area ID for the area which the Room is in.

publicint`[level`](#classRoom_1a5d8cf5f2d71723e3244654603a5ae84f)

Get the Area ID for the area which the Room is in.

publicint`[correcttomb`](#classRoom_1af1e1126e1534f1653ce6b5fcd77026a4)

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 boolgetNext()

Move to the next Room.

Returns

Whether there was another Room to move to or not.

public boolreveal()

Reveal the Room on the map.

Returns

Whether or not the Room was successfully revealed.

publicPresetUnit`[getPresetUnits](#classRoom_1a0ddb9c16273a4e9d11365b9f927e74aa)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nClass)`

Get the PresetUnit s from the current Room.

Parameters

Returns

An array of all the PresetUnit s from the current Room.

publicint`[getCollision](#classRoom_1af6cedb196d4c1f1ad52e4f9076593248)()`

Get the collision data for the Room.

Todo: Verify that the array does actually have reverse of usual dimensions.

Returns

An array with the collision data. The first dimension is the y coordinate, the second is the x coordinate.

publicRoom`[getNearby](#classRoom_1a43d7c3ae8cf396e9883e79c5d5a4b902)()`

Get the "nearby" Rooms from pRoom2Near member.

Returns

An array of the nearby Rooms.

publicint`[getStat](#classRoom_1aa43b095fa97e00fd593d949b354ba920)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat)`

Get some property of the Room.

Parameters

0 - xStart (room 1)

1 - yStart (room 1)

2 - xSize (room 1)

3 - ySize (room 1)

4 - posX (room 2)

5 - posY (room 2)

6 - sizeX (room 2)

7 - sizeY (room 2)

9 - posGameX (coll)

10 - posGameY (coll)

11 - sizeGameX (coll)

12 - sizeGameY (coll)

13 - posRoomX (coll)

14 - posGameY (coll)

15 - sizeRoomX (coll)

16 - sizeRoomY (coll)

Returns

The stat value.

publicRoom`[getFirst](#classRoom_1ad9a6e43e97d1f9368eeecc578dcd6e26)()`

Get the first Room of the level this Room is on.

Returns

The first Room.

public boolunitInRoom(Unitunit)

Determine whether or not the Unit is in the Room.

Parameters

Returns

Whether or not the Unit is in the Room.

class Sandbox

A separate context to run scripts in.

Summary

Members Descriptions
publicSandbox() Create a Sandbox.
public Objectevaluate(String code) Evaluate the code passed in and return the result.
public Objectinclude(String file) Include a file from ScriptPath\libs\file.
public boolisInclude(String file) Determine whether a file has been included yet or not.
public voidclearScope() Clear the scope of the Sandbox's global object.

Members

publicSandbox()

Create a Sandbox.

This creates a separate context to run things in.

public Objectevaluate(String code)

Evaluate the code passed in and return the result.

Parameters

Returns

The result of the last expression statement.

public Objectinclude(String file)

Include a file from ScriptPath\libs\file.

Parameters

Returns

The result of the last expression statement.

public boolisInclude(String file)

Determine whether a file has been included yet or not.

Parameters

Returns

Whether or not the file has been included.

public voidclearScope()

Clear the scope of the Sandbox's global object.

Todo: Clarify what this means (i.e. post-conditions).

class SQLite

Class for dealing with an SQLite database.

Summary

Members Descriptions
public Stringpath Get the path used to open the database.
publicDBStatement`[statements`](#classSQLite_1a30a088d06c85fa846e13dd87b1ac7ad7) Get all the statements that have been queried.
public boolisOpen Whether or not the database is open.
publicint`[lastRowId`](#classSQLite_1aff1af94823aa7b2de96f65993686feed) Get the row id of the last inserted row.
public doublechanges Get the number of rows modified/inserted/deleted by the last statement.
publicSQLite(String path,bool autoOpen) Create a database object which can be used to open SQLite databases and execute queries.
public boolexecute(String queryString) Execute a query on the database.
publicDBStatement`[query](#classSQLite_1a8ebb32f52a5426ae36a7977c540feb32)(String sql,...)` Do a sqlite3_prepare_v2 on the database with sql, then call the appropriate sqlite3bind functions on the remaining parameters.
public boolopen() Open the database.
public boolclose() Close the database.

Members

public Stringpath

Get the path used to open the database.

publicDBStatement`[statements`](#classSQLite_1a30a088d06c85fa846e13dd87b1ac7ad7)

Get all the statements that have been queried.

public boolisOpen

Whether or not the database is open.

publicint`[lastRowId`](#classSQLite_1aff1af94823aa7b2de96f65993686feed)

Get the row id of the last inserted row.

public doublechanges

Get the number of rows modified/inserted/deleted by the last statement.

publicSQLite(String path,bool autoOpen)

Create a database object which can be used to open SQLite databases and execute queries.

Parameters

public boolexecute(String queryString)

Execute a query on the database.

Parameters

Returns

true

publicDBStatement`[query](#classSQLite_1a8ebb32f52a5426ae36a7977c540feb32)(String sql,...)`

Do a sqlite3_prepare_v2 on the database with sql, then call the appropriate sqlite3bind functions on the remaining parameters.

Parameters

Todo: Determine what this function does (better documenation).

Returns

The resulting DBStatement.

public boolopen()

Open the database.

Returns

true

public boolclose()

Close the database.

Returns

true

class Text

A Text screen hook.

Todo: Verify all the documentation in this class.

Summary

Members Descriptions
publicint`[x`](#classText_1a0561058ba47e899900800635dbe270c2) The x coordinate (left) of the Text.
publicint`[y`](#classText_1a90f1e6cb7aa15a593d36c96144087179) The y coordinate (top) of the Text.
public boolvisible Whether or not the Text is visible.
publicint`[align`](#classText_1a4c8c8cccbf4fe4c50f9e56ff3f5e5c96) The horizontal alignment.
publicint`[zorder`](#classText_1ab953550b21d489b9c3a686e8119f19fe) The z-order of the Text (what it covers up and is covered by).
public ClickHandlerclick The click handler that gets called when the Text is clicked.
public HoverHandlerhover The hover handler that gets called when the Text gets hovered over.
publicint`[color`](#classText_1a6f4e60b7e0ccd69f154dad14a48be330) The color of the Text.
publicint`[font`](#classText_1a4113e8ec35bb03fa7529d357c5f389b1) Something that determines the font.
public Stringtext The string that the Text hook displays.
publicText(String szText,intx,inty,intcolor,intfont,intalign,bool automap,ClickHandler click,HoverHandler hover) Create a Text hook with the given parameters.
public voidremove() Remove the Text hook from the screen and destroy the corresponding object.

Members

publicint`[x`](#classText_1a0561058ba47e899900800635dbe270c2)

The x coordinate (left) of the Text.

publicint`[y`](#classText_1a90f1e6cb7aa15a593d36c96144087179)

The y coordinate (top) of the Text.

public boolvisible

Whether or not the Text is visible.

publicint`[align`](#classText_1a4c8c8cccbf4fe4c50f9e56ff3f5e5c96)

The horizontal alignment.

0 - Left

1 - Right

2 - Center

publicint`[zorder`](#classText_1ab953550b21d489b9c3a686e8119f19fe)

The z-order of the Text (what it covers up and is covered by).

public ClickHandlerclick

The click handler that gets called when the Text is clicked.

public HoverHandlerhover

The hover handler that gets called when the Text gets hovered over.

publicint`[color`](#classText_1a6f4e60b7e0ccd69f154dad14a48be330)

The color of the Text.

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000

publicint`[font`](#classText_1a4113e8ec35bb03fa7529d357c5f389b1)

Something that determines the font.

public Stringtext

The string that the Text hook displays.

publicText(String szText,intx,inty,intcolor,intfont,intalign,bool automap,ClickHandler click,HoverHandler hover)

Create a Text hook with the given parameters.

Parameters

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=1000

Parameters

0 - Left

1 - Right

2 - Center

Parameters

public voidremove()

Remove the Text hook from the screen and destroy the corresponding object.

class Unit

This class represents a unit (monster, wp, npc, character, etc) in the game.

Summary

Members Descriptions
publicint`[type`](#classUnit_1a45243122ae655f50179f96bc831bfb1d) The type of the unit.
publicint`[classid`](#classUnit_1ab7a6985a8d8a60137e8a469fbb5b2d04) The class id of the object.
publicint`[mode`](#classUnit_1a0e0de49749be72180866dd31b76a0102) The mode of the unit.
public Stringname The name of the unit.
publicint`[act`](#classUnit_1afaf30997a33a9c05c7a4941d1c7bfd39) The act where the unit is currently located.
publicint`[gid`](#classUnit_1ad6fb57eda20f91a8b4ea15eb28621f1f) The unit unique id.
publicint`[x`](#classUnit_1a356b2d8a1d6dde32b67b2c9a3e173b99) The x location of the unit.
publicint`[y`](#classUnit_1a6846a7ed25c3e93b51f9bc9643576f05) The y location of the unit.
publicint`[targetx`](#classUnit_1abe6abf7822c2b691853fb58320157b0f) The target x location of the unit.
publicint`[targety`](#classUnit_1a9ee1df35e54c3a4f8756329782792400) The target y location of the unit.
publicint`[area`](#classUnit_1af5f2e11d4f116084ffd807b578078d7d) The id of the area (level) the unit is located in.
publicint`[hp`](#classUnit_1ae9d3c95ccf18f5bc2bd6a7e68f0e7b1c) The unit's current health.
publicint`[hpmax`](#classUnit_1a0d97cfa23ab03fa550861e9f0aac7f20) The unit's maximum health.
publicint`[mp`](#classUnit_1abbab13fe2ae1ae93b78ea148fde7a4ff) The unit's current mana.
publicint`[mpmax`](#classUnit_1a07b6e27b8e9e9430ff9c3be224f6090e) The unit's maximum mana.
publicint`[stamina`](#classUnit_1a53c596913a3c96cc692df12c26a3ac7d) The unit's current stamina.
publicint`[staminamax`](#classUnit_1ac6acb5617d4f9b525287e35b91575c31) The unit's maximum stamina.
publicint`[charlvl`](#classUnit_1ae12b4d41735cb54cf7609bcaa772f4ae) The character level.
publicint`[itemcount`](#classUnit_1af3532e4e568df722332b0e2d85759fb3) The number of items in inventory.
publicint`[owner`](#classUnit_1a8616a100c244d69e7592d5b6843a0b61) The unit id of the owner of the unit.
publicint`[ownertype`](#classUnit_1ae2003fc0bc7e60523ff0c05d1f7bb1ca) The type of owner.
publicint`[spectype`](#classUnit_1a90be3cd88e866777cffb925e3244e730) The special type of the unit.
publicint`[direction`](#classUnit_1af64fb0f78ce8cb663fe12ec8a1c5f81d) The direction of the unit.
publicint`[uniqueid`](#classUnit_1aeda7422b700e357cdda91fb24312e58e) The unique id of a boss.
public Stringcode The three digit code for an item.
public Stringprefix The magic prefix of the item.
public Stringsuffix The magic suffix of the item.
public String[]prefixes The magic prefixes of the item.
public String[]suffixes The magic suffixes of the item.
publicint`[prefixnum`](#classUnit_1a00e6bd1941d366802e6ac571e36da8c3) The id code for the magic prefix.
publicint`[suffixnum`](#classUnit_1ae71acd4a5d4d075f0211242f48e18d3c) The id code for the magic suffix.
publicint`[prefixnums`](#classUnit_1a66f3e79ca4097a2c095a4f047b97f996) The id codes for the magic prefixes.
publicint`[suffixnums`](#classUnit_1af668286ae6c3d1d87bfc531ab8d54f77) The id codes for the magic suffixes.
public Stringfname The full name of an item.
publicint`[quality`](#classUnit_1af7a138ffb9643f0015ba22f0230e5ce4) The item quality.
publicint`[node`](#classUnit_1ab5da58f77c0aaa3f3ce81cccee12e057) No clue.
publicint`[location`](#classUnit_1a60b8bec5206902278dfbbebe75c3617e) The location of the item (ground, inventory, stash, etc.).
publicint`[sizex`](#classUnit_1a1320b38ed997f4922abfeb2966fed81b) The x size of the item.
publicint`[sizey`](#classUnit_1afe39c0f050662a28ffd252d50f94910d) The y size of the item.
publicint`[itemType`](#classUnit_1ab0d3eddb92c27f52f7698895bcf3905b) The type of the item.
public Stringdescription The description of the item.
publicint`[bodylocation`](#classUnit_1ab7779c44d220bab7d0d8467a6d1fd007) The equipped location of the item.
publicint`[ilvl`](#classUnit_1aee7cd2c778a2ad23cbb2001378bfd86b) Item level.
publicint`[lvlreq`](#classUnit_1af1677614eb990c59aa3cd43be30983e2) Level requirement (character level required to use the item).
publicint`[gfx`](#classUnit_1a9bd325f9e2eb378709bf785a2b4bc6ad) Get the id for the graphic used for the item.
publicint`[runwalk`](#classUnit_1ac8a909f484cee949343474ff0cddcb5f) Whether the controlled character is in the always run mode or not.
publicint`[weaponswitch`](#classUnit_1ac9b8c63afb5360437af31a0b0902232a) Set the weapon switch.
publicint`[objtype`](#classUnit_1adfb606b289eeccde32b0ed79ed0020c9) The object type.
publicint`[islocked`](#classUnit_1afa81eef36e4eddf98f8dd69c48e22875) Whether or not the chest is locked.
public boolgetNext() Get the next unit that matches the originally given name or class id and originally specified mode.
public boolgetNext(String szName) Get the next unit that matches the given name and originally specified mode.
public boolgetNext(uint32_t dwClassId) Get the next unit that matches the given class id and originally specified mode.
public boolgetNext(String szName,uint32_t dwMode) Get the next unit that matches the given name and mode.
public boolgetNext(uint32_t dwClassId,uint32_t dwMode) Get the next unit that matches the given class id and mode.
public voidcancel() Cancel whatever's going on.
public boolrepair() Try to repair.
public booluseMenu(intmenuItem) Use an NPC menu.
public boolinteract() Interact with the unit.
public boolinteract(intdestId) Interact with a waypoint.
publicUnit`[getItem](#classUnit_1a4ef77dc37b10ba1fa7254935549f66fc)(String name,uint32_t mode,uint32_t nUnitId)` Get an item from inventory by name, mode and nUnitId.
publicUnit`[getItem](#classUnit_1ad5dbc6824bff1d1847be8052ab36d381)(uint32_t classId,uint32_t mode,uint32_t nUnitId)` Get an item from inventory by classId, mode and nUnitId.
publicUnit`[getItems](#classUnit_1af421c40cb966dd2bef028c3ae2660e78)()` Get all items from inventory.
public boolgetMerc(bool dummy) Get whether this player has a merc.
publicUnit`[getMerc](#classUnit_1a765ff16754426875b9975e71c776a6ac)()` Get a player's merc.
public StringgetSkill(inthand) Get skill name from hand.
publicint`[getSkill](#classUnit_1a94823fedd1fb16eece0fe7fd729bb4e8)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) hand)` Get skill id from hand.
publicint`[getSkill](#classUnit_1acfc83d3e88c549e6dae3c682c3baf40f)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) dummy)` Get all skills.
publicint`[getSkill](#classUnit_1ab14f99798787ec5b258a47824f089604)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSkillId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nExt)` Calls D2COMMON_GetSkillLevel and returns the result.
publicUnit`[getParent](#classUnit_1aba1d739e034f714e07e5c66a1bcd8297)()` Gets the parent of a unit.
public StringgetParent() Gets the parent of a unit.
public voidoverhead(Object message) Puts the string equivalent of message over the unit.
publicint`[getFlags](#classUnit_1a01704c64338a7818f03ea9fdb0205ee6)()` Returns the item flags.
public boolgetFlag(intflags) Same as getFlags, but returns a boolean.
public doublegetStat(intnStat,intnSubIndex) Get a stat by stat id and sub index.
publicint`[getStat](#classUnit_1ab7cb6e0da97e16296f391f448630c4e0)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSubIndex)` Get a stat by stat id and sub index.
publicint`[getStat](#classUnit_1a106c9cbe30bae8d80322f3ec1bc3aafa)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSubIndex)` Get an array of all the stats of the item.
public boolgetState(intnState) Return whether or not the unit has a given state.
publicint`[getPrice](#classUnit_1ac12f87a160fd951c157ab1107029a2d9)([Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell)` Get the price of the item at a given npc, with choice of buying or selling, in the current difficulty.
publicint`[getPrice](#classUnit_1acb192f1005a38a4c7090c0a7f64d2c50)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) npcId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell)` Get the price of the item at a given npc (by id), which choice of buying or selling, in the current difficulty.
publicint`[getPrice](#classUnit_1aa8ba674e6441c93355844d49619998e8)([Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) difficulty)` Get the price of the item at a given npc, with choice of buying or selling, in a given difficulty.
publicint`[getPrice](#classUnit_1a4b9c81d08835307ba5900dc99c8b9313)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) npcId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) difficulty)` Get the price of the item at a given npc (by id), with choice of buying or selling, in a given difficulty.
public boolgetEnchant(intnEnchant) Determine whether or not a unit has a given enchant.
public boolshop(intdwMode) Shop with a given npc, either buying or selling.
public boolsetSkill(String skillName,intnHand) Set the skill on the given hand to be skill with name skillName.
public boolsetSkill(intnSkillId,intnHand) Set the skill on the given hand to be skill with id nSkillId.
public voidmove(intx,inty) Move to the given location.
public voidmove() Move to this unit.
publicint`[getQuest](#classUnit_1afbb11a6c2f4457b19fd464c1df647065)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nAct,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nQuest)` Get the quest flag for a quest specified by act and quest number.
publicint`[getMinionCount](#classUnit_1a1cf6810c2589b47f74cfa125375d75ed)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType)` Get the number of minions of a certain type.
publicint`[getRepairCost](#classUnit_1ae007a9f727a4f34f40e5bb4d0867897b)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId)` Get price to repair this unit at the current npc given by nNpcClassId.
publicint`[getItemCost](#classUnit_1a18eb04eaed8f97b76aacbd8b2734f563)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId)` Get the cost to do something (buy, sell, repair) with the given item, at the given npc.
publicint`[getItemCost](#classUnit_1ac27394b9daab7a7c1c457ab6121910f8)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nDifficulty)` Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.
publicint`[getItemCost](#classUnit_1a9db71041710e126f77d3a2eb2526fd9a)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nDifficulty)` Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.
publicint`[getItemCost](#classUnit_1ae375f1e4e46cdc39c29a947d7add4765)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[Unit](#classUnit) npc)` Get the cost to do something (buy, sell, repair) with the given item, at the given npc.

Members

publicint`[type`](#classUnit_1a45243122ae655f50179f96bc831bfb1d)

The type of the unit.

0 - Player

1 - NPC

2 - Object

3 - Missile

4 - Item

5 - Warp

Source: botNET

publicint`[classid`](#classUnit_1ab7a6985a8d8a60137e8a469fbb5b2d04)

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

publicint`[mode`](#classUnit_1a0e0de49749be72180866dd31b76a0102)

The mode of the unit.

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=988

public Stringname

The name of the unit.

publicint`[act`](#classUnit_1afaf30997a33a9c05c7a4941d1c7bfd39)

The act where the unit is currently located.

publicint`[gid`](#classUnit_1ad6fb57eda20f91a8b4ea15eb28621f1f)

The unit unique id.

Referred to simply as the unit id. Used along with the unit type to uniquely identify the unit.

publicint`[x`](#classUnit_1a356b2d8a1d6dde32b67b2c9a3e173b99)

The x location of the unit.

publicint`[y`](#classUnit_1a6846a7ed25c3e93b51f9bc9643576f05)

The y location of the unit.

publicint`[targetx`](#classUnit_1abe6abf7822c2b691853fb58320157b0f)

The target x location of the unit.

Where the game is taking the unit.

publicint`[targety`](#classUnit_1a9ee1df35e54c3a4f8756329782792400)

The target y location of the unit.

Where the game is taking the unit.

publicint`[area`](#classUnit_1af5f2e11d4f116084ffd807b578078d7d)

The id of the area (level) the unit is located in.

Todo: Get a reference for the area IDs.

publicint`[hp`](#classUnit_1ae9d3c95ccf18f5bc2bd6a7e68f0e7b1c)

The unit's current health.

publicint`[hpmax`](#classUnit_1a0d97cfa23ab03fa550861e9f0aac7f20)

The unit's maximum health.

publicint`[mp`](#classUnit_1abbab13fe2ae1ae93b78ea148fde7a4ff)

The unit's current mana.

publicint`[mpmax`](#classUnit_1a07b6e27b8e9e9430ff9c3be224f6090e)

The unit's maximum mana.

publicint`[stamina`](#classUnit_1a53c596913a3c96cc692df12c26a3ac7d)

The unit's current stamina.

publicint`[staminamax`](#classUnit_1ac6acb5617d4f9b525287e35b91575c31)

The unit's maximum stamina.

publicint`[charlvl`](#classUnit_1ae12b4d41735cb54cf7609bcaa772f4ae)

The character level.

The level that determines stat points, skill levels, etc.

publicint`[itemcount`](#classUnit_1af3532e4e568df722332b0e2d85759fb3)

The number of items in inventory.

publicint`[owner`](#classUnit_1a8616a100c244d69e7592d5b6843a0b61)

The unit id of the owner of the unit.

publicint`[ownertype`](#classUnit_1ae2003fc0bc7e60523ff0c05d1f7bb1ca)

The type of owner.

type

publicint`[spectype`](#classUnit_1a90be3cd88e866777cffb925e3244e730)

The special type of the unit.

Represents things like unique, minion, boss, etc.

1 - "Normal" Boss 2 - Champion 4 - Boss 8 - Minion

publicint`[direction`](#classUnit_1af64fb0f78ce8cb663fe12ec8a1c5f81d)

The direction of the unit.

Todo: Figure out what the direction is.

publicint`[uniqueid`](#classUnit_1aeda7422b700e357cdda91fb24312e58e)

The unique id of a boss.

Taken from pUnit->pMonsterData->wUniqueNo. Not the same thing as the gid (unit id).

public Stringcode

The three digit code for an item.

See: http://forums.d2botnet.org/viewtopic.php?f=18&t=991

public Stringprefix

The magic prefix of the item.

public Stringsuffix

The magic suffix of the item.

public String[]prefixes

The magic prefixes of the item.

public String[]suffixes

The magic suffixes of the item.

publicint`[prefixnum`](#classUnit_1a00e6bd1941d366802e6ac571e36da8c3)

The id code for the magic prefix.

publicint`[suffixnum`](#classUnit_1ae71acd4a5d4d075f0211242f48e18d3c)

The id code for the magic suffix.

publicint`[prefixnums`](#classUnit_1a66f3e79ca4097a2c095a4f047b97f996)

The id codes for the magic prefixes.

publicint`[suffixnums`](#classUnit_1af668286ae6c3d1d87bfc531ab8d54f77)

The id codes for the magic suffixes.

public Stringfname

The full name of an item.

publicint`[quality`](#classUnit_1af7a138ffb9643f0015ba22f0230e5ce4)

The item quality.

1 - Low quality

2 - Normal

3 - Superior

4 - Magic

5 - Set

6 - Rare

7 - Unique

8 - Crafted

Source: botNET

publicint`[node`](#classUnit_1ab5da58f77c0aaa3f3ce81cccee12e057)

No clue.

Todo: Get a clue.

publicint`[location`](#classUnit_1a60b8bec5206902278dfbbebe75c3617e)

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

publicint`[sizex`](#classUnit_1a1320b38ed997f4922abfeb2966fed81b)

The x size of the item.

publicint`[sizey`](#classUnit_1afe39c0f050662a28ffd252d50f94910d)

The y size of the item.

publicint`[itemType`](#classUnit_1ab0d3eddb92c27f52f7698895bcf3905b)

The type of the item.

Todo: Put together a reference for item type.

public Stringdescription

The description of the item.

publicint`[bodylocation`](#classUnit_1ab7779c44d220bab7d0d8467a6d1fd007)

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

publicint`[ilvl`](#classUnit_1aee7cd2c778a2ad23cbb2001378bfd86b)

Item level.

Used for things like item stat rolling.

publicint`[lvlreq`](#classUnit_1af1677614eb990c59aa3cd43be30983e2)

Level requirement (character level required to use the item).

publicint`[gfx`](#classUnit_1a9bd325f9e2eb378709bf785a2b4bc6ad)

Get the id for the graphic used for the item.

publicint`[runwalk`](#classUnit_1ac8a909f484cee949343474ff0cddcb5f)

Whether the controlled character is in the always run mode or not.

0 - Walk unless directed to run 1 - Always run

publicint`[weaponswitch`](#classUnit_1ac9b8c63afb5360437af31a0b0902232a)

Set the weapon switch.

publicint`[objtype`](#classUnit_1adfb606b289eeccde32b0ed79ed0020c9)

The object type.

Todo: Figure out what this means.

publicint`[islocked`](#classUnit_1afa81eef36e4eddf98f8dd69c48e22875)

Whether or not the chest is locked.

public boolgetNext()

Get the next unit that matches the originally given name or class id and originally specified mode.

Returns

Whether another unit was found.

public boolgetNext(String szName)

Get the next unit that matches the given name and originally specified mode.

Parameters

Returns

Whether another unit was found.

public boolgetNext(uint32_t dwClassId)

Get the next unit that matches the given class id and originally specified mode.

Parameters

Returns

Whether another unit was found.

public boolgetNext(String szName,uint32_t dwMode)

Get the next unit that matches the given name and mode.

Parameters

Returns

Whether another unit was found.

public boolgetNext(uint32_t dwClassId,uint32_t dwMode)

Get the next unit that matches the given class id and mode.

Parameters

Returns

Whether another unit was found.

public voidcancel()

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 boolrepair()

Try to repair.

Need to be able to find unit that you're trying to repair with. That means the unit needs to still be in the server unit hash table.

Returns

true if successful.

public booluseMenu(intmenuItem)

Use an NPC menu.

Need to be able to find unit that you're trying to repair with. That means the unit needs to still be in the server unit hash table.

Parameters

Returns

true if menu was found.

public boolinteract()

Interact with the unit.

If the unit is an item in inventory or stash pick it up. Otherwise click it on the map.

public boolinteract(intdestId)

Interact with a waypoint.

If the unit is an object, assume it's a waypoint, and take it.

Parameters

publicUnit`[getItem](#classUnit_1a4ef77dc37b10ba1fa7254935549f66fc)(String name,uint32_t mode,uint32_t nUnitId)`

Get an item from inventory by name, mode and nUnitId.

Parameters

Returns

The first item found that matches the description.

publicUnit`[getItem](#classUnit_1ad5dbc6824bff1d1847be8052ab36d381)(uint32_t classId,uint32_t mode,uint32_t nUnitId)`

Get an item from inventory by classId, mode and nUnitId.

Parameters

Returns

The first item found that matches the description.

publicUnit`[getItems](#classUnit_1af421c40cb966dd2bef028c3ae2660e78)()`

Get all items from inventory.

Returns

An array of all the items from inventory.

public boolgetMerc(bool dummy)

Get whether this player has a merc.

The unit being operated on should be a player.

Parameters

Returns

true if the player has a live merc.

publicUnit`[getMerc](#classUnit_1a765ff16754426875b9975e71c776a6ac)()`

Get a player's merc.

The unit being operated on should be a player.

Returns

The merc if there is one.

public StringgetSkill(inthand)

Get skill name from hand.

Parameters

0 - Right hand

1 - Left hand

Returns

Skill name.

publicint`[getSkill](#classUnit_1a94823fedd1fb16eece0fe7fd729bb4e8)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) hand)`

Get skill id from hand.

Parameters

2 - Right hand

3 - Left hand

Returns

Skill id.

publicint`[getSkill](#classUnit_1acfc83d3e88c549e6dae3c682c3baf40f)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) dummy)`

Get all skills.

Gets all skill ids, along with corresponding base and total skill levels.

Parameters

Returns

An array of arrays of integers. Inside the inner array the 0th index is the skill id, the 1st index is the base skill level and the 2nd index is the total skill level. Only the first 256 skills are read.

publicint`[getSkill](#classUnit_1ab14f99798787ec5b258a47824f089604)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSkillId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nExt)`

Calls D2COMMON_GetSkillLevel and returns the result.

Todo: Figure out what D2COMMON_GetSkillLevel does.

Returns

Whatever D2COMMON_GetSkillLevel returns.

publicUnit`[getParent](#classUnit_1aba1d739e034f714e07e5c66a1bcd8297)()`

Gets the parent of a unit.

This function is used for monster and item units.

Returns

The parent unit.

public StringgetParent()

Gets the parent of a unit.

This function is used for object units.

Returns

The parent's name.

public voidoverhead(Object message)

Puts the string equivalent of message over the unit.

publicint`[getFlags](#classUnit_1a01704c64338a7818f03ea9fdb0205ee6)()`

Returns the item flags.

Returns

Item flags:

0x00000001 - Equipped

0x00000008 - In socket

0x00000010 - Identified

0x00000040 - Weapon/shield is in the active weapon switch

0x00000080 - Weapon/shield is in the inactive weapon switch

0x00000100 - Item is broken

0x00000400 - Full rejuv

0x00000800 - Socketed

0x00002000 - In the trade or gamble screen

0x00004000 - Not in a socket

0x00010000 - Is an ear

0x00020000 - A starting item (worth only 1 gold)

0x00200000 - Rune, or potion, or mephisto's soulstone

0x00400000 - Ethereal

0x00800000 - Is an item

0x01000000 - Personalized

0x04000000 - Runeword

Source: http://subversion.assembla.com/svn/d2bs/scripts/YAMB/libs/YAMB/common/YAM-Common.dbl r1086

public boolgetFlag(intflags)

Same as getFlags, but returns a boolean.

Returns true if any of the flags given match the item flags.

getFlags

Parameters

Returns

true if any of the flags are set in the item flags.

public doublegetStat(intnStat,intnSubIndex)

Get a stat by stat id and sub index.

Used for stat 13.

Parameters

Returns

The stat value.

publicint`[getStat](#classUnit_1ab7cb6e0da97e16296f391f448630c4e0)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSubIndex)`

Get a stat by stat id and sub index.

Used for everything except stat 13.

Parameters

Returns

The stat value.

publicint`[getStat](#classUnit_1a106c9cbe30bae8d80322f3ec1bc3aafa)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nStat,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nSubIndex)`

Get an array of all the stats of the item.

Parameters

Returns

An array of the first 64 stats. The indices of the inner array are: 0 - nStat, 1 - nSubIndex, 2 - nValue.

public boolgetState(intnState)

Return whether or not the unit has a given state.

Parameters

Returns

Whether or not the unit has the state.

publicint`[getPrice](#classUnit_1ac12f87a160fd951c157ab1107029a2d9)([Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell)`

Get the price of the item at a given npc, with choice of buying or selling, in the current difficulty.

Todo: Determine the meaning of "buysell".

Parameters

Returns

The price requested.

publicint`[getPrice](#classUnit_1acb192f1005a38a4c7090c0a7f64d2c50)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) npcId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell)`

Get the price of the item at a given npc (by id), which choice of buying or selling, in the current difficulty.

Todo: Determine the meaning of "buysell".

Parameters

Returns

The price requested.

publicint`[getPrice](#classUnit_1aa8ba674e6441c93355844d49619998e8)([Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) difficulty)`

Get the price of the item at a given npc, with choice of buying or selling, in a given difficulty.

Todo: Determine the meaning of "buysell".

Parameters

Returns

The price requested.

publicint`[getPrice](#classUnit_1a4b9c81d08835307ba5900dc99c8b9313)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) npcId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) buysell,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) difficulty)`

Get the price of the item at a given npc (by id), with choice of buying or selling, in a given difficulty.

Todo: Determine the meaning of "buysell".

Parameters

Returns

The price requested.

public boolgetEnchant(intnEnchant)

Determine whether or not a unit has a given enchant.

Parameters

Returns

Whether or not the unit has the enchantment.

public boolshop(intdwMode)

Shop with a given npc, either buying or selling.

Parameters

Returns

Whether or not the shop went through.

public boolsetSkill(String skillName,intnHand)

Set the skill on the given hand to be skill with name skillName.

Waits up to one second for the skill to be set.

Todo: Fix argc < 1, should be argc < 2

Parameters

Returns

Whether operation was successful.

public boolsetSkill(intnSkillId,intnHand)

Set the skill on the given hand to be skill with id nSkillId.

Waits up to one second for the skill to be set.

Todo: Fix argc < 1, should be argc < 2

Parameters

Returns

Whether operation was successful.

public voidmove(intx,inty)

Move to the given location.

Parameters

public voidmove()

Move to this unit.

publicint`[getQuest](#classUnit_1afbb11a6c2f4457b19fd464c1df647065)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nAct,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nQuest)`

Get the quest flag for a quest specified by act and quest number.

Parameters

Returns

The quest flag for the specified quest.

publicint`[getMinionCount](#classUnit_1a1cf6810c2589b47f74cfa125375d75ed)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nType)`

Get the number of minions of a certain type.

Parameters

Returns

The number of minions of the specified type.

publicint`[getRepairCost](#classUnit_1ae007a9f727a4f34f40e5bb4d0867897b)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId)`

Get price to repair this unit at the current npc given by nNpcClassId.

Parameters

Returns

The price to repair the given unit.

publicint`[getItemCost](#classUnit_1a18eb04eaed8f97b76aacbd8b2734f563)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId)`

Get the cost to do something (buy, sell, repair) with the given item, at the given npc.

Parameters

Returns

The price.

publicint`[getItemCost](#classUnit_1ac27394b9daab7a7c1c457ab6121910f8)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nNpcClassId,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nDifficulty)`

Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.

Parameters

Returns

The price.

publicint`[getItemCost](#classUnit_1a9db71041710e126f77d3a2eb2526fd9a)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[Unit](#classUnit) npc,[int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nDifficulty)`

Get the cost to do something (buy, sell, repair) with the given item, at the given npc, in the given difficulty.

Parameters

Returns

The price.

publicint`[getItemCost](#classUnit_1ae375f1e4e46cdc39c29a947d7add4765)([int](#group__handlers_1gad45ee50356f6b4f157faf0c8e44217ac) nMode,[Unit](#classUnit) npc)`

Get the cost to do something (buy, sell, repair) with the given item, at the given npc.

Parameters

Returns

The price.

Generated by Moxygen