d2jsp Command Reference:

 area [Object]
 area.exits;
 area.name;
 area.x;
 area.xsize;
 area.y;
 area.ysize;
 control [Object]
 control.click( );
 control.getNext( );
 control.getText( );
 control.setText( );
 control.disabled;
 control.maxlength;
 control.text;
 control.type;
 control.visible;
 control.x;
 control.xsize;
 control.y;
 control.ysize;
 file [Object]
 file.close( );
 file.flush( );
 file.getc( );
 file.putc( );
 file.readLine( );
 file.seek( );
 file.writeLine( );
 file.eof;
 file.pos;
 party [Object]
 party.getNext( );
 party.area;
 party.gid;
 party.level;
 party.life;
 party.name;
 party.partyflag;
 party.partyid;
 party.x;
 party.y;
 presetunit [Object]
 presetunit.id;
 presetunit.roomid;
 presetunit.roomx;
 presetunit.roomy;
 presetunit.type;
 presetunit.x;
 presetunit.y;
 room [Object]
 room.getCollision( );
 room.getFirst( );
 room.getNearby( );
 room.getNext( );
 room.getPresetUnits( );
 room.getStat( );
 room.unitInRoom( );
 room.correcttomb;
 room.level;
 room.levelx;
 room.levely;
 room.number;
 room.subnumber;
 room.type;
 room.x;
 room.y;
 screen [Object]
 screen.sendToBack( );
 screen.sendToFront( );
 screen.color;
 screen.font;
 screen.image;
 screen.opacity;
 screen.text;
 screen.type;
 screen.x;
 screen.x2;
 screen.y;
 screen.y2;
 script [Object]
 script.getNext( );
 script.send( );
 script.stop( );
 script.abort;
 script.gametype;
 script.name;
 script.running;
 script.threadid;
 unit [Object]
 unit.cancel( );
 unit.getEnchant( );
 unit.getFlag( );
 unit.getItemCost( );
 unit.getMinionCount( );
 unit.getNext( );
 unit.getParent( );
 unit.getSkill( );
 unit.getSkillDamageMax( );
 unit.getSkillDamageMin( );
 unit.getStat( );
 unit.getState( );
 unit.getStatEx( );
 unit.interact( );
 unit.move( );
 unit.overhead( );
 unit.repair( );
 unit.setSkill( );
 unit.shop( );
 unit.useMenu( );
 unit.useSkill( );
 unit.useSkillAt( );
 unit.act;
 unit.area;
 unit.classid;
 unit.code;
 unit.description;
 unit.fname;
 unit.gid;
 unit.hp;
 unit.hpmax;
 unit.ilvl;
 unit.itemclass;
 unit.itemid;
 unit.itemloc;
 unit.itemtype;
 unit.lvlreq;
 unit.mode;
 unit.mp;
 unit.mpmax;
 unit.name;
 unit.owner;
 unit.ownertype;
 unit.pid;
 unit.pname;
 unit.prefix;
 unit.quality;
 unit.runeword;
 unit.sid;
 unit.spectype;
 unit.state;
 unit.status;
 unit.subarea;
 unit.suffix;
 unit.type;
 unit.x;
 unit.xsize;
 unit.y;
 unit.ysize;
 me [Global Object]
 me.language [Object]
 me.getQuest( );
 me.account;
 me.charname;
 me.chickenhp;
 me.chickenmp;
 me.diff;
 me.gamefilename;
 me.gamelength;
 me.gamename;
 me.gamepassword;
 me.gameserverip;
 me.gamestarttime;
 me.gametype;
 me.golddialog;
 me.ingame;
 me.ip;
 me.itemoncursor;
 me.ladder;
 me.lasterror;
 me.logchicken;
 me.logquit;
 me.logtimeout;
 me.mercnamestr;
 me.mercrevive;
 me.minimized;
 me.miscscreenmode;
 me.ping;
 me.pingtimer;
 me.playertype;
 me.quitonerror;
 me.quitonhostile;
 me.quitscriptend;
 me.randommove;
 me.realm;
 me.realmshort;
 me.runwalk;
 me.screensize;
 me.showexp;
 me.showlifeorb;
 me.showmanaorb;
 me.skip;
 me.version;
 me.windowtitle;
Global Functions
 acceptTrade( );
 beep( );
 blockEvent( );
 blockMinimize( );
 checkCollision( );
 clickItem( );
 clickMap( );
 clickParty( );
 copyUnit( );
 createDirectory( );
 delay( );
 fileOpen( );
 getArea( );
 getBaseStat( );
 getCursorType( );
 getDistance( );
 getLocaleString( );
 getMouseCoords( );
 getMyPID( );
 getParty( );
 getPath( );
 getPlayerFlag( );
 getPresetUnits( );
 getRating( );
 getRepairCost( );
 getRoom( );
 getScreenHook( );
 getScript( );
 getTextWidthHeight( );
 getThreadPriority( );
 getTickCount( );
 getTradeInfo( );
 getUIFlag( );
 getUnit( );
 getWaypoint( );
 gold( );
 include( );
 isIncluded( );
 load( );
 playSound( );
 print( );
 quit( );
 quitGame( );
 registerEvent( );
 rnd( );
 runGC( );
 say( );
 scriptBroadcast( );
 sendCopyData( );
 sendDDE( );
 sendSound( );
 setMinimized( );
 setThreadPriority( );
 stop( );
 submitItem( );
 takeScreenshot( );
 transmute( );
 useSkillPoint( );
 useStatPoint( );
 weaponSwitch( );
Constants
 EVENT_AREACHANGE;
 EVENT_CHATMSG;
 EVENT_COPYDATA;
 EVENT_GAMEMSG;
 EVENT_HOSTILEMSG;
 EVENT_INPUTLINE;
 EVENT_ITEMSTAT;
 EVENT_KEYDOWN;
 EVENT_KEYUP;
 EVENT_MELIFE;
 EVENT_MISSILEMOVE;
 EVENT_MISSILESTATE;
 EVENT_MOUSEDOWN;
 EVENT_MOUSEUP;
 EVENT_NEWITEM;
 EVENT_NEWNPC;
 EVENT_NPCLIFE;
 EVENT_NPCMOVE;
 EVENT_NPCSTAT;
 EVENT_NPCSTATE;
 EVENT_PARTYMSG;
 EVENT_PLAYERMOVE;
 EVENT_PLAYERSTAT;
 EVENT_PLAYERSTATE;
 EVENT_QUEST;
 EVENT_SCRIPTMSG;
 EVENT_UNITMOVE;
 EVENT_WINDOWFOCUS;

Global Objects:

 
Summary: Holds Area Information
Description:
Area object, holds information about the area
Usable: [In Game]

 Properties:

 
Summary: Gets a list of the exits for this Area
Description:
Returns an array of area id's that the area links to.
Note: Does not show the red portals in Act 5
Usable: [In Game]
 
Summary: Name of the Area
Description:
Returns the name of the area
Usable: [In Game]
 
Summary: Start X Coordinate of the Area
Description:
starting x coordinate of the area.
Note: You need to *5 this value for the actual ingame size.
Usable: [In Game]
 
Summary: X Size of the Area
Description:
x size of the area
Note: You need to *5 this value for the actual ingame size.
Usable: [In Game]
 
Summary: Start Y Coordinate of the Area
Description:
starting y coordinate of the area.
Note: You need to *5 this value for the actual ingame size.
Usable: [In Game]
 
Summary: Y Size of the Area
Description:
y size of the area
Note: You need to *5 this value for the actual ingame size.
Usable: [In Game]
 
Summary:
Description:
Usable: [Out of Game]

 Functions:

 
Summary:
Description:
Clicks a control

If x and y are specified, clicks a specific spot within a control (ie, listbox)
Usable: [Out of Game]
 
Summary:
Description:
Usable: [Out of Game]
 
Summary: Gets the controls extended text
Description:
Gets the controls extended text, in a string array
Usable: [Out of Game]
 
Summary: Sets the controls text
Description:
Sets the controls text (edit box)
Usable: [Out of Game]

 Properties:

 
Summary: Returns whether a control is disabled or not
Description:
Returns whether a control is disabled or not
Usable: [Out of Game]
 
Summary: Returns the max length an edit box will accept.
Description:
Returns the max length an edit box will accept for a string

**Note: This includes the null terminator, so for script purposes you need to subtract 1 from this value.
Usable: [Out of Game]
 
Summary:
Description:
Usable: [Out of Game]
 
Summary:
Description:
Usable: [Out of Game]
 
Summary: Returns whether control is visible
Description:
Returns true if a control is visible, or false if it is hidden
Usable: [Out of Game]
 
Summary:
Description:
Usable: [Out of Game]
 
Summary:
Description:
Usable: [Out of Game]
 
Summary:
Description:
Usable: [Out of Game]
 
Summary:
Description:
Usable: [Out of Game]
 
Summary: The file object handle.
Description:
Points to a file opened with openFile()
Usable: [In Game] [Out of Game]

 Functions:

 
Summary: Closes a file that was opened
Description:
This will close the file that you opened with openFile()

Once the file is closed, you may no longer read or write to it, and file will be equal to 0 (null)
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: Gets the next character
Description:
Gets the next character on the file stream
Most useful for binary reading
Usable: [In Game] [Out of Game]
 
Summary: Puts a character into a file
Description:
Puts a character into the file stream. Pass multiple integers to insert multiple characters in one call.
Most useful for binary writing
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]

 Properties:

 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: Returns the file byte position
Description:
Returns the file byte position shown by ftell()
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game]

 Functions:

 
Summary:
Description:
Usable: [In Game]

 Properties:

 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Returns the party button status
Description:
Returns the following values:
    0 = Invite (no invites for this person, invite them to the party)
    1 = None (cannot invite this person, they are already in a party, or this is you)
    2 = Accept (they invited you)
    4 = Cancel (you invited them)
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: X Location of the player
Description:
Returns the X location of the party player
Usable: [In Game]
 
Summary: Y Location of the player
Description:
Returns the Y location of the party player
Usable: [In Game]
 
Summary: Gets a preset unit that always exists in every game
Description:
PresetUnits are NPCs, objects and tiles in the map which are known by the game as long as you stay in a specific act. Querying presetunits is the way to find out the placement of WPs, NPCs, doors, tiles, chests, etc,
in the map without the needing to be near them.
Barrels, baskets, chests, etc. are not presetunits.

The position of presetunits may change while the game is running (i.e. NPCs). In that case, the position you get by doing a look up of the presetunit is only a hint, where the unit is. In practice you will move to the position of the
presetunit and than you can look up the life unit with getUnit(); to get the current position of the unit.
Usable: [In Game]

 Properties:

 
Summary: Class Id of the presetunit
Description:
presetunit.id is a numeric value representing the classid of a specific presetunit.
Usable: [In Game]
 
Summary: The room number the presetunit resides in
Description:
presetunit.roomid is a numeric value representing the room number where the specific presetunit is in.

It is the same number as you get by room.number, and it is the number you maybe want to give to the roomarray parameter of getPresetUnits().
Usable: [In Game]
 
Summary: Returns the X coordinate of the room the presetunit resides in
Description:
presetunit.roomx is a numeric value representing the x-coordinate divided by 5 of the room (not of the unit itself) where the specific presetunit is in.

To get the absolute x-coordinate of the concerned room (not of the unit) you have to multiply this value by 5.
Usable: [In Game]
 
Summary: Returns the Y coordinate of the room the presetunit resides in
Description:
presetunit.roomy is a numeric value representing the y-coordinate divided by 5 of the room (not of the unit itself) where the specific presetunit is in.

To get the absolute y-coordinate of the concerned room (not of the unit) you have to multiply this value by 5.
Usable: [In Game]
 
Summary: Returns the type of the presetunit
Description:
presetunit.type is a numeric value representing unit type of concerned presetunit. Possible types are:

Type 0 is Player
Type 1 is Monster/NPC
Type 2 is Object
Type 3 is Missile
Type 4 is Item
Type 5 is Tile

Practically presetunits are only NPCs, Objects and Tiles.
Usable: [In Game]
 
Summary: Returns the X coordinate of the in room location of the unit.
Description:
presetunit.x is a numeric value representing the x-coordinate of the presetunit relative to the rooms x-coordinate where the presetunit is in.

To get the absolute x-coordinate of the presetunit you have to add the absolute x-coordinate of the room (presetunit.roomx)
Usable: [In Game]
 
Summary: Returns the Y coordinate of the in room location of the unit.
Description:
presetunit.y is a numeric value representing the y-coordinate of the presetunit relative to the rooms y-coordinate where the presetunit is in.

To get the absolute y-coordinate of the presetunit you have to add the absolute y-coordinate of the room (presetunit.roomy)
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]

 Functions:

 
Summary:
Description:
room.getCollision() with no params will return a two dimensional array with all the collision values for the room

room.getCollision( 1 ); // returns ?? (i forget, will figure this out later :)

room.getCollision(x, y); // returns the collision table value for XY coord. of the room
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Returns nearby rooms
Description:
Returns an array of rooms that are near to this room (surrounding rooms.)
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
room.getPresetUnits([type],[id]); // This returns an ARRAY of presetunit objects!
        Params: Type will specify what type to return; ID will specify only what id's to return
        presetunit Object Properties: presetunit.id, presetunit.type, presetunit.x, presetunit.y
        **Note: In order to get presetunits for far away rooms, you will likely have to initialize/release the room(s)
Usable: [In Game]
 
Summary:
Description:
see roomstats.txt for more info
Usable: [In Game]
 
Summary: Returns true or false, depending if the unit is in the room or not.
Description:
Returns true or false, depending if the unit is in the room or not.

Note: Works for all unit types, players, items, objects, etc
Usable: [In Game]

 Properties:

 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
If a room has a type of 1, it will return -1 for room.number and room.subnumber
Usable: [In Game]
 
Summary:
Description:
If a room has a type of 1, it will return -1 for room.number and room.subnumber
Usable: [In Game]
 
Summary: Returns the Preset Type Id
Description:
Returns the Preset Type Id
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]

 Functions:

 
Summary: draws the screenhook on the bottom
Description:
Causes the z-order of the screenhook to be the first drawn (on bottom)
Usable: [In Game] [Out of Game]
 
Summary: draws the screenhook on top
Description:
Causes the z-order of the screenhook to be the last drawn (on top)
Usable: [In Game] [Out of Game]

 Properties:

 
Summary:
Description:
Color Chart:
0123456789ABCDEF
0                
1                
2                
3                
4                
5                
6                
7                
8                
9                
A                
B                
C                
D                
F 


As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary:
Description:
As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary: Sets an image associated with a screenhook
Description:
You can now set a bmp screenhook image. Be sure to set the screenhook type to 2 (IMAGE).

Note: So far, only supports bitmaps.

As of 0.42, this value is write only.
Usable: [In Game] [Out of Game]
 
Summary:
Description:
opacity of object, 0 = transparent, 0xff = opaque, default is 0xff

As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary:
Description:
As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary:
Description:
0 = line
1 = box
2 = image (added in 0.42)

As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary:
Description:
As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary:
Description:
As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary:
Description:
As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary:
Description:
As of 0.41, this is a write only property
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game]

 Functions:

 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]

 Properties:

 
Summary: Returns whether a script is set to abort (stop) or not.
Description:
Returns whether a script is set to abort (stop) or not.

**Note: This is a debug value
Usable: [In Game] [Out of Game]
 
Summary: Returns the gametype of the script
Description:
Returns the gametype of the script:

0 - In Game
1 - Out of Game
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: Returns the threadId of the executing script
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Base Game Unit:
Type 0 is Player
Type 1 is Monster/NPC
Type 2 is Object
Type 3 is Missile
Type 4 is Item
Type 5 is Tile
Usable: [In Game]

 Functions:

 
Summary: Cancels certain dialog windows/actions
Description:
If holding an item on cursor, drops item to ground.

Otherwise, passing:
0 - Cancel Dialog (windows with close buttons)
1 - Cancel NPC (menus, gossip chats)
Usable: [In Game]
 
Summary: Get a monsters Enchantment
Description:
Get a monsters enchantment. Returns true or false if the enchantment is on the unit.

**Note: see enchants.txt for a list of enchantments
Usable: [In Game]
 
Summary: Returns if a flag is set on an item
Description:
Returns value for flag passed, depending if flag is set on item or not

**Note: See itemflags.txt for full list of flags
Usable: [In Game]
 
Summary: Returns NPC cost of an item
Description:
Returns NPC cost of an item

If npcClassId is not specified, uses Act V npc.

Modes:
0 - Buying From NPC
1 - Selling To NPC
2 - Repair Cost
Usable: [In Game]
 
Summary: returns the # of minions of this type you currently have
Description:
Returns the # of minions of this type you currently have

Here's the ID list taken from PetType table:
pet type        idx
none            0
single        1
valkyrie        2
golem            3
skeleton        4
skeletonmage    5
revive        6
hireable        7
dopplezon        8
invis            9
raven            10
spiritwolf        11
fenris        12
totem            13
vine            14
grizzly        15
shadowwarrior    16
assassintrap    17
pettrap        18
hydra            19
Usable: [In Game]
 
Summary: Gets next Unit
Description:
See description of getUnit() for what these parameters mean. You do NOT pass Type to getNext.

**Note: If you want to iterate over a specific unit search, and are using the 2nd/3rd/4th params on getUnit, you must also pass them to getNext()
If you only passed Type to getUnit, you do not need to pass any parameters to getNext()
Usable: [In Game]
 
Summary: Returns the parent unit
Description:
Returns the parent unit, or null if there is no parent
Usable: [In Game]
 
Summary: Gets Skill Info
Description:
Gets Skill Info based upon the mode:
0 - Right Hand Skill Name
1 - Left Hand Skill Name
2 - Right Hand Skill Id
3 - Left Hand Skill Id

** If you use getSkillLevel, use SkillID instead of the above mode list to get the getSkillLevel info

getSkillLevel:
0 - will return the full skill level, all +skills calculated
1 - will return only the base level of the skill (no bonus to skills added)
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Gets a Unit Stat
Description:
Gets a Unit Stat

Pass subindex to get a sub index stat: eg; class specific skill bonus

For index:
Pass -1: returns an array of all stats in the format: [statindex, substatindex, value];

Pass -2: returns a complete list of all the stats and substats a unit has. Use this to get an associate array listing of all stats a unit has. Example return for +10 energy item:
print(retval[1][0]); would be 10 (stat 1 is energy, substat value 0).
- See tools/statEnumerator.d2j for an example script on looping through all stats
        This method will return all runeword stats on items!
Usable: [In Game]
 
Summary:
Description:
See states.txt for full list
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Interacts with unit Object
Description:
Interacts with unit Object:

If unit is an item, then mode is a flag to pick item up to cursor or not (from ground). eg: itemOnGround.interact(1); would pick the item up to your cursor

If unit is an object (waypoint), then mode is the destination areaId you wish to travel to

If unit is player: will approach them and offer trade. If a trade request is offered to YOU, use me.interact(1) or player.interact(1) and it will accept the trade request.

If the unit is an npc and you pass 1, I forget what it does ;) (someone remind me)
Usable: [In Game]
 
Summary:
Description:
Obsolete, use clickMap()
Usable: [In Game]
 
Summary: Sets the Unit's overhead message
Description:
Use this to set a Units overhead message. Works for Players, NPCs or Objects.

**Note: This is a clientside effect only, to send the overhead to the server, use say() command and prefix your string with a "!"
Usable: [In Game]
 
Summary: Repairs all equipment
Description:
Repairs all equipment
Usable: [In Game]
 
Summary: Sets a skill to left/right hand
Description:
Sets a skill to left/right hand

Pass itemGlobalId to set skill charge/ability from an item

Hand:
0 = right
1 = left
Usable: [In Game]
 
Summary: Buy/Sell/Repair Items at NPC
Description:
Buy/Sell/Repair Items at NPC

mode:
0=repair (not functional)
1=sell
2=buy

Pass the OBJECT of the npc, ie: npc=getUnit(1, "Malah");
item.shop(npc, 1);
Usable: [In Game]
 
Summary: Uses an NPC menu
Description:
Uses an NPC menu, see npcmenuid.txt for a full list
Usable: [In Game]
 
Summary:
Description:
Obsolete, use clickMap()
Usable: [In Game]
 
Summary:
Description:
Obsolete, use clickMap()
Usable: [In Game]

 Properties:

 
Summary: Returns the Act of the unit
Description:
Returns the act the unit is in. The act is 0 base, so Act 1 will return 0
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Unit's Class Id
Description:
Return's the units Class Id (identifier)
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Global Id
Description:
The global identifier used by D2 to keep a unit sync'd with the server.
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: returns the Set or Unique ID of the item
Description:
returns the Set or Unique ID of the item (used with getBaseStat()

Only applies to Set or Unique items.
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Generic type of the item
Description:
Only applies to items!

Values of item.itemtype:
 0: None                         
1: None
2: Shield shie *
3: Armor tors *
4: Gold gold
5: Bow Quiver bowq *
6: Crossbow Quiver xboq *
7: Player Body Part play
8: Herb herb
9: Potion poti
10: Ring ring *
11: Elixir elix
12: Amulet amul *
13: Charm char
14: Not Used
15: Boots boot *
16: Gloves glov *
17: Not Used
18: Book book * TP Tome
19: Belt belt *
20: Gem gem
21: Torch torc
22: Scroll scro
23: Not Used
24: Scepter scep
25: Wand wand
26: Staff staf
27: Bow bow *
28: Axe axe
29: Club club
30: Sword swor *
31: Hammer hamm
32: Knife knif
33: Spear spea
34: Polearm pole
35: Crossbow xbow *
36: Mace mace
37: Helm helm *
38: Missile Potion tpot
39: Quest ques * Cube
40: Body Part body
41: Key key
42: Throwing Knife tkni
43: Throwing Axe taxe
44: Javelin jave
45: Weapon weap
46: Melee Weapon mele
47: Missile Weapon miss
48: Thrown Weapon thro
49: Combo Weapon comb
50: Any Armor armo
51: Any Shield shld
52: Miscellaneous misc
53: Socket Filler sock
54: Second Hand seco
55: Staves And Rods rod
56: Missile misl
57: Blunt blun
58: Jewel jewl *
59: Class Specific clas
60: Amazon Item amaz
61: Barbarian Item barb
62: Necromancer Item necr
63: Paladin Item pala
64: Sorceress Item sorc
65: Assassin Item assn
66: Druid Item drui
67: Hand to Hand h2h
68: Orb orb *
69: Voodoo Heads head
70: Auric Shields ashd
71: Primal Helm phlm * Arreat's Face
72: Pelt pelt
73: Cloak cloa
74: Rune rune *
75: Circlet circ
76: Healing Potion hpot
77: Mana Potion mpot
78: Rejuv Potion rpot *
79: Stamina Potion spot
80: Antidote Potion apot
81: Thawing Potion wpot
82: Small Charm scha * Small Charm
83: Medium Charm mcha * Large Charm
84: Large Charm lcha * Grand Charm
85: Amazon Bow abow
86: Amazon Spear aspe
87: Amazon Javelin ajav
88: Hand to Hand 2 h2h2
89: Magic Bow Quiv mboq
90: Magic Xbow Quiv mxbq
91: Chipped Gem gem0
92: Flawed Gem gem1
93: Standard Gem gem2
94: Flawless Gem gem3
95: Perfect Gem gem4
96: Amethyst gema
97: Diamond gemd
98: Emerald geme
99: Ruby gemr
100: Sapphire gems
101: Topaz gemt
102: Skull gemz

Values with an * have been confirmed as a used value. Some of the codes are unused in-game.

Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Returns the name of the unit
Description:
Returns a string holding the name of the unit. This is unicode compatable, as applicable.
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Returns the Personalized Name of an item
Description:
Returns the Personalized Name of an item, or blank if none.
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Returns the type of the unit
Description:
Returns the type of the unit:

0 - Player
1 - Monster/NPC
2 - Object
3 - Missile
4 - Item
5 - Tile
Usable: [In Game]
 
Summary: Unit's Map X position
Description:
This value holds the units current map X coordinate.
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Unit's Map Y Position
Description:
This value holds the units current map Y coordinate.
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]

Global Globals:

 
Summary: Global collection that holds values specific to the current player/account.
Description:
Global collection that holds values specific to the current player/account.

**Note: This global inherits all User Type methods and properties of the Unit object.
Usable: [In Game] [Out of Game]

 Objects:

 
Summary: Returns the current locale language
Description:
Returns the current locale language that the D2 is running.

Note: Returns the 3 letter code Blizzard uses, eg: ENG for English
Usable: [In Game] [Out of Game]

 Functions:

 
Summary: Returns Quest Info
Description:
Here's some of the info you can get:

Act 1:
0: spoke to akara at start of game
1: den
2: blood raven
4: cain
6: andy

Act 2:
7: in act 2
8: spoke to atma at the start of act 2
11: got cube, staff and amulet
12: summoner (must open red portal)
13: spoke to townsfolk
14: killed duriel

Act 3:
15: in act 3
16: unknow, but activated once in act 3
17: book
18: smashed orb
19: gidbin
21: council
22: killed meph

Act 4:
23: in act 4
24: spoke to tyrael
25: izzy
26: soulstone
27: diablo

Act 5:
28: in act 5
35: shenk (made socket)
36: freed soldiers
37: anya
38: nihlathak (personalized item)
Usable: [In Game]

 Properties:

 
Summary: BattleNet Account Name
Description:
Holds the account name of the currently logged in account.
Usable: [In Game] [Out of Game]
 
Summary: Returns the current character name
Description:
Returns the currently (or last) selected character name that was selected for login on Battle.net

Note: Primary use is out of game, though it also works in game
Usable: [In Game] [Out of Game]
 
Summary:
Description:
As of 0.41, this is a write only value
Usable: [In Game]
 
Summary:
Description:
As of 0.41, this is a write only value
Usable: [In Game]
 
Summary: Returns the current difficulty
Description:
me.diff is a numeric value representing the difficulty of the current game.

Possible values are:
    0 - normal
    1 - nightmare
    2 - hell
Usable: [In Game]
 
Summary: Holds the script filename to execute on game start
Description:
Holds the script filename that executes on game start, can be set or get. Use this to override the default.d2j default setting.
Usable: [In Game] [Out of Game]
 
Summary: Game Length to Auto Quit
Description:
Time Limit (in milliseconds) to allow game to reach before core auto quits the game for you

As of 0.41, this is a write only value
Usable: [In Game]
 
Summary: Returns the Game Name
Description:
me.gamename is a string value representing the name of the current game.
Usable: [In Game]
 
Summary: Returns the Game Password
Description:
me.gamepassword is a string value representing the password of the current game.
Usable: [In Game]
 
Summary: Returns the IP of the current game server
Description:
me.gameserverip is a string value representing the IP-address of the server which is hosting the current game.
Usable: [In Game]
 
Summary: Returns the GetTickCount of when you joined the game
Description:
me.gamestarttime is a numeric value representing the time stamp in ms taken from getTickCount() when the current game was joined by you.

Remarks:
If you attach d2jsp mid game, the gamestarttime will represent the time d2jsp was attached.
Usable: [In Game] [Out of Game]
 
Summary: Returns whether the game is Classic or LOD
Description:
me.gametype is a numeric value representing the type of the game you are in. You may say also, it result in false for classic Diablo, and in true for LoD.

Possible values are:
    0 = false - Diablo 2 classic
    1 = true - Diablo 2 Lord of Destruction
Usable: [In Game]
 
Summary: Returns the state of the Gold Dialog
Description:
me.golddialog is a boolean value representing the status of the golddialog.

Possible values are:
    false - There is no golddialog on the screen
    true - There is a golddialog on the screen

me.golddialog recognize all four golddialogs:
1. dropping gold from inventory to ground
2. withdraw gold from stash to inventory
3. deposit gold from inventory to stash
4. withdraw gold from inventory to tradescreen
Usable: [In Game]
 
Summary: Returns whether in game or not
Description:
Returns true if in game, false if not in game.
Usable: [In Game] [Out of Game]
 
Summary: Returns your IP
Description:
me.ip is a string value representing the IP-address of your pc. This may differ from that IP-Address, what other people see from you on the internet, i.e. if you are behind a firewall or a router.
Usable: [In Game] [Out of Game]
 
Summary: Returns whether there is an item on your cursor or not
Description:
me.itemoncursor is a boolean value representing the status of the mousecursor.

Possible values are:
    false - There is no item at the mousecursor
    true - There is no item at the mousecursor

You get an item to the mousecursor by clicking on it while your inventory is open.
Usable: [In Game]
 
Summary: Determines if your character is a ladder character
Description:
Returns 0 if your character is NOT ladder, non-zero if they are.

Note: Only works in game!
Usable: [In Game]
 
Summary: Returns the last script error
Description:
Returns the last script error that occured. Returns "" or null if no last error.

**Note: Once you read (access) this, it will reset the last error to null.

**Note: This is on a per script basis, you will not get errors from other scripts running.
Usable: [In Game] [Out of Game]
 
Summary: Log core chickens
Description:
Set to 1/true to enable logging of core chickening.

Note: Logs to d2jsp.log
Usable: [In Game]
 
Summary: Logs quit() calls
Description:
set to 1/true to enable logging of any script using quit();

Note: Logs to d2jsp.log
Usable: [In Game]
 
Summary: Logs core quits from me.gamelength expiring
Description:
set to 1/true to enable logging of any core quits due to me.gamelength being exceeded

Note: Logs to d2jsp.log
Usable: [In Game]
 
Summary:
Description:
Returns the locale string Id for your hired mercenary
Usable: [In Game]
 
Summary: How much gold you need to revive your mercenary.
Description:
How much gold you need to revive your mercenary.

Remarks: Because of a bug in diablo, this property result in a value > 0 even if you do not have a hireling. This may be, if you left the last game with a character, which has a hireling and this hireling is dead and you now joined the game with a character which never had a hireling yet.
Usable: [In Game]
 
Summary: Returns the D2 window is minimized state
Description:
Returns true or false if the window is minimized or not
Usable: [In Game] [Out of Game]
 
Summary: Returns misc screen mode information
Description:
me.miscscreenmode is a numeric value representing the status of some
dialog-boxes / mousecursor-modes which may be actice.

Possible values are:
     1 - The NPC trade dialog is open
     2 - The mousecursor is the buy cursor
     3 - The mousecursor is the sell cursor
     4 - The mousecursor is the repair cursor
     5 - The sell/buy confirm dialog is shown
    10 - The trade confirm dialog is shown
    11 - The trade dialog is shown
    12 - You stash is open / shown
Usable: [In Game]
 
Summary: Returns your current Ping
Description:
me.ping is a numeric value representing your current ping-value to the game-server.
Usable: [In Game]
 
Summary: Returns the ms since the last ping attempt
Description:
me.pingtimer is a numeric value representing a realtime ms counter of how long it's been since the last packet arrived.
Usable: [In Game]
 
Summary: Returns whether your char is Softcore or Hardcore
Description:
me.playertype is a numeric value representing the kind of your character / of the game:

Possible values are:
     0 = false - Softcore
     1 = true - Hardcore
Usable: [In Game]
 
Summary: Will quit the game if a script error occurs
Description:
As of 0.41, this is a write only value

me.quitonerror is a write only numeric value. If set to 1 (true), the core will quit the current game as soon as a error occurs in any running script. In this case, the error message can be retrieved by me.lasterror in the next game.
If set to 0 and a script error occurs, the core will just print a message to the screen.
Usable: [In Game]
 
Summary: Quits the game if someone hostiles you
Description:
As of 0.41, this is a write only value

me.quitonhostile is a write only numeric value. If set to 1 (true), the core will quit the current game as soon as a other player hostiles you and you are not in town.
If set to 0 the core does nothing when somebody hostiles you.
Usable: [In Game]
 
Summary: Will quit the game when any script finishes
Description:
As of 0.41, this is a write only value

me.quitscriptend is a write only numeric value. If set to 1 (true), the core will quit the current game as soon as any script finishes execution.
If set to 0 the core does nothing when a script finishes execution.
Usable: [In Game]
 
Summary:
Description:
This is obsolete, never implemented.

As of 0.41, this is a write only value
Usable: [In Game]
 
Summary: Returns the long realm name
Description:
me.realm is a string value representing the realm you playing on. For europe the result is is "europe.battle.net".
Usable: [In Game] [Out of Game]
 
Summary: Returns the short realm name
Description:
me.realmshort is a string value representing the realm you playing on. For europe the result is "Europe".
Usable: [In Game] [Out of Game]
 
Summary: Used to read or toggle run/walk mode
Description:
Used to read or toggle run/walk mode
Usable: [In Game]
 
Summary: Returns the current window size
Description:
me.screensize is a numeric value representing the screen-resolution you playing on.

Possible values are:
     0 - 640x480
     2 - 800x600
Usable: [In Game]
 
Summary:
Description:
As of 0.41, this is a write only value
Usable: [In Game]
 
Summary:
Description:
Removed as of v0.35; conflicts with maphack
Usable: [In Game]
 
Summary:
Description:
Removed as of v0.35; conflicts with maphack
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Returns d2jsp version
Description:
Returns the d2jsp version you are running.

Returns in the MAJOR.MINORSUB format. eg; 0.4138 for 0.41.38
Usable: [In Game] [Out of Game]
 
Summary: Returns the title of the Diablo II window
Description:
Returns the title of the Diablo II window that is currently running.
Usable: [In Game] [Out of Game]

Global Functions:

 
Summary:
Description:
**NEED DETAILS FILLED IN
Usable: [In Game]
 
Summary: Creates a system speaker beep
Description:
Creates a system speaker beep:
Added beep( [int beepType] )

beepTypes:
0 = Simple beep. If the sound card is not available, the sound is generated using the speaker.
1 = MB_ICONASTERISK - SystemAsterisk
2 = MB_ICONEXCLAMATION - SystemExclamation
3 = MB_ICONHAND - SystemHand
4 = MB_ICONQUESTION - SystemQuestion
5 = MB_OK - SystemDefault
Usable: [In Game] [Out of Game]
 
Summary: Blocks or unblocks the event before it hits Diablo II
Description:
blockEvent( EVENT_ID, true/false );
Blocks the event you request from Diablo II
Set to true to block, false to unblock

Note: This works in and out of game, and doesnt get reset between games.

Note: Scripts still get the events, so you can script blockers or GUIs relatively easily now.

Valid events: EVENT_MOUSEDOWN, EVENT_MOUSEUP, EVENT_KEYDOWN, EVENT_KEYUP
Usable: [In Game] [Out of Game]
 
Summary: Blocks Diablo II from auto minimizing
Description:
Set to 1 or true to block D2 from minimizing when it loses focus. Set to 0 or false to allow D2 to auto minimize.

Note: This will not bring d2 back into focus, if it is out of focus.
Usable: [In Game] [Out of Game]
 
Summary: Check if path between two objects is clear. Returns 0 if path is clear, 1 if blocked.
Description:
Used to determine what is at an x,y coordinate or if two units or two x,y coordinates have line of sight to each other. The bitmask determines what kind of line of sight. Most useful is bit 0 for walk and bit 1 for vision.

bit 0 : block walk
bit 1 : block light + block Line Of Sight (the possibility to see monsters)
bit 2 : block ranged
bit 3 : block Player's walk but not Mercenary's walk weird)
bit 4 : some doors, entry/exits, a few waypoints.
bit 5 : block light only (not LOS). This is scenery, rocks, trees, etc.
bit 6 : ?
bit 7 : Players (yourself and others)
bit 8 : NPCs & monsters
bit 9 : Items
bit 10 : Objects
bit 11 : Closed doors
bit 12 : ?
bit 13 : friendly NPCs
bit 14 : ?
bit 15 : dead bodies
Usable: [In Game]
 
Summary:
Description:
**NEED DETAILS FILLED IN
Usable: [In Game]
 
Summary: Calls click functions inside d2 (not real mouse clicks, but the function called by clicking)
Description:
Calls click functions inside d2 (not real mouse clicks, but the function called by clicking)

clickType = 0 left down, 1 left hold, 2 left up, 3 right down, 4 right hold, 5 right up
shiftKey = 0 or 1 (shift off or on)
*This function replaces the following commands: move, useSkill, useSkillAt, interact**
* The above commands will be deprecated and eventually removed from the core. Please update your scripts
** interact() will remain for waypoint and grab item to cursor usage and player trade only
Usage: Try and send down then up commands as much as possible to correctly simulate actual game play. Use "hold" as appropriate.
Note: Sending Down but not Up will result in a Mouse Down lock that will hinder regular gameplay until the game detects mouse up.
Be sure and send both down AND up, even if it doesnt seem applicable (it is)
Usable: [In Game]
 
Summary: Clicks a Party option
Description:
Clicks a party option:

0 = Loot toggle
1 = Hostile toggle
2 = Party with Player
3 = Leave Party
Usable: [In Game]
 
Summary: Copys a unit to another variable
Description:
Copys a unit to another variable

**Note: unit1 = getUnit(0); unit2 = unit1; is NOT valid! You must use unit2 = copyUnit(unit1);
Usable: [In Game]
 
Summary: Creates the directory specified
Description:
Creates the directory specified, starting directory is scripts/
    Returns true/false, true if the directory creation succeeds.
Usable: [In Game] [Out of Game]
 
Summary: Delays for a specified time
Description:
Delays for a specified time in milliseconds
Usable: [In Game] [Out of Game]
 
Summary: Opens a file for reading/writing
Description:
Open a file for reading/writing:

Int File open modes:
0 = Read
1 = Write
2 = Append

String open modes: (Added in 0.42)
r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+
Usable: [In Game] [Out of Game]
 
Summary: Gets an area object
Description:
Gets an area object, areaId is optional, if not passed uses current area. Returns Area object.
Note: If invalid areaid is passed (wrong act, etc), it will return undefined.
Usable: [In Game]
 
Summary: Returns a stat value. basestat is an integer 0-23. Classid is an object classid (an integer). statnum is an integer 0-N. Returns undefined for invalid parameters.
Description:
Basestat numbers are: (see libs/getBaseStat.d2l for an includable list of constants)
0 - items
1 - monstats (&npcs)
2 - skilldesc
3 - skills
4 - objects
5 - missiles
6 - monstats2
7 - itemstatcost
8 - levels
9 - leveldefs
10 - lvlmaze
11 - lvlsub
12 - lvlwarp
13 - lvlprest
14 - lvltypes
15 - charstats
16 - setitems
17 - uniqueitems
18 - sets
19 - itemtypes
20 - runes (v0.44)
21 - cubemain (v0.44)
22 - gems (v0.45)
23 - experience (v0.45)
24 - pettype (v0.46)

See libs/base_*.d2l for all the different statnums. See tools/dbs.d2j for a tool to dump all of these.
Usable: [In Game]
 
Summary: Returns the cursor type of your cursor
Description:
Returns the cursor type of your cursor, pass one to see "Shop Mode" cursor types.

Regular Modes: 1 = regular, 3 and 4 = item on cursor, 6 = id scroll, 7 = shop cursor

Shop Mode (7): 1 = regular, 2 = repair, 3 = buy, 4 = sell
Usable: [In Game]
 
Summary:
Description:
Pass two unit objects to get the distance between the two.
Usable: [In Game]
 
Summary: Returns a localized D2 String
Description:
Returns a localized D2 String (unicode)

Works out of game as of 0.41
Usable: [In Game] [Out of Game]
 
Summary: Returns Screen Relative X Y coordinates of mouse cursor
Description:
Returns Screen Relative X Y coordinates of mouse cursor

If paramater is 1, will return Game Relative X Y coordinates of mouse cursor.

The returned value is a 2 member array, containing the X and Y coordinate
Usable: [In Game]
 
Summary: Returns current process Id
Description:
Returns the value of the current process id
Usable: [In Game] [Out of Game]
 
Summary: Gets a partyplayer
Description:
Gets a partyplayer from a player's global id, pass no param to get your partyplayer object (used to enumerate the rest of the people in the game)
Usable: [In Game]
 
Summary: Returns a walkable path from XY to XY
Description:
Returns a FULL PATH of coords from start to finish.
Note: returns undefined if no path can be built.
Note: areaId is the Starting area that the x1 and y1 reside in.
Note: cleanPath is TRUE by default, set to false if you have trouble building a path (ie, Arcane Sanctuary)
path[index][0] is the X value, path[index][1] is the Y value
For more info on this, contact me (njaguar) on the forums or IRC.
Usable: [In Game]
 
Summary: Returns player's flags
Description:
Returns player's flags, works with players off screen, as long as you know their global Id

Interchange player1 and player2 to find if they are hostile to you and vice versa.

flag: 8 = hostility check, 1 = loot check
Usable: [In Game]
 
Summary: Returns an array of objects. Type, classid, and roomarray can be null. If classid is null, returns all preset units of that type in the area. If type is null, returns all preset units of all types in the area.
Description:
A preset unit is a unit that is off screen, and maybe not yet available to getUnit(). Use this to get the x/y coordinates of remote objects such as waypoints, NPCs, objects, items or tiles. The returned object has the following properties:
presetunit.type
presetunit.roomx
presetunit.roomy
presetunit.x
presetunit.y
presetunit.id


In order to get actual x/y coordinates, you will need to add 5 * room x/y. See example.

The parameter info is as follows:
presetunit = getPresetUnits( int area, int type, int classid, roomarray );

area        The area you want query for presetunits, this parameter must be
        a valid area number of the act you stay in.

type        The type of the presetunits you are looking for. Valid types are:
        0 is Player
        1 is Monster/NPC
        2 is Object
        3 is Missile
        4 is Item
        5 is Tile
        type may be null, in that case you would get presetunits of any
        type.

classid        The classid of the presetunits you are looking for. i.e. if you
        are looking for your stash, the stash is classid 267.
        classid may be null, in that case you would get presetunits
        with any classid.
    
roomarray    This argument is an array of numbers. Each number represents a room
        number of specific room (object room, property number).
        i.e. when you are only interested in presetunits of the rooms 529
        and 530 so setup an array (myRoomArray = [529, 530];) and pass it
        as 4th argument.
        roomarray may be null, in that case you would get presetunits
        regaedless of the room where they are in.

Result:
-------

The result is an array of presetunit - objects,
indexed starting with 0 up to (array.length-1).

So array.length represents the count of matching presetunits.

If there are no presetunits which comply with the arguments, the result is null.
Usable: [In Game]
 
Summary: Gets Attack Rating or Block %
Description:
Gets Attack Rating or Block %

** Notes: For value, Pass 0 for right hand, 1 for left hand, this will return Attack Rating %

To get Block %, call it like this: getRating( 3, 0 );
Usable: [In Game]
 
Summary: Returns the Repair All cost
Description:
Returns the Repair All cost based upon the given npc

*Note: Will crash if you use an invalid classid, so use 0x9A if you don't have an id.
Usable: [In Game]
 
Summary: Gets a Room object
Description:
Gets a room object.

If no params are passed, grabs the first (in memory) room in an area.

If 0 is passed, returns the current room the player is standing in.

If areaId is passed, returns the first room (in memory) of that area

If area, x, and y are passed, returns that specific room.
Usable: [In Game]
 
Summary: Gets a screen object
Description:
Gets a screen object that allows you to draw to the screen

**Note: Works out of game as of v0.41
**As of 0.44:
Added constructors to getScreenHook();    // see examples as follows, each param is optional
Base Syntax: getScreenHook( [String text [, int x [, int y [, int x2 [, int y2 [, int color [, int font [, int type [, int opacity]]]]]]]]] );
Example1: getScreenHook( "hello", 100, 100 );    // sets hello text screenhook to 100,100
Example2: getScreenHook( "", 50, 50, 75, 75, 0x20, 0, 1 );    // draws a box at 50,50,75,75, of white color and default opacity
Example3: getScreenHook( "text w/ diff font", 100, 100, -1, -1, 0, 4 );    // uses the #4 font instead of the default
Usable: [In Game] [Out of Game]
 
Summary: Gets a script object
Description:
Returns the first script in d2jsp's memory space

As of version 0.46:
Added new overload to getScript( [1] );    // if you pass 1 (optional), will return the current script
Useful if you want to send messages to yourself to raise 'custom' events.
Usable: [In Game] [Out of Game]
 
Summary: Gets the passed text's width and height
Description:
Returns the width and height for a particular strings font. Useful for building rectangles behind text.

Returns a two dimensional int array, containing the width and height respectively.
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: Returns the system GetTickCount value.
Description:
Returns the value from GetTickCount()
Usable: [In Game] [Out of Game]
 
Summary: Returns information about Player Trading
Description:
Returns various trade informations
Mode = :
    0 = Return General Trade Mode, returns: 0 = no trade, 1 = requested trade, 2 = waiting for you to accept trade, 3,5,7=in trade
    1 = Return Trading Recipients Name (if not in trade, returns last traders name)
    2 = Return Trading Recipients Global ID (if not in trade, returns last traders id)
Usable: [In Game]
 
Summary: Returns UI Mode
Description:
Returns various UI modes, see uiflag.txt for full list
Usable: [In Game]
 
Summary: Gets a Unit Object
Description:
Gets a Unit Object:

Type is required

Second parameter can be the Name of the unit, the item code (3 letters), or the classId of the unit.

Third Parameter is the modeId of the unit, can also be a mask, as follows:
To use this, set the 30th bit to 1, then any other modes' bit index to 1 that you want the core to mask.
Example to return any dead monster, modes are 0 for death, 12 for dead.
dead_unit = getUnit(1, null, (1<<29) | (1<<0) | (1<<12));
** Note: THIS DOES NOT WORK ON ANY MODES GREATER THAN 28! Example: Does NOT work on item modes 100+, or 200+!

Fourth param is the globalId of the unit

**Note: You may pass null the 2nd, 3rd, or 4th parameters to 'skip' them in order to use a later parameter, eg: getUnit(0, null, 1);

For a complete list of modes, see modes.txt
Usable: [In Game]
 
Summary: Returns if you have a waypoint or not
Description:
Returns true or false if you have it.
0 to 8 = act 1,
9 to 17 = act 2, etc.
Usable: [In Game]
 
Summary: Moves/drops gold
Description:
Moves/drops gold

mode 1 = drop, 2 = inventory to trade, 3 = inventory to stash, 4 = stash to inventory
Usable: [In Game]
 
Summary: Includes a specified file into the current running script
Description:
Includes the specified filename and parses it into the current running script. All methods and properties defined inside will be available to the main calling script.

**Note: Includes are forced into libs/
Usable: [In Game] [Out of Game]
 
Summary: Determines is a file is already included
Description:
Returns true or false, if the fileName passed is included or not

Note: Pass the same fileName you pass to include();
Usable: [In Game] [Out of Game]
 
Summary: Loads and runs specified script
Description:
Loads a script from a specified file and runs it under the current scope (in or out of game)
Usable: [In Game] [Out of Game]
 
Summary: Plays any game sound
Description:
Plays any sound listed in the sounds.txt table (by id)

**Note: currently plays at the default background noise volume level, volume control will be a later feature
Usable: [In Game]
 
Summary:
Description:
print command
Usable: [In Game] [Out of Game]
 
Summary: Quits the current game
Description:
Will cause the current game to quit (exit).
Usable: [In Game]
 
Summary: Closes Diablo II.exe
Description:
Will attempt to completely close Diablo II (this is NOT a kill process!)

Note: If Diablo II is frozen, or freezes during the quit, the process will still exist in memory.
Usable: [In Game] [Out of Game]
 
Summary: Registers your script to receive an event
Description:
Registers your script to receive an event determined by EVENT_ID. See the list of EVENT_* contants for a list of events

Second param is your function that the event will subsequently call when fired.

**Note: Pass 0 as the second parameter to unregister an event.
Usable: [In Game] [Out of Game]
 
Summary: Random Number Generator
Description:
Generates a random number between Low and High.
Usable: [In Game] [Out of Game]
 
Summary: Run Javascript Garbage Collector
Description:
Use this to force a run of Spidermonkey's garbage collector.
Usable: [In Game] [Out of Game]
 
Summary: Sends text to all players.
Description:
Sends text to everyone in a game, instead of a local print.
Usable: [In Game] [Out of Game]
 
Summary: Sends a text message to all running scripts
Description:
Sends a text message to all running scripts that is caught by the scriptmsgHandler() event handler
Usable: [In Game] [Out of Game]
 
Summary: Sends a WM_COPYDATA message to another window
Description:
This functions sends a WM_COPYDATA event message to another window on your system. It basically is: SendMessage( handle, WM_COPYDATA .. )

Returns true if the command succeeds and the receiving window accepts it. Otherwise returns false.

This is a very advanced feature. The primary reason for adding it was to replace DDE in autod2jsp.

Notes:
Added a WM_COPYDATA catcher in the core. Will now process WM_COPYDATA messages.
        Id 1 = Execute as a script, Id 2 = Broadcast as a message to running scripts.
        lpData must be a pointer to a valid char * to execute or broadcast.
Usable: [In Game] [Out of Game]
 
Summary:
Description:
**NEED DETAILS FILLED IN
Usable: [In Game] [Out of Game]
 
Summary: Plays an emote sound
Description:
Plays the selected sound effect, emulating the numeric pad 0 to 7 keys

**Note: Only values 25 to 32 work. They send the sound for your character:
25 = Help
26 = Follow Me
27 = This Is For You
28 = Thank You
29 = Oops
30 = Goodbye
31 = Die
32 = Run
Usable: [In Game]
 
Summary: minimizes or restores the d2 window
Description:
Minimizes or restores the d2 window
Note: Set to true to minimize, false to restore
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: Stops the script(s)
Description:
Will stop all running scripts under the current game scope if called without params.
Call with a 1 to terminate only the calling script.
Usable: [In Game] [Out of Game]
 
Summary: Submits Item to Drop Boxes
Description:
Submits Item to boxes like Orifice, Add Sockets, Imbue, etc.

**Note: Item must first be on cursor
Usable: [In Game]
 
Summary: Takes a screenshot
Description:
Calls the D2 function that takes a screenshot and places the file in your Diablo II/ directory

**Note: Works out of game as of v0.41
Usable: [In Game] [Out of Game]
 
Summary: Clicks Cube Transmute Button
Description:
Clicks Cube Transmute Button
Usable: [In Game]
 
Summary:
Description:
Uses a skill point on the number value specified by "skillId". Right now, it only accepts a numeric value, see skills.txt
Usable: [In Game]
 
Summary:
Description:
Uses a stat point on the value specified by "statId". (see stats.txt)
Usable: [In Game]
 
Summary:
Description:
Switches your weapon

If you pass 1, it will return which tab is selected, 0 for 1st, 1 for 2nd
Usable: [In Game]

Global Constants:

 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: Event for Player Hostile
Description:
This event is fired when a player goes hostile with you. The parameter passed is the string displayed on the screen. You can get the hostiling player name from this. The 2nd param is the color string, though this will likely be a static color.
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: Item Stat event
Description:
fires off whenever an item stat changes (eg, quantity)
Passes three params to the method: itemGID, statno, value
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: Event for life/mana changes on player
Description:
This event will fire whenever your life or mana changes. Two int params are passed to your event function: life and mana
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Event for Missile State change
Description:
This event fires whenever a missile state changes.
Passes three params to the method: gid, stateno, value
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: NPC Stat event
Description:
fires off whenever a monster stat changes
Passes three params to the method: monsterGID, statno, value
Usable: [In Game]
 
Summary: Event for Monster State change
Description:
This event fires whenever a monster or npc state changes.
Passes three params to the method: gid, stateno, value
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary:
Description:
Usable: [In Game]
 
Summary: Player Stat event
Description:
fires off whenever a player stat changes
Passes three params to the method: playerGID, statno, value
Usable: [In Game]
 
Summary: Event for Player State change
Description:
This event fires whenever a player state changes.
Passes three params to the method: gid, stateno, value
Usable: [In Game]
 
Summary: EVENT_QUEST constant
Description:
The constant for the EVENT_QUEST event
Usable: [In Game]
 
Summary:
Description:
Usable: [In Game] [Out of Game]
 
Summary: EVENT_UNITMOVE constant
Description:
The EVENT_UNITMOVE constant for registerEvent

**Removed in 0.46! Use the individual unit move events
Usable: [In Game]
 
Summary: Event when the window loses or gains focus
Description:
This event fires when the D2 window loses or gains focus.
The value passed is 0 for lost focus or 1 for gained focus
Usable: [In Game] [Out of Game]