10-12-2004, 06:50 PM
Basic Information:
Packets - A piece of information sent to and from the server.
Byte - A packet, "XX" (2) is referred as a byte.
Word - A packet, "XXXX" (4), a Word is 2 bytes.
DWORD A packet, "XXXXXXXX" ( a DWORD is 4 bytes and 2 words, this is the packet most commenly used for sending packets, (ids, if packets, etc)
Flags - Very important and useful when using "if" commands.
Comments - I probably wont be using them because Ill have the help information somewhere near it, to use the Comment trigger you type "//" then the msg - Example // Welcome to D2Hackit Module Maker.
Thats about it. lol..
First off, ~!ALL!~ D2Hackit modules use the "Source\ClientCore.cpp", I dont have the link from it, but when Starfish reads this sometime.. He'll link you .. To include ClientCore into your d2hackit files, allowing you to use the custom made commands you type.
Code:
#include "Directory\Source\ClientCore.cpp" // {with the ""}
This code goes in all of your d2 hackit modules, at the beginning of all modules. My directory is "Source\ClientCore.cpp" which means your text written CPP {C++} files are saved in the same directory as Source\ClientCore.
After that, if you dont want commands in your module, so that when you load your modules it will automatically do the shit you would put:
Code:
MODULECOMMANDSTRUCT ModuleCommands[]=
{
{NULL}
};
ModuleCommandStruct is what sets up the commands in d2hackit, such as .module 'start' / .module 'go' / .module 'stop' / etc, {NULL} means end of commands, Since there are no commands in this program you would automatically put {NULL} after MODULECOMMANDSTRUCT ModuleCommands[]= {
To use commands, ~After~ #include "Directory\Source\ClientCore.cpp"
Under it you would type
Code:
BOOL PRIVATE OnGameCommand{commandname}(char** argv, int argc); { with ";" and no {} and OnGameCommand, Example: BOOL PRIVATE OnGameCommandEnd(char** argv, int argc); }
You would make one of those for each command you want, all of them have different names, the names of them do not matter, it will not be viewed by the users.
After that, for the MODULECOMMANDSTRUCT ModuleCommands[]=, you would put:
Code:
MODULECOMMANDSTRUCT ModuleCommands[]=
{
{
"help",
OnGameCommandHelp,
},
//You do not have to setup OnGameCommandHelp, its already setup without needing to do it, for the rest of the commands you will though.
{
"end",
OnGameCommandEnd,
},
// The "end," is what they view when they type .module help, the OnGameCommandEnd is setup by you which is displayed above.
{NULL}
};
//Those two commands end the commands, to add more commands it would look something like this:
{
"commandname",
OnGameCommandName,
},
{
"commandname",
OnGameCommandName,
},
{NULL}
};
//No two OnGameCommandNames can be used twice, the same for flags/packets, once again, the {NULL} }; ends the command list.
But, AFTER 'BOOLing' the commands and AFTER #include "Directory\Source\ClientCore.cpp", BEFORE MODULECOMMANDSTRUCT, comes the ClientInfo, this is the information displayed when you load the module.
Code:
CLIENTINFO
1,0,
(
"Author", // (With The "" and the , { What is typed into this box will be displayed as 'Module' was created by "Author" })
"", // (Leave blank, useless, with the "" and the ,)
"ModuleName", // (With the "" and the , Same thing as the "Author" part that was displayed above, just with the 'Module' part, not "Author"
"" // ( Leave blank, useless, with the "" and no , )
)
// The ) ends the clientinfo
After this comes the module command struct, after all of that, it should look something like this:
Code:
#include "Source\Clientcore.cpp"
BOOL PRIVATE OnGameCommandStart(char** argv, int argc);
CLIENTINFO
(
1,0,
"RiZaeL",
"",
"Funny",
""
)
MODULECOMMANDSTRUCT ModuleCommands[]=
{
{
"help",
OnGameCommandHelp,
"Displays Help Text"
},
{
"start",
OnGameCommandStart,
"Starts Module"
},
{NULL}
};
Usually it would have your own settings, but overall, it would look like that.
After all of that, would come up the ClientStart, which would do a list of chosen commands when the module is loaded.
Code:
BOOL EXPORT OnClientStart()
{
//Setup your commands here, to display a clientside message:
server->GamePrintInfo("msg"); // The ; ends the command
return TRUE; //Ends the ClientStart module, you could add more information if you want, but in the end, thats what would end it.
} // Also that..... :p
To have it do a list of commands when the module is unloaded:
Code:
BOOL EXPORT OnClientStop()
{
server->GamePrintInfo("you exited the module"); // Just a message, customize it yourself.
returns TRUE; //Ends the ClientStop
} // That too
To do DWORD If packets, you would use something like this:
Code:
DWORD EXPORT OnGamePacketBeforeSent(BYTE* aPacket, DWORD aLen) // Sets up the aPacket and the ending of the command, the aLen (you'll see))
{
if ( aPacket[0] == 0x03 ) // Meaning, if the packet {03} has happened, begin doing commands, packet 03 is the "run" packet.
{
server->GameCommandLine("say hi"); //GameCommandLine is a thing which will allow you to use built in d2hackit commands, without the .)
} // Ends the If statement
return aLen;
} // Ends Packet Sniffing
Ummm, I think that explained the basics, if you have any questions or want more information on something post here.
Hopefully someone will sticky this
Packets - A piece of information sent to and from the server.
Byte - A packet, "XX" (2) is referred as a byte.
Word - A packet, "XXXX" (4), a Word is 2 bytes.
DWORD A packet, "XXXXXXXX" ( a DWORD is 4 bytes and 2 words, this is the packet most commenly used for sending packets, (ids, if packets, etc)
Flags - Very important and useful when using "if" commands.
Comments - I probably wont be using them because Ill have the help information somewhere near it, to use the Comment trigger you type "//" then the msg - Example // Welcome to D2Hackit Module Maker.
Thats about it. lol..
First off, ~!ALL!~ D2Hackit modules use the "Source\ClientCore.cpp", I dont have the link from it, but when Starfish reads this sometime.. He'll link you .. To include ClientCore into your d2hackit files, allowing you to use the custom made commands you type.
Code:
#include "Directory\Source\ClientCore.cpp" // {with the ""}
This code goes in all of your d2 hackit modules, at the beginning of all modules. My directory is "Source\ClientCore.cpp" which means your text written CPP {C++} files are saved in the same directory as Source\ClientCore.
After that, if you dont want commands in your module, so that when you load your modules it will automatically do the shit you would put:
Code:
MODULECOMMANDSTRUCT ModuleCommands[]=
{
{NULL}
};
ModuleCommandStruct is what sets up the commands in d2hackit, such as .module 'start' / .module 'go' / .module 'stop' / etc, {NULL} means end of commands, Since there are no commands in this program you would automatically put {NULL} after MODULECOMMANDSTRUCT ModuleCommands[]= {
To use commands, ~After~ #include "Directory\Source\ClientCore.cpp"
Under it you would type
Code:
BOOL PRIVATE OnGameCommand{commandname}(char** argv, int argc); { with ";" and no {} and OnGameCommand, Example: BOOL PRIVATE OnGameCommandEnd(char** argv, int argc); }
You would make one of those for each command you want, all of them have different names, the names of them do not matter, it will not be viewed by the users.
After that, for the MODULECOMMANDSTRUCT ModuleCommands[]=, you would put:
Code:
MODULECOMMANDSTRUCT ModuleCommands[]=
{
{
"help",
OnGameCommandHelp,
},
//You do not have to setup OnGameCommandHelp, its already setup without needing to do it, for the rest of the commands you will though.
{
"end",
OnGameCommandEnd,
},
// The "end," is what they view when they type .module help, the OnGameCommandEnd is setup by you which is displayed above.
{NULL}
};
//Those two commands end the commands, to add more commands it would look something like this:
{
"commandname",
OnGameCommandName,
},
{
"commandname",
OnGameCommandName,
},
{NULL}
};
//No two OnGameCommandNames can be used twice, the same for flags/packets, once again, the {NULL} }; ends the command list.
But, AFTER 'BOOLing' the commands and AFTER #include "Directory\Source\ClientCore.cpp", BEFORE MODULECOMMANDSTRUCT, comes the ClientInfo, this is the information displayed when you load the module.
Code:
CLIENTINFO
1,0,
(
"Author", // (With The "" and the , { What is typed into this box will be displayed as 'Module' was created by "Author" })
"", // (Leave blank, useless, with the "" and the ,)
"ModuleName", // (With the "" and the , Same thing as the "Author" part that was displayed above, just with the 'Module' part, not "Author"
"" // ( Leave blank, useless, with the "" and no , )
)
// The ) ends the clientinfo
After this comes the module command struct, after all of that, it should look something like this:
Code:
#include "Source\Clientcore.cpp"
BOOL PRIVATE OnGameCommandStart(char** argv, int argc);
CLIENTINFO
(
1,0,
"RiZaeL",
"",
"Funny",
""
)
MODULECOMMANDSTRUCT ModuleCommands[]=
{
{
"help",
OnGameCommandHelp,
"Displays Help Text"
},
{
"start",
OnGameCommandStart,
"Starts Module"
},
{NULL}
};
Usually it would have your own settings, but overall, it would look like that.
After all of that, would come up the ClientStart, which would do a list of chosen commands when the module is loaded.
Code:
BOOL EXPORT OnClientStart()
{
//Setup your commands here, to display a clientside message:
server->GamePrintInfo("msg"); // The ; ends the command
return TRUE; //Ends the ClientStart module, you could add more information if you want, but in the end, thats what would end it.
} // Also that..... :p
To have it do a list of commands when the module is unloaded:
Code:
BOOL EXPORT OnClientStop()
{
server->GamePrintInfo("you exited the module"); // Just a message, customize it yourself.
returns TRUE; //Ends the ClientStop
} // That too
![[Image: icon_razz.gif]](http://gspost.net/hackergod71/images/smiles/icon_razz.gif)
To do DWORD If packets, you would use something like this:
Code:
DWORD EXPORT OnGamePacketBeforeSent(BYTE* aPacket, DWORD aLen) // Sets up the aPacket and the ending of the command, the aLen (you'll see))
{
if ( aPacket[0] == 0x03 ) // Meaning, if the packet {03} has happened, begin doing commands, packet 03 is the "run" packet.
{
server->GameCommandLine("say hi"); //GameCommandLine is a thing which will allow you to use built in d2hackit commands, without the .)
} // Ends the If statement
return aLen;
} // Ends Packet Sniffing
Ummm, I think that explained the basics, if you have any questions or want more information on something post here.
Hopefully someone will sticky this
[SIGPIC]http://yfrog.com/mhskidudecopyg[/SIGPIC]