Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • iddsyou: great RSPS! [link]  Join us on Discord! [link]  Download: [link]
      October 04, 2020, 03:52:32 AM
    • iddsyou: great RSPS! [link]  Join us on Discord! [link]  Download: [link]
      October 04, 2020, 03:51:57 AM
    • iddsyou: great RSPS! [link]  Join us on Discord! [link]  Download: [link]
      October 04, 2020, 03:51:56 AM
    • iddsyou: great RSPS! [link]  Join us on Discord! [link]  Download: [link]
      October 04, 2020, 03:51:51 AM
    • ragnoroker: Zalcano - Releasing in 4 hours! - Perfect OSRS server - Discord:[link] Website: [link]
      September 18, 2020, 01:00:43 PM
    • ragnoroker: Zalcano - Releasing in 4 hours! - Perfect OSRS server - Discord:[link] Website: [link]
      September 18, 2020, 01:00:38 PM
    • ragnoroker: Zalcano - Releasing in 4 hours! - Perfect OSRS server - Discord:[link] Website: [link]
      September 18, 2020, 01:00:33 PM
    • abtekk: BlazeScape - RSPS Reimagining of 2007! - Launch Tomorrow > www. blazescape .net
      September 18, 2020, 08:10:09 AM
    • no1toldme2: Killerville
      September 07, 2020, 05:18:36 PM
    • Shady Aftermath: Best DreamScape Remake, 2500 Customs! Free Donator!  www. fire-ps .com
      August 28, 2020, 11:53:20 PM
    • Shady Aftermath: FirePS is the best DreamScape Remake www. fire-ps .com
      August 28, 2020, 11:53:05 PM
    • Shady Aftermath: Try FirePS Best Dreamscape remake [link]
      August 28, 2020, 11:52:40 PM
    • Shady Aftermath: Best DreamScape Remake, 2500 Customs! Free Donator! [link]
      August 28, 2020, 11:52:27 PM
    • Shady Aftermath: Best DreamScape Remake, 2500 Customs! Free Donator! [link]
      August 28, 2020, 11:52:24 PM
    • Shady Aftermath: Best DreamScape Remake, 2500 Customs! Free Donator! [link]
      August 28, 2020, 11:52:21 PM
    • Shady Aftermath: Best DreamScape Remake, 2500 Customs! Free Donator! [link]
      August 28, 2020, 11:52:18 PM
    • Shady Aftermath: Best DreamScape Remake, 2500 Customs! Free Donator! [link]
      August 28, 2020, 11:52:15 PM
    • Shady Aftermath: Best DreamScape Remake, 2500 Customs! Free Donator! [link]
      August 28, 2020, 11:52:11 PM
    • Fridder:[link]
      August 19, 2020, 06:17:40 PM
    • tasting scim: feel free to msg me if u know something :D
      August 13, 2020, 03:03:03 PM

    Author Topic: Post your code snippets here! [Updated 08/09/2012]  (Read 167191 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineStrucker

    • Member
    • ****
    • Posts: 2,970
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #780 on: July 04, 2012, 12:19:55 AM »
    reserved*
    « Last Edit: July 04, 2012, 01:51:45 AM by strucker »
    Times flies and im wasting it
    Runescape Gambling

    OfflineScape-JAVA

    • HEy girls
    • Member
    • ****
    • Posts: 5,259
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #781 on: July 04, 2012, 12:22:56 AM »
    The conventions are extremely poor, as well as the documentation it's also extremely hard on the eyes to read. Not only that this is a snippet, not a tutorial.

    OfflineStrucker

    • Member
    • ****
    • Posts: 2,970
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #782 on: July 04, 2012, 12:24:39 AM »
    thanks for criticsm, i'm trying to do my best work
    i tough it wouldn't be a snippet since i explained in code.
    i will make more conventions on further releases.
    Times flies and im wasting it

    OfflineScape-JAVA

    • HEy girls
    • Member
    • ****
    • Posts: 5,259
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #783 on: July 04, 2012, 12:46:21 AM »
    Conventions aren't something you make more of, it's just a good programming habit to get into. It's basically having easy readability, indentation, comments, etc. Just work on them while you're programming. Infact IDE's even auto indent/format your code for you.

    OfflineWhackatre

    • u wan buy dvd?
    • Member
    • ****
    • *
    • Posts: 1,780
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #784 on: July 06, 2012, 07:32:29 PM »
    Half-Assed Runecrafting:

    Code: Java
    1. packagenet.projectrainbow.server.skills;
    2.  
    3. importnet.projectrainbow.server.Client;
    4. importnet.projectrainbow.server.Player;
    5.  
    6. /**
    7.  * RuneCrafting.java
    8.  * @author Whac
    9.  *
    10.  */
    11.  
    12.  
    13. publicclass RuneCrafting {
    14.        
    15.         /**
    16.          * Set the individual speed of this skill. Default: 4
    17.          */
    18.         privatestaticfinalint XP_RATE =12;
    19.        
    20.         /**
    21.          * The ID of essence.
    22.          */
    23.         privatestaticfinalint ESSENCE =1436;
    24.        
    25.         /**
    26.          * An enum of runes.
    27.          */
    28.         publicenum Runes {
    29.                
    30.                 AIR(2478, 1, 35, 556, 11, 22, 33, 44, 55, 66, 77, 88, 99),
    31.                 MIND(2479, 2, 40, 558, 14, 28, 42, 56, 70, 84, 98),
    32.                 WATER(2480, 5, 50, 555, 19, 38, 57, 76, 95),
    33.                 EARTH(2481, 9, 60, 557, 26, 52, 78),
    34.                 FIRE(2482, 14, 70, 554, 35, 70),
    35.                 BODY(2483, 20, 85, 559, 46, 92),
    36.                 COSMIC(2484, 27, 95, 564, 59),
    37.                 CHAOS(2487, 35, 108, 562, 74),
    38.                 NATURE(2486, 44, 150, 561, 91),
    39.                 LAW(2485, 54, 170, 563),
    40.                 DEATH(2488, 65, 200, 560);
    41.                
    42.                 int objID;
    43.                 int level;
    44.                 int experience;
    45.                 int runeID;
    46.                 int[] multiples;
    47.                
    48.                 /**
    49.                  * The parameter order.
    50.                  */
    51.                 finalint OBJ_ID_NUM =0;
    52.                
    53.                 /**
    54.                  * The constructor for this enum.
    55.                  * Uses varargs for multiple rune gains.
    56.                  * @param objID
    57.                  * @param level
    58.                  * @param experience
    59.                  * @param runeID
    60.                  * @param multiples
    61.                  */
    62.                 private Runes(int objID, int level, int experience, int runeID, int... multiples){
    63.                         this.objID= objID;
    64.                         this.level= level;
    65.                         this.experience= experience;
    66.                         this.runeID= runeID;
    67.                         this.multiples= multiples;
    68.                 }
    69.         }
    70.        
    71.         /**
    72.          * Gets a Runes from an object alter ID.
    73.          * Returns null if it does not match.
    74.          * @param objID
    75.          * @return
    76.          */
    77.         publicstatic Runes forID(int objID){
    78.                 for(Runes rune : Runes.values()){
    79.                         if(rune.objID== objID){
    80.                                 return rune;
    81.                         }
    82.                 }
    83.                 returnnull;
    84.         }
    85.        
    86.         /**
    87.          * Runecrafts a rune based on an object ID.
    88.          * @param c
    89.          * @param objID
    90.          */
    91.         publicstaticvoid runecraft(Client c, int objID){
    92.                 int essence = c.amountOfItem(ESSENCE);
    93.                
    94.                 Runes rune = forID(objID);
    95.                
    96.                 /**
    97.                  * If it is not a valid runecrafting alter,
    98.                  * exit out of the method.
    99.                  */
    100.                 if(rune ==null)
    101.                         return;
    102.                
    103.                 /**
    104.                  * Checks the level requirement.
    105.                  */
    106.                 if(c.playerLevel[Player.RUNECRAFTING]< rune.level){
    107.                         c.sM("You do not have enough runecrafting to craft this.");
    108.                         c.sM("You need at least "+ rune.level+" to runecraft this.");
    109.                         return;
    110.                 }
    111.                 /**
    112.                  * Checks if the player has essence.
    113.                  */
    114.                 if(!c.playerHasItem(ESSENCE)){
    115.                         c.sM("You do not have any rune essence to craft.");
    116.                         return;
    117.                 }
    118.                
    119.                 if(rune.multiples!=null){
    120.                         int times = rune.multiples.length;
    121.  
    122.                         for(int i =0; i < times; i++){
    123.                                 if(c.playerLevel[Player.RUNECRAFTING]>= rune.multiples[i]){
    124.                                         essence += c.amountOfItem(ESSENCE);
    125.                                 }
    126.                         }
    127.                        
    128.                         //c.sM("Total Times For Rune: " + times + " - Multiples For You: " + essence);
    129.                 }
    130.                
    131.                 /**
    132.                  * Rids the user of his or her rune essence.
    133.                  */
    134.                 for(int i =0; i <29; i++){
    135.                         c.deleteItem(ESSENCE, c.getItemSlot(ESSENCE), i);
    136.                 }
    137.                
    138.                 /**
    139.                  * Wrapping up.
    140.                  */
    141.                 c.addItem(rune.runeID, essence);
    142.                 c.addSkillXP(rune.experience* essence * XP_RATE, Player.RUNECRAFTING);//yay
    143.                 c.sM("You bind the temple's power into "+ c.getItemName(rune.runeID)+"(s).");
    144.                 c.specGFX(186);
    145.                 c.setAnimation(791);
    146.                 return;
    147.         }
    148. }
    149.  

    First click object:
    Code: Java
    1. RuneCrafting.runecraft(c, objectID);
    2.  
    [20:14:10] <dicklord> your to smart :'( You make botserv bots say something you enjoy and want to go to the boards.

    If you're looking for a supreme text editor for everything look no further than Emacs.

    Offlinea a

    • First Time Poster
    • *
    • Posts: 1
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #785 on: July 07, 2012, 06:06:56 PM »
    Im new to creating RSPS and im currently playing one and wanted to help put woth it. Can anyone send me somewhere where I can find how to add monsters and adding drops to them?

    Thanks,

    A A

    OfflineStrucker

    • Member
    • ****
    • Posts: 2,970
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #786 on: July 08, 2012, 05:06:01 PM »
    Wrong section go to tutorial section and use the search bar
    Times flies and im wasting it

    OfflineJZombie37

    • Member
    • **
    • Posts: 60
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #787 on: July 16, 2012, 03:32:42 PM »
    Matrix [Removing Client Background]

    Alright First open up your cache in Sprite Editor

    Download Link [Sprite Editor] : %20Editor.rar
    ---------------------------------------

    Now just replace these ID's and there you go [I've heard that you need Dkk's Cache Editor] <-- Not 100% sure

    Id's: 3780, 3770, 3772, 3779, 3780, 3782, 3783, 3784, 3785, 8490-8501, 2498 [All known]

    OfflineTiVo

    • Member
    • ***
    • Posts: 214
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #788 on: July 16, 2012, 07:14:08 PM »
    I know this isn't the right section, but I'm not sure where to put it.

    This is basically the whole tutorial island, all you have to do is apply it to dialogues and make a few sendStatements.

    It took me FOREVER, so please comment and tell me if you like it, or if you'll be using it. :)

    http://pastebin.com/VcwmXrrv

    There you go. Enjoy.

    Contains:

    100% correct dialogues for tutorial island
    100% correct tips
    Made for old-school game frame
    « Last Edit: July 16, 2012, 07:20:25 PM by TiVo »

    Offlinewetodded

    • Member
    • ****
    • Posts: 263
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #789 on: July 16, 2012, 07:14:50 PM »
    Dude, you're amazing.

    OfflineTiVo

    • Member
    • ***
    • Posts: 214
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #790 on: July 16, 2012, 07:38:52 PM »
    Dude, you're amazing.

    Thanks.

    Guys, please comment and tell me what you think. Please don't just take it and run.

    OfflineTeam_Rocket

    • Member
    • ****
    • Posts: 3,774
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #791 on: July 16, 2012, 10:45:19 PM »
    File organization and indentation.

    Do you like it now?

    Yeah it's a lot better now, I'm anal retentive about conventions and cleanliness of code :P.

    That's a great habit to have. I wish everyone felt this way.
    I'm done, because you children really are hopeless.

    Offlineinb4aslap

    • Member
    • **
    • Posts: 14
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #792 on: July 17, 2012, 01:28:29 PM »
    Why dont you just make a new Board..


    this here is a useless peice of a thread

    and people wonder why the move to RL

    OfflineWhackatre

    • u wan buy dvd?
    • Member
    • ****
    • *
    • Posts: 1,780
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #793 on: July 17, 2012, 08:30:38 PM »
    Why dont you just make a new Board..


    this here is a useless peice of a thread

    and people wonder why the move to RL

    Well, the idiots might move to RL, which might be beneficial to MSCP.
    Anyways, a new board dedicated to snippets was considered as a suggestion; I'm not sure of its status.
    [20:14:10] <dicklord> your to smart :'( You make botserv bots say something you enjoy and want to go to the boards.

    If you're looking for a supreme text editor for everything look no further than Emacs.

    Offlineinb4aslap

    • Member
    • **
    • Posts: 14
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #794 on: July 18, 2012, 04:38:57 PM »
    Why dont you just make a new Board..


    this here is a useless peice of a thread

    and people wonder why the move to RL

    Well, the idiots might move to RL, which might be beneficial to MSCP.
    Anyways, a new board dedicated to snippets was considered as a suggestion; I'm not sure of its status.

    Its would be X10 more easier for people to search for it.

    Offlineanti man444

    • Member
    • ***
    • Posts: 113
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #795 on: July 19, 2012, 04:42:58 PM »
    So you can finaly play runescape private server on the idevices (iphone (i'm writing this topic with a iphone),ipod touch,ipad

    It's very easy to play

    Things you'll need is:

    1) a Idevice
    2) a jailbroken Idevice (it's possible without jailbreak but then you've to pay for it
    3) if your idevice is jailbroken install install0us
    -->go to cydia then go to manage then sources then edit then add then add this source
     
    Ok now go to search and search for installous 5
    Download it and run it
    When you've run it go to search
    And search for cloudbrowse
    Scroll down and find it so when you found it download it and install then run it and done
    Search for a rsps like 'near realty'  and wait for downloading cache and done enjoy post your probs here
    Ps sorry i cant insert pictures because i'm now on my iphone i'll post it tomorow
    But i'm gonna make now a vid for the tuturial so it's easyer: Done maked the vid
    https://www.youtube.com/watch?v=M8hgxaql-Zc&feature=youtube_gdata_player
    Have enjoy with play server in your bed
    So don't forget to rep++ wil making a tuturial soon for making a rsps on a iphone or ipod touch
    imma pull up in a rari

    OfflineFridder

    • Member
    • ****
    • Posts: 5,108
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #796 on: July 19, 2012, 05:07:40 PM »
    You could also use Teamviewer.
    what the fudge is this shit

    OfflineGuardians

    • Member
    • **
    • Posts: 26
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #797 on: July 19, 2012, 07:19:25 PM »
    You don't always have to play rsps wherever your at  ;D but goodjob

    OfflineFridder

    • Member
    • ****
    • Posts: 5,108
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #798 on: July 19, 2012, 07:54:19 PM »
    This can be done with RuneScape, too, not just private servers. Also, if you want to play RSPS in your bed, you could grab a laptop.
    what the fudge is this shit

    Offlinewildskiller

    • Member
    • ****
    • Posts: 1,436
    • Thanks: +0/-0
      • View Profile
    Re: Post your code snippets here!
    « Reply #799 on: July 20, 2012, 12:50:46 AM »
    I would hate trying to play any MMO from a phone, and I wouldn't necessarily call this a tutorial.

    OT: Omg I had this nasty thought. Fridder's sig, along with his post. Think about it.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal