Results 1 to 9 of 9
  1. #1
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish

    Hack Client Coding - Handling Hacks/Modules

    Since no-one has posted anything about minecraft clients recently, I thought why not just keep some new people refreshed on coding a client more efficiently..

    So we have our client set up, everything works, it loads. Yey.

    Now we want to add in our modules, hacks, whatever you want to call them.

    So lets create a basic template for our hacks. Lets call it a Module.
    This module will contain some of the vital methods we would want our hacks to have. These could range from their key bind, name, to things like onClick methods or anything else you would want.

    So something like that would look like this:

    Code:
    public class Module
    {
        private String name;
        private int key;
    
        public Module(String name, int key)
        {
            this.name = name;
            this.key = key;
        }
    
        public void onEnable()
        {
        }
    
        public void onDisable()
        {
        }
    }
    And everyone has probably seen these everywhere in the tutorials. Now what a smart thing to do would be is to use the Java language to its fullest and use what it gives us.

    So why not create a handler for the hacks. This handler would have an array list which would hold modules.
    Code:
    private ArrayList<Module> modules;
    Then we would initialize the arraylist to a new arraylist. Afterwards, we want to add every hack into the array list.
    Now the fun part is getting them to work.
    Java provides a really useful loop called the for loop which, when used with arrays can be very very very useful.

    So why not create one?

    Code:
    for(Module m : modules)
    {
        if(ck.checkKey(m.getKey()))
        {
            m.onEnable(); //Or just create a toggle for this
        }
    }
    So if we write that in pseudocode,

    Code:
    For every Module (which we call m) in the modules array list, do the following :
    check if the key matches that modules key. If it does then proceed to enable method of the module.
    So now it gives more organization to the client, instead of creating all of the different methods for every hack.

    This was just a refresher for a client coding. If you have any questions just ask? I guess..

  2. #2
    LordPankake's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    1,010
    Reputation
    260
    Thanks
    2,466
    My Mood
    Angry
    Or you could just copy what Minecraft does

  3. #3
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    Quote Originally Posted by LordPankake View Post
    Or you could just copy what Minecraft does
    Or that too :>

  4. #4
    Not2EXcEL's Avatar
    Join Date
    Feb 2014
    Gender
    male
    Posts
    22
    Reputation
    10
    Thanks
    5
    My Mood
    Stressed
    pls learn2inheritance

    also iterating an array is so much slower than just getting from a map

  5. #5
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    Quote Originally Posted by Not2EXcEL View Post
    pls learn2inheritance

    also iterating an array is so much slower than just getting from a map
    Either way people starting out dont have a clue to what they are doing and using hashmaps would skip a lot of basic shit.. Iteration of array speed depends on how fast your computer can process data and thats not really a problem for me But I see what you are saying

  6. #6
    godshawk's Avatar
    Join Date
    Mar 2013
    Gender
    female
    Location
    root@google ~#
    Posts
    90
    Reputation
    14
    Thanks
    134
    My Mood
    Crappy
    Quote Originally Posted by Wampwire View Post
    Either way people starting out dont have a clue to what they are doing
    And you don't see a problem with them not trying to learn the language first? ;D

    PM me if you need something.

    DOGE: DLunanNyoE7wmiiKQMVXpSxcQag3eN7kB5

  7. #7
    Not2EXcEL's Avatar
    Join Date
    Feb 2014
    Gender
    male
    Posts
    22
    Reputation
    10
    Thanks
    5
    My Mood
    Stressed
    Quote Originally Posted by Wampwire View Post
    Either way people starting out dont have a clue to what they are doing and using hashmaps would skip a lot of basic shit.. Iteration of array speed depends on how fast your computer can process data and thats not really a problem for me But I see what you are saying
    No getting from a hashmap is faster than iterating over unecessary methods that will just return after an if statement. Too many calls for no absolute reason. Its good programming practice as well as reduces overhead leaving room for more overhead for other things if you absolutely need it.

  8. #8
    Wampwire's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    United Kingdom of Tea
    Posts
    227
    Reputation
    10
    Thanks
    22
    My Mood
    Devilish
    Quote Originally Posted by godshawk View Post
    And you don't see a problem with them not trying to learn the language first? ;D
    Tbh, most people just want to make like an amazing client by copying and skidding things.. They dont really care about the programming language itself. They just care about taking something not theirs and call it their own.. v.v Honestly, I dont give a shit. They do what they want, but in the end, they dont get the experience they would if they actually stopped and looked at Java itself.

  9. #9
    Not2EXcEL's Avatar
    Join Date
    Feb 2014
    Gender
    male
    Posts
    22
    Reputation
    10
    Thanks
    5
    My Mood
    Stressed
    Quote Originally Posted by Wampwire View Post
    Tbh, most people just want to make like an amazing client by copying and skidding things.
    That statement is so contradictory.

Similar Threads

  1. [Tutorial] How to code an Minecraft : Hacked Client the OOP Way[Videos]
    By zrbteam in forum Minecraft Tutorials
    Replies: 10
    Last Post: 11-18-2013, 05:22 PM
  2. [Help Request] How to get Online Players (Hacked Client Coding)
    By RandomAmazingGuy in forum Minecraft Help
    Replies: 3
    Last Post: 09-16-2013, 03:25 PM
  3. How to add Codes to a hack client.
    By DinoKyle in forum Realm of the Mad God Help & Requests
    Replies: 0
    Last Post: 10-05-2012, 04:56 PM
  4. [Tutorial] Spam code for eclipse {Minecraft hack client}
    By FrogIsHam in forum Minecraft Tutorials
    Replies: 3
    Last Post: 01-18-2012, 04:54 PM
  5. Got retrail hack? promo code
    By kip1234 in forum WarRock - International Hacks
    Replies: 1
    Last Post: 09-14-2007, 11:28 PM