Welcome to the RaGEZONE - MMORPG development forums.

Advanced Command List

This is a discussion on Advanced Command List within the Habbo Releases forums, part of the Habbo Hotel category; Hello, today I release my advanced command list, which is great to manage commands from a configuration file. I didn't ...

LyncusMU
Results 1 to 9 of 9
  1. #1
    Newbie
    Rank
    Newbie
    Join Date
    Dec 2011
    Posts
    24
    Liked
    1

    Advanced Command List

    Tabo Hotel
    Hello, today I release my advanced command list, which is great to manage commands from a configuration file. I didn't made the configuration loader + adder, but I made the rest.

    First, add this:

    Code:
    static Dictionary<string, string> Commands = new Dictionary<string, string>();
    Second, add some values. Insert into the first string the name of the command the user must type. Insert into the second string the name of the method/void to invoke.

    Third, make a new void (with parameter 'string Input') and add:
    Code:
                if (Commands.ContainsKey(Input))
                {
                    Type mType = typeof(Programma);
                    string Method = Commands[Input];
                    mType.GetMethod(Method).Invoke(null, null);
                }
                else
                {
                    Console.WriteLine("Sorry, the command {0} isn't found in the dictionary.", Input);
                }
    Fourth, in your main bootup add this: (Program.cs Main void)
    Code:
                while (true)
                {
                    NAME OF YOUR METHOD(Console.ReadLine());
                }
    It works :)
    I'll make the configuration adder in a few minutes and will release it.

  2. HostKey.com: Unmetered Dedicated servers in the Netherlands
  3. #2
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Aug 2011
    Location
    England Coder<3
    Posts
    525
    Liked
    104

    Re: Advanced Command List

    Now look if someone says ":)" they get an error saying "Sorry, the command ) isn't found in the dictionary."

  4. #3
    Newbie
    Rank
    Newbie
    Join Date
    Dec 2011
    Posts
    24
    Liked
    1

    Re: Advanced Command List

    Quote Originally Posted by Divide View Post
    Now look if someone says ":)" they get an error saying "Sorry, the command ) isn't found in the dictionary."
    Yes absolute

  5. #4
    Habbo Section.
    Rank
    Subscriber
    Join Date
    Oct 2011
    Location
    New York
    Posts
    1,879
    Liked
    410

    Re: Advanced Command List

    This is pretty nice, good release.

  6. #5
    Azure subscription
    Rank
    Subscriber
    Join Date
    Dec 2011
    Location
    єαятн
    Posts
    1,731
    Liked
    263

    Re: Advanced Command List

    This is okay, not 100% good, but it's okay

  7. #6
    Newbie
    Rank
    Newbie
    Join Date
    Dec 2011
    Posts
    24
    Liked
    1

    Re: Advanced Command List

    Quote Originally Posted by MyKi View Post
    This is okay, not 100% good, but it's okay
    I have an command loader from file, but you still need to make your own voids.

  8. #7
    Now 35% cooler!
    Rank
    Alpha Member
    Join Date
    Oct 2008
    Location
    United Kingdom
    Posts
    2,071
    Liked
    353

    Re: Advanced Command List

    I don't get it to be honest...

  9. #8
    Newbie
    Rank
    Newbie
    Join Date
    Dec 2011
    Posts
    24
    Liked
    1

    Re: Advanced Command List

    Quote Originally Posted by PowahAlert View Post
    I don't get it to be honest...
    It rarely search for the inputted command, if it's in the dictionary, it'll search for the method (void, the value) and will invoke it.

  10. #9
    /title
    Rank
    Member +
    Join Date
    Mar 2011
    Posts
    1,034
    Liked
    146

    Re: Advanced Command List

    This is perfect. Thanks.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •