Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Diablo 2 > Diablo 2 Programming
You last visited: Today at 02:59

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[D2NT] API Reference [NO QUESTIONS]

Discussion on [D2NT] API Reference [NO QUESTIONS] within the Diablo 2 Programming forum part of the Diablo 2 category.

Reply
 
Old   #1
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
[D2NT] API Reference [NO QUESTIONS]

Dear community,

this will be the home of the upcoming D2NT 3.1 API reference.

This reference is supposed to be useful for everyone, therefore the official language in this topic is english.

I would really appreciate if we could share some of the work. That's why I hope for some contributions.

In this case, contributing basically means picking some function or object from the list below that has not been dealt with and write a reference for it.
However, to make this really useful, it will not suffice just to gather and write down some info.
It is also necessary to both work thoroughly and stick with the given format. To get an idea of the proper format, check the existing entries.

Before picking some entry to work on, you should definately make sure that it is not beyond your capabilities.
I sure appreaciate your good will, but as mentioned above, this reference must maintain a certain standard in order to be useful.

In order to avoid this to end up in chaos, I came up with some rules for posting in this topic:
  • You may only post to make a contribution to the reference, but make sure the part you are about to pick is not already being prepared by someone else.
  • You may also post placeholders for contributions you are about to prepare.
  • Do not ask questions, do not give feedback, simply do not post anything but a contribution!

Violating these simple rules will result in the deletion of your post. I might also consider further punishment on repeated offense.

If you got any suggestions for further improvements or general questions, don't post them in here, but .


D2NT 3.1 API Reference


Color Reference:

Status: Reference Missing
Status: Creation Pending [<User>]
Status: Reference Completed

Global Functions:

CheckCollision()
ClickMap()
Delay()
ExitGame()
FileOpen()
GetArea()
GetBaseStat()
GetCursorType()
GetDistance()
GetPath()
GetPlayerUnit()
GetPresetUnits()
GetRoom()
GetScript()
GetTickCount()
GetUIState()
GetUnit()
GetWaypoint()
Gold()
Include()
Load()
Print()
Random()
RegisterEvent()
RunGC()
Say()
SendCopyData()
SetStatusText()
SetUIState()
SubmitItem()
Transmute()
UnregisterEvent()


Global Objects:

me [Muddy]

Objects:

PresetUnit
Unit
PlayerUnit
Room
Script
File
Area

Muddy Waters is offline  
Thanks
7 Users
Old 03/14/2011, 23:31   #2
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
function GetArea()



Syntax:

[1] Area GetArea(void);
[2] Area GetArea(int areaid);

Description:

[1] Returns an Area object according to your char's current whereabouts.
[2] Returns an Area object according to the areaid specified.

Possible values of areaid:


Remarks:


Raises an unhandled exception when called using invalid arguments.

Example:
-
Muddy Waters is offline  
Thanks
4 Users
Old 03/15/2011, 00:20   #3
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
object Area




Properties:

Area::id
Area::name
Area::x
Area::xsize
Area::y
Area::ysize


Properties



Syntax:

int Area::id;

Description:

The ID of the area that is represented by this object.

Possible Values:

Remarks:
-

Example:
-



Syntax:

String Area::name;

Description:

The localized name of the area that is represented by this object.

Remarks:
-

Example:
-



Syntax:

int Area::x;

Description:

The x-coordinate of the area's origin (smallest x).

Remarks:

Multiply this value by 5 to get the area's actual x-coordinate.

Example:
-



Syntax:

int Area::xsize;

Description:

The area's length in x-direction (width).

Remarks:

Multiply this value by 5 to get the area's actual width.

Example:
-



Syntax:

int Area::y;

Description:

The y-coordinate of the area's origin (smallest y).

Remarks:

Multiply this value by 5 to get the area's actual y-coordinate.

Example:
-



Syntax:

int Area::ysize;

Description:

The area's length in y-direction (height).

Remarks:

Multiply this value by 5 to get the area's actual height.

Example:
-
Muddy Waters is offline  
Thanks
4 Users
Old 03/15/2011, 01:07   #4
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
function FileOpen()



Syntax:

File FileOpen(string path, int mode);

Description:

Returns File object handle for the file at the specified path.

Possible values for mode:

0 - Read
1 - Overwrite
2 - Append/Read

Remarks:


Returns null if the file could not be opened.
path is relative, the root is the scripts folder.

Example:
Code:
var _fhandle = FileOpen("MyTest.txt", 1); // Open a File "MyTest.txt" in the scripts folder, create it if it doesn't exist

if(_fhandle)
{
    _fhandle.WriteLine("My foo file"); // Write a line, overwriting the file's previous content
    _fhandle.Close(); // Close the file handle
}
Muddy Waters is offline  
Thanks
5 Users
Old 03/16/2011, 13:04   #5
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
object me




Properties:

me::account
me::act
me::areaid
me::charloc
me::charname
me::chickenhp
me::chickenmp
me::classid
me::diff
me::gamename
me::gamepassword
me::gameserverip
me::gametype
me::gatewayid
me::gid
me::hpmax
me::hp
me::ingame
me::itemoncursor
me::ladder
me::maxgametime
me::mode
me::mpmax
me::mp
me::name
me::ping
me::playertype
me::playtype
me::quitonhostile
me::realm
me::revealautomap
me::runwalk
me::screensize
me::showenemyonautomap
me::showmissileonautomap
me::type
me::weaponstab
me::x
me::y


Member Functions:

me::Cancel()
me::ClickItem()
me::ClickParty()
me::GetItems()
me::GetMerc()
me::GetMercCost()
me::GetOptimalAttackPos()
me::GetQuest()
me::GetRoom()
me::GetSkill()
me::GetSkillStatus()
me::GetStat()
me::GetState()
me::Repair()
me::SelectNPCMenu()
me::SwapWeapons()
me::TakeWaypoint()
me::UseBelt()


Properties



Syntax:

String me::account;

Description:

The account name of the controlled unit.

Remarks:

-

Example:

-



Syntax:

int me::act;

Description:

The act where the controlled unit is currently located.

Remarks:

-

Example:

-



Syntax:

int me::areaid;

Description:

The id of the area where the controlled unit is currently located.

Possible values:

Remarks:

-

Example:

-



Syntax:

int me::charloc;

Description:

The controlled unit's zero based position on the account.


Remarks:

This value equals the positions that is selected in the characters profile less one.

Example:

-



Syntax:

String me::charname;

Description:

The name of the controlled unit.

Remarks:

Identical to me::name.

Example:

-



Syntax:

int me::chickenhp;

Description:

The chicken threshold for the controlled unit.
If your hit points drop below this value, your character will leave the game.

Remarks:

-

Example:

-



Syntax:

int me::chickenmp

Description:

The chicken threshold for the controlled unit.
If your mana points drop below this value, your character will leave the game.

Remarks:

-

Example:

-



Syntax:

int me::classid;

Description:

The classid represents the character class of the controlled unit.

Possible values:


Remarks:

-

Example:

-



Syntax:

int me::diff;

Description:

The difficulty of the game the character is currently in.

Possible values:
0 - Normal
1 - Nightmare
2 - Hell

Remarks:

-

Example:

-



Syntax:

String me::gamename;

Description:

The name of the game the character is currently in.

Remarks:

After leaving the current game, this value will still hold the name of the game that was just left.
It is not refreshed until the character joins another game.

Example:

-


me::gamepassword

-> Back to Properties <-

Syntax:

String me::gamepassword;

Description:

The password of the game the character is currently in.

Remarks:

After leaving the current game, this value will still hold the password of the game that was just left.
It is not refreshed until the character joins another game.

Example:

-


me::gameserverip

-> Back to Properties <-

Syntax:

String me::gameserverip;

Description:

The IP adress of the current game server.

Remarks:

-

Example:

-



Syntax:

int me::gametype;

Description:

The game type of the controlled unit.

Possible values:
0 - Classic
1 - Expansion

Remarks:

-

Example:

-



Syntax:

int me::gatewayid;

Description:

The ID of your gateway as selected in profile.

Possible Values:
0 - U.S. West
1 - U.S. East
2 - Asia
3 - Europe

Remarks:

-

Example:

-



Syntax:

int me::gid;

Description:

The controlled unit's ID which is unique within a single game.

Remarks:

-

Example:

-



Syntax:

int me::hpmax;

Description:

The maximum number of hit points that the controlled unit can currently have.

Remarks:

-

Example:

-



Syntax:

int me::hp;

Description:

The number of hit points that the controlled unit currently has.

Remarks:

-

Example:

-



Syntax:

bool me::ingame;

Description:

Whether or not the controlled unit is currently in a game.

Remarks:

-

Example:

-


me::itemoncursor

-> Back to Properties <-

Syntax:

bool me::itemoncursor;

Description:

Whether or not the controlled unit is currently carrying an item on cursor.

Remarks:

-

Example:

-



Syntax:

bool me::ladder;

Description:

Whether or not the controlled unit is a ladder character.

Remarks:

-

Example:

-


me::maxgametime

-> Back to Properties <-

Syntax:

int me::maxgametime;

Description:

The maximum number of seconds for which the controlled unit stays in a single game.

Remarks:

If the actual gametime exceeds the maximum gametime, the controlled unit will exit the game.
Set to 0 never to leave a game.

Example:

-



Syntax:

int me::mode;

Description:

The mode of the controlled unit.

Possible Values:

Remarks:

-

Example:

-



Syntax:

int me::mpmax;

Description:

The maximum number of mana points that the controlled unit can currently have.

Remarks:

-

Example:

-



Syntax:

int me::mp;

Description:

The number of mana points that the controlled unit currently has.

Remarks:

-

Example:

-



Syntax:

String me::name;

Description:

The name of the controlled unit.

Remarks:

Identical to me::charname.

Example:

-



Syntax:

int me::ping;

Description:

Your current ping in ms.

Remarks:

-

Example:

-



Syntax:

bool me::playertype;

Description:

Whether or not the controlled unit is a hardcore character.

Remarks:

-

Example:

-



Syntax:

int me::playtype;

Description:

Determines whether the controlled unit is a single player or battle net character.

Possible values:
0 - Single Player
1 - Battle Net

Remarks:

-

Example:

-


me::quitonhostile

-> Back to Properties <-

Syntax:

bool me::quitonhostile;

Description:

Whether or not the controlled unit is supposed to exit the game when another player expresses hostility.

Remarks:

-

Example:

-



Syntax:

String me::realmshort;

Description:

The name of the realm that the controlled unit is currently logged onto.

Possible Values:
"USWest"
"USEast"
"Asia"
"Europe"

Remarks:

Identical to me::realm.

Example:

-



Syntax:

String me::realm;

Description:

The name of the realm that the controlled unit is currently logged onto.

Possible Values:
"USWest"
"USEast"
"Asia"
"Europe"

Remarks:

Identical to me::realmshort.

Example:

-


me::revealautomap

-> Back to Properties <-

Syntax:

bool me::revealautomap;

Description:

Whether or not the automap is revealed.

Remarks:

-

Example:

-



Syntax:

int me::runwalk;

Description:

Represents the status of the always run toggle.

Possible values:
0 - Walk
1 - Always run

Remarks:

-

Example:

-



Syntax:

int me::screensize;

Description:

Represents the current screensize.

Possible values:
0 - 640x480
2 - 800x600

Remarks:

-

Example:

-


me::showenemyonautomap

-> Back to Properties <-

Syntax:

bool me::showenemyonautomap;

Description:

Whether or not enemies are displayed on automap.

Remarks:

-

Example:

-


me::showmissileonautomap

-> Back toProperties <-

Syntax:

bool me::showmissileonautomap;

Description:

Whether or not missles (both friendly and hostile) are displayed on automap.

Remarks:

-

Example:

-



Syntax:

int me::type;

Description:

The unit type of the controlled unit.

Remarks:

Can be treated as constant, because the unit type of me is always 0 (Player).

Example:

-



Syntax:

int me::weaponstab;

Description:

The ID of the Slot currently selected.

Possible values:
0 - Slot I
1 - Slot II

Remarks:

-

Example:

-



Syntax:

int me::x;

Description:

The x-coordinate of the controlled unit's current position.

Remarks:

-

Example:

Code:
Print([COLOR=Gray]"My current position is ("[/COLOR] + me.x + [COLOR=Gray]"|"[/COLOR] + me.y + [COLOR=Gray]")"[/COLOR]);


Syntax:

int me::y;

Description:

The y-coordinate of the controlled unit's current position.

Remarks:

-

Example:

Code:
Print([COLOR=Gray]"My current position is ("[/COLOR] + me.x + [COLOR=Gray]"|"[/COLOR] + me.y + [COLOR=Gray]")"[/COLOR]);
Member Functions



Syntax:

bool me::Cancel(int mode);

Description:

Cancels dialogs and interactions.

mode
0 - Cancel all interactions
1 - Cancel current interaction

Remarks:

-

Example:

Code:
SetUIState([COLOR=Red]0x01[/COLOR], [B][I][COLOR=Navy]true[/COLOR][/I][/B]); [COLOR=Green]// Open inventory[/COLOR]

me.Cancel([COLOR=Red]1[/COLOR]); [COLOR=Green]// Close inventory[/COLOR]


Syntax:

[1] bool me::ClickItem(int mode, Unit item);
[2] bool me::ClickItem(int mode, int x, int y, int loc);
[3] bool me::ClickItem(int itemloc);

Description:

Clicks on an item at a given location.

mode
0 - Left Click
1 - Right Click
2 - Left Click + Shift
3 - Right Click + Shift

item
The item Unit to click on.

x
The x-coordinate at the specified location.

y
The y-coordinate at the specified location.

loc
The location of the item.

0 - Inventory
2 - Trade Window
3 - Cube
4 - Stash
5 - Belt

itemloc
The location of an equipped item.

1 - Head
2 - Neck
3 - Torso
4 - Left Weapon
5 - Right Weapon
6 - Left Ring
7 - Right Ring
8 - Belt
9 - Feet
10 - Hands

Remarks:

Overloading [2] will only work, if me.itemoncursor is true.

Example:

Code:
[COLOR=Green]// Pick up our armor[/COLOR]
SetUIState([COLOR=Red]0x01[/COLOR], [B][I][COLOR=Navy]true[/COLOR][/I][/B]); [COLOR=Green]// Open inventory[/COLOR]

me.ClickItem([COLOR=Red]3[/COLOR]); [COLOR=Green]// Click on our armor[/COLOR]

[COLOR=Green]// Pick up our cube and place it somewhere else (assuming the cube is in our inventory and there is sufficient room at the target position)[/COLOR]
[B][I][COLOR=Navy]var[/COLOR][/I][/B] i;
[B][I][COLOR=Navy]var[/COLOR][/I][/B] _cube = me.GetItems([COLOR=Red]549[/COLOR]);

SetUIState([COLOR=Red]0x01[/COLOR], [B][I][COLOR=Navy]true[/COLOR][/I][/B]); [COLOR=Green]// Open inventory[/COLOR]

[B][I][COLOR=Navy]if[/COLOR][/I][/B](_cube.length > [COLOR=Red]0[/COLOR] && _cube[[COLOR=Red]0[/COLOR]])
{
    [B][I][COLOR=Navy]for[/COLOR][/I][/B](i = [COLOR=Red]0[/COLOR]; i < [COLOR=Red]5[/COLOR]; i++)
    {
        me.ClickItem([COLOR=Red]0[/COLOR], _cube[[COLOR=Red]0[/COLOR]]); [COLOR=Green]// Left click on our cube[/COLOR]
        
        Delay([COLOR=Red]500[/COLOR]);
        
        [B][I][COLOR=Navy]if[/COLOR][/I][/B](me.itemoncursor)
            [B][I][COLOR=Navy]break[/COLOR][/I][/B];
    }
}

[B][I][COLOR=Navy]if[/COLOR][/I][/B](i < [COLOR=Red]5[/COLOR])
{
    [B][I][COLOR=Navy]for[/COLOR][/I][/B](i = [COLOR=Red]0[/COLOR]; i < [COLOR=Red]5[/COLOR]; i++)
    {
        me.ClickItem([COLOR=Red]0[/COLOR], [COLOR=Red]0[/COLOR], [COLOR=Red]0[/COLOR], [COLOR=Red]0[/COLOR]); [COLOR=Green]// Left click at the upper left corner of our inventory[/COLOR]
        
        Delay([COLOR=Red]500[/COLOR]);
        
        [B][I][COLOR=Navy]if[/COLOR][/I][/B](!me.itemoncursor)
            [B][I][COLOR=Navy]break[/COLOR][/I][/B];
    }
}
Muddy Waters is offline  
Thanks
4 Users
Reply


Similar Threads Similar Threads
My Reference For Cheats
02/23/2011 - Facebook - 0 Replies
The Website Which Gives/Shares To Me New,Fresh,100% Working Cheats Is facebookgamestricks.tk Visit The Page And See More Cheats Up Everyday There Are 5 Cheats Fresh Please Cooperate
[Guide] A Simple Silkroad Proxy Reference
08/04/2010 - SRO Coding Corner - 17 Replies
This guide is similar to to my Loader/Injected DLL guide. It's a complete project, but by itself, it is not enough to fully utilize at this stage. However, there is so much to this topic that I have to break down everything into different parts first. This guide will be the first in a small part series that shows how a Silkroad proxy is made. Future guides will complete the project by showing how to do the hook for a client, as well as a simple clientless that uses the proxy. Right now, the...
just a reference
11/26/2008 - Dekaron Exploits, Hacks, Bots, Tools & Macros - 0 Replies
havnt been on for some time i dont know if its any help at all this is an old sheet i used to use to find things quicker with winhex though id post it :) If someone else has posted it im sorry in advance :handsdown: the way i use it is simple just say i wanted to find a Great mana potion all i would do is click the search tab in winhex then find text then enter 3806 then it should be the first item that pops up with a line that looks like 3806,Great Mana...
2nd rb quest quick reference
01/05/2007 - CO2 Guides & Templates - 10 Replies
i know there have been a few of these but i see people constantly asking, so here's just a quick referance of where lords and special mobs can be found in 2nd rb quest. hope it helps. (i used shodowHackers guide to help me make this)



All times are GMT +1. The time now is 03:00.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.