Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/15/14 in all areas

  1. I agree with this. But honestly, gl calling the police and saying " I got scammed my rsgp". They will literally laugh their balls off.
    4 points
  2. inb4 trolls download a free sms/voip app to bypass this
    3 points
  3. Need to take a piss, may not be back for awhile.
    2 points
  4. The way this works: Win in a few streaks -> Get DDoSed by Amazon D:
    2 points
  5. No, development shouldn't be in the same forum as completed projects.
    2 points
  6. Don't get beaten up on your way to the toilet!
    2 points
  7. The chance of mod mark going on a diet is bigger.
    2 points
  8. This just makes my chances of getting it worse...but thanks.
    2 points
  9. Don't forget Kaley's FUCKING AUTO TYPER.
    2 points
  10. It's easy. Edit: Whoops wrong account.
    2 points
  11. Gratz, didn't know you could get mod in less than 2 months after joining
    2 points
  12. I should totally apply now.
    2 points
  13. I like Nick, but Eliot shoulda been there first...
    2 points
  14. 2 points
  15. Actually I was going to start writing a Node tutorial and try cover everything I possibly can, seeing as most people I try to explain Nodes to seem to get stuck at abstract classes, why use super(), and overriding methods! So expect a Node Tutorial coming very soon!
    2 points
  16. Credits to @Divinity for letting me use his enum as an example Example: (I will be using this enum through out the whole tutorial, the variable will be shorten down to make space). public enum ThievingNPC { MAN("Man", 1), FARMER("Farmer", 10), FEMALE("HAM Female", 15), MALE("HAM Male", 20), HAM_GUARD("HAM Guard", 20), WARRIOR("Al-karid Warrior", 25), ROGUE("Rogue", 32), MASTER_FARMER("Master Farmer", 38), GUARD("Guard", 40), PALADIN("Paladin", 70), GNOME("Gnome", 75), HERO("Hero", 80), ELVE("Elve", 90); private String name; private int lvl; ThievingNPC(String name, int lvl){ this.name = name; this.lvl = lvl; } public String getName(){ return name; } public int getLevel(){ return lvl; } } What’s an Enum? An Enum is a data type, just like an interface and class. Enums and Classes consist of some similar characteristics, for example: constructor and some general methods. But the most unique things about Enums would be that they allow you to pre-define constants, which then allow you to access them at any time. What’s a Data Type? So a Data Types would be consider something like: Int, String, Boolean etc.. So what I’m trying to say, is that your allowed to create methods out of an Enum. You’re allowed to use them, like you would in an argument, constructor, and even a method. Example: public void something(Enum name) { } public EnumName somethingElse() { return enumVariable } Parts of an Enum: (in order) Example: //variables //private fields //Enum constructor //setters & getters methods //your own custom methods How to create an Enum: When you want to create an Enum, you will start off with a modifier (optional). Followed by the key word “enum”, then after follows the name of the Enum. Finally end it with brackets “{ }” Example: public enum ThievingNPC { } Enum Conventions: Naming the Enum: You must capitalize the first letter in every word (no spaces ). Example: //The only reason why my enum is called ThievingNPC, and npc is in all caps is because it is an acronym ThievingEnum YouGetItNow Naming Variables: You must capitalize all letters, and you must replace all spaces with underscores (“_”). Example: ROGUE MASTER_FARMER Adding in variable (use Conventions): This is where the fun begins. Now you are allow to add in as many variables as you want. Just know that after every variable you end it with a coma “,”. But at your last variable it must end in a semicolon “;”. Example: MAN(), HAM_GUARD(); More important info about variables: Once you create your variables, if you decide not to add any predefined constants (hence the infomation in between the parenthesis after the variable name), then you dont need to addin the parenthesis. The parenthesis are meant to help organize what information goes with which variable. Example: (this is part of my Magic Manager snippet) "If you dont understand then dont worry this isnt that important". public static enum Rune { STEAM, MIST, MUD, LAVA, SMOKE, DUST, EARTH, FIRE, WATER, AIR, ASTRAL, BLOOD, BODY, CHAOS, COSMIC, DEATH, LAW, MIND, NATURE, SOUL; @Override public String toString() { return super.name().toLowerCase() +" rune"; } } How to create Constructor: Optional adding a modifier. With Enum you’re not allowed to use the “public” keyword modifier. Since Enum variables are static. Use the Enum name followed by Arguments. Your constructor Argument must match the arguments within the variables. and end with brackets “{ }”. Example: MAN("Man", 1), FARMER("Farmer", 10); ThievingNPC(String name, int lvl) { } What to do within the Constructor: You must first create some private fields. Then make your Constructor argument equal those private fields. Example of the key word this: link Example: public enum ThievingNPC { MAN("Man", 1), FARMER("Farmer", 10); private String name; private int lvl; ThievingNPC(String name, int lvl){ this.name = name; this.lvl = lvl; } } Creating Methods: Since your fields are private you need some sort of way to be able to access the values. So this is where you would create your getter methods. Also any other custom method you would need. Example: public enum ThievingNPC{ MAN("Man", 1), FARMER("Farmer", 10); private String name; private int lvl; ThievingNPC(String name, int lvl){ this.name = name; this.lvl = lvl; } //from here and below are where you put your methods at public String getName(){ return name; } public int getLevel(){ return lvl; } } Some Default Enum Methods & Returns: These are some of the default methods that Enum's come with. There's many more, but these are the important ones, and the ones i like to use . *Format: (method name, return type) //comment if any. values(), Returns: an array of your enum variables. //Static valueOf(String s), Returns: an enum variables. //Static compareTo(E o), Returns: the distance between the two enum variable, using there ordinal(). ordinal(), Returns: the index in of the enum variable. name(), Returns: the exact enum variable name. toString(), Returns: the exact enum variable name. // if toString() isnt overrided. toString(), Returns: what ever you told the method to return. // if toString() is overrided. How to access the Enum and there variables (in order): Start with, the Enum name. followed by, the variable name. then, end with the method. Which returns the method. Example: ThievingNPC.MASTER_FARMER.getLevel(); Returns: 38 End of part one, beginner guide. Link to part two: link not yet ready
    1 point
  17. Damn. That hurts.
    1 point
  18. It's a timer for experience, it will track the experience so you don't have to.
    1 point
  19. So you found it helpful right?
    1 point
  20. its isnt really to special, especially for people who know how to code this. This is really meant for those who have trouble with painting graphic on script. They could use this to study, learn, and experiment.
    1 point
  21. Did i say anything is special? I made it for myself to use and decided to post so other people can also use and it can possibly help new scripters.... fkin anjew
    1 point
  22. Who? Edit: Oh the guy that was here less than 2 months and was trial mod..
    1 point
  23. Regain is also Polish i go crazy on this music
    1 point
  24. If that's the problem then why would you jump straight to reforming the entire scripter ranks? Don't you think it'd be a bit easier to disallow the 'buying of sources' and rather to have a method which proves their knowledge (in scripting)? You're cutting down an already-limited rank that is high in demand and low in supply (quality supply). Without scripters, this site is nothing, so please look at the big picture before you make short-term suggestions such as this.
    1 point
  25. Nice tutorial , I like how you use the pictures it will encourage people to write the code and not c&p
    1 point
  26. 1 point
×
×
  • Create New...