Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ragnoroker: Join PoonScape Today - Brand new server - Great eco - Active community [link]
      June 16, 2019, 12:08:41 PM
    • ragnoroker: Join PoonScape Today - Brand new server - Great eco - Active community [link]
      June 16, 2019, 12:08:22 PM
    • Krackkid: *clap*
      June 16, 2019, 11:04:14 AM
    • Krackkid: *attempts to start slow clap*
      June 16, 2019, 11:04:10 AM
    • Krackkid: *coughs slowly*
      June 16, 2019, 11:04:01 AM
    • PavSwag: TRY AUTOSCAPE,ORG why? We have RAIDS, Oldschool bosses and items, Infernal Scythe of Vitur. AFK skilling
      June 10, 2019, 04:47:23 AM
    • baldblacknan: Join the #1 custom rsps BrutalPS we are in beta phase, join now to get a head start!
      June 09, 2019, 09:04:25 PM
    • baldblacknan:[link]
      June 09, 2019, 09:04:03 PM
    • ragnoroker: Join PoonScape Today - Brand new server - Great eco - Active community - [link]
      June 08, 2019, 08:23:14 AM
    • drubrkletern: qweyretsyq34rq4ty
      June 05, 2019, 10:33:34 PM
    • W: ?
      June 05, 2019, 07:56:03 PM
    • ragnoroker: Join PoonScape Today - Brand new server - Released raids 2 yesterday :)[link]
      June 03, 2019, 05:40:35 PM
    • PavSwag: Try AutoScape,0rg Way better server OSRS loading raids
      June 03, 2019, 12:50:04 AM
    • PavSwag: AutoScape,org Bringing Oldschool RuneScape back to life with fast XP easy access to bosses and a wide variety of items in the economy! DROP PARTY M BOXES
      June 02, 2019, 06:11:38 PM
    • iamcheese1: Already 300+ players waiting for this server starting in 5 days join now: [link]
      June 02, 2019, 01:58:02 PM
    • iamcheese1: New rs private server starting in 5 days, join now and get ahead others: [link]
      June 02, 2019, 01:57:11 PM
    • Vain_: nerds
      June 01, 2019, 01:07:15 PM
    • ragnoroker: PoonScape - Brand New server! Come and try [link]
      May 31, 2019, 10:28:38 AM
    • ragnoroker: PoonScape - Brand New server! Come and try - <link rel="PLAY NOW" href="[link]" />
      May 31, 2019, 10:27:52 AM
    • PavSwag: TRY AUTOSCAPE,0RG FREE ULTRA M BOX WHEN YOU GET A 99 SKILL FOR DONATOR POINTS LOGIN NOW FOR PRIZE
      May 27, 2019, 12:26:22 AM

    Show Posts

    This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


    Messages - xXSh0ckXx

    Pages: [1] 23 ... 5
    1
    Off-Topic (Spam) / goodbye mopar
    « on: May 03, 2019, 11:04:47 AM »
    rip mopar or no car

    = (

    ty for the good old times

    will miss u

    2
    Server Help / Re: 718 Adding Item Level Requirements.
    « on: June 02, 2016, 03:04:12 AM »
    Highly preferred

    ItemDefinitions class, method getWearingSkillRequiriments()
    Code: [Select]
    if(getId() == ####) {
    itemRequiriments.put(Skills.ATTACK, 99);
    }

    Most level requirements are loaded within the cache, so, at its best you'd modify the level requirements in the cache.


    3
    Server Help / Re: Running RSPS on Linux
    « on: June 01, 2016, 09:12:52 AM »
    I'm using Linux to host my RSPS, I work on Linux everyday but can't seem to get my server to run. I don't have a run.bat or anything I run it via eclipse on Windows and compile it with eclipse. It's a 317 PI source
    Did you try googling yet?

    Here is a link which might seem useful for you:
    http://lmgtfy.com/=Running+RSPS+on+Linux

    4
    Server Help / Re: Making pray work
    « on: June 01, 2016, 09:10:12 AM »
    hello like the subject said i need to make my pray work 100% because i press piety and it doesnt want to turn on any idea what could be this? is a 317 server.
    Obviously you don't have the action registered. What base exactly are you using?

    5
    Server Help / Re: Adding ANY Npc in ruse source
    « on: June 01, 2016, 02:32:34 AM »
    I fixed it for him. He forgot a comma right before adding a new json block.

    6
    Server Help / Re: command to reset a variable?
    « on: May 31, 2016, 02:16:53 AM »
    To set the variable, it'd be best that you first looped all online players, and saved each name into a list.

    Then, you would use get the list of files in the character directory:
    Code: Java
    1. File charFolder =newFile("char_path");
    2. File[] characterFiles = charFolder.listFiles();
    And you guessed it, you'd loop through all those, checking that they're not null and they are not in the list of names earlier. If both those conditions are met, you will scan the file (See: Character loading in your server) for the update token, change the value to 1, then write it.
    Stackoverflow | java replace specific string in textfile

    You can also use Apache commons to replace the text:
    Stackoverflow | Find and replace words/lines in a file


    Wouldn't these files get overwritten dependent if the player is logging out? Because upon logging out, the current state of the player (which is the one before you modified the files) gets saved, overwriting the data you modified while the player being logged in.
    Yes, hence why you'd first modify the online accounts, taking note of their names, then modify the offline accounts, and if the filename is one of the online accounts, you'd skip it
    and if the filename is one of the online accounts, you'd skip it<
    Oh, I mis-interpretated that. So you list the names of players being online, modify them from that point on, then loop through the account files, check if any of the account names equal a name in the list, skip it, else modify it too.

    I'd use a Set for this procedure, due to it not allowing duplicate elements.
    No need for that. ArrayList would work just fine. How would you even get a duplicate? It's not like 2 players are going to have the same username.
    Plus, you're just checking the list if it contains it.
    Code: Java
    1. ArrayList<String> playersModified =new ArrayList<String>();
    2. for(Player p : PlayerHandler.players){
    3.      if(p !=null){
    4.           p.setValue(1);
    5.           playersModified.add(p.playerName);
    6.      }
    7. }
    8. File[] dir =newFile("./characters/").listFiles();
    9. for(File f : dir){
    10.      if(f !=null&&!playersModified.contains(f.getName().substring(0, f.getName().indexOf('.'))){
    11.           // parse the file and set the value and save here.
    12.      }
    13. }
    .... I'm not discussing this out anymore, this gets too stupid anyways.

    7
    Web Design/Development / Re: Free website developer
    « on: May 28, 2016, 06:28:20 PM »

    8
    Web Design/Development / Re: Free website developer
    « on: May 27, 2016, 10:02:15 AM »

    9
    Server Help / Re: command to reset a variable?
    « on: May 27, 2016, 02:41:30 AM »
    To set the variable, it'd be best that you first looped all online players, and saved each name into a list.

    Then, you would use get the list of files in the character directory:
    Code: Java
    1. File charFolder =newFile("char_path");
    2. File[] characterFiles = charFolder.listFiles();

    And you guessed it, you'd loop through all those, checking that they're not null and they are not in the list of names earlier. If both those conditions are met, you will scan the file (See: Character loading in your server) for the update token, change the value to 1, then write it.
    Stackoverflow | java replace specific string in textfile

    You can also use Apache commons to replace the text:
    Stackoverflow | Find and replace words/lines in a file


    Wouldn't these files get overwritten dependent if the player is logging out? Because upon logging out, the current state of the player (which is the one before you modified the files) gets saved, overwriting the data you modified while the player being logged in.
    Yes, hence why you'd first modify the online accounts, taking note of their names, then modify the offline accounts, and if the filename is one of the online accounts, you'd skip it
    and if the filename is one of the online accounts, you'd skip it<
    Oh, I mis-interpretated that. So you list the names of players being online, modify them from that point on, then loop through the account files, check if any of the account names equal a name in the list, skip it, else modify it too.

    I'd use a Set for this procedure, due to it not allowing duplicate elements.

    10
    Server Help / Re: kill all NPC's on specific Height lvl?
    « on: May 27, 2016, 02:28:10 AM »
    x-j-k-x and runescape sucks are both right.

    You'll either have to store the npcs in a list/map of some form, or you have to loop the existing array in your npchandler.

    Yes, you can use a variable to declare whether or not the npc is in the instance, but that should already be covered in your PI (The "barrows npc spawn" sets the npc to your pid.. so doing similar to that works). All you'd have to check for is if it's not a summoning npc (if your server has it).

    A quick mock-up of searching through the npcs:
    Code: Java
    1. publicvoid killNpcs(int playerId){
    2.      for(NPC npc : NPCHandler.npcs){
    3.           if(npc !=null&& npc.spawnedBy== playerId){// the npc was spawned by this playerid.
    4.                // kill the npc here.
    5.           }
    6.      }
    7. }
    Note: Variables are assumed.

    Might aswell go with Streams.

    Code: Java
    1. publicvoid killNpcs(){
    2.  NPCHandler.npcs.stream().filter(Objects::nonNull).forEach(npc ->{
    3.    if(npc.spawnedBy== playerId && npc.height== h){//replace h with the height you'd like to check for
    4.     npc.die());
    5.   }
    6.  }
    7. }
    8.  
    ^not sure if the code works correctly, didn't test and I can just assume that NPCHandler.npcs is a List. Perhaps, the NPC will still stay in the List, which could cause problems.

    If you want to know how to cause the NPC to die, take a look into your NPC class / NPC handler. It should be NPC, hence NPC is a child of Entity, and if PI would be atleast in some point good, Entity should abstract that kind of method (maybe called 'die') which get's inherited into NPC. I can't tell tho, get used to the source, would be a solution for you then.
    That won't work. You need to use the arrays class to stream it. And if you're going to filter it, you might as well add the code that's in your if statement in your filter.
    Code: Java
    1.         publicvoid killAll(int index, int height){
    2.                 Arrays.stream(NPCHandler.npcs).filter(n ->(n !=null&& n.spawnedBy== index && n.heightLevel== height))
    3.                                 .forEach(n -> n.kill());
    4.         }

    You also don't need to declare a method to kill the npc. You could just do it right in the forEach:
    Code: Java
    1.  
    2.         publicvoid killAll(int index, int height){
    3.                 Arrays.stream(NPCHandler.npcs).filter(n ->(n !=null&& n.spawnedBy== index && n.heightLevel== height))
    4.                                 .forEach(n ->{
    5.                                         n.HP=0;
    6.                                 });
    7.         }
    8.  
    How wouldn't NPCHandler.npcs#stream work?
    Any kind of List implements Collection, which inherit streaming and parallel-streaming.
    See docs as reference

    https://docs.oracle.com/javase/8/docs/api/java/util/List.html

    And I was stating that I am unsure of the correctness, but it should look something similar to the code I wrote (you wrote it out correctly).

    That put beside, yeah, n.HP = 0; could work too. I can't tell, I already said that he (the Thread operator) should look it up, variable names can differ..

    11
    Server Help / Re: command to reset a variable?
    « on: May 26, 2016, 10:47:32 AM »
    To set the variable, it'd be best that you first looped all online players, and saved each name into a list.

    Then, you would use get the list of files in the character directory:
    Code: Java
    1. File charFolder =newFile("char_path");
    2. File[] characterFiles = charFolder.listFiles();

    And you guessed it, you'd loop through all those, checking that they're not null and they are not in the list of names earlier. If both those conditions are met, you will scan the file (See: Character loading in your server) for the update token, change the value to 1, then write it.
    Stackoverflow | java replace specific string in textfile

    You can also use Apache commons to replace the text:
    Stackoverflow | Find and replace words/lines in a file


    Wouldn't these files get overwritten dependent if the player is logging out? Because upon logging out, the current state of the player (which is the one before you modified the files) gets saved, overwriting the data you modified while the player being logged in.

    12
    Server Help / Re: kill all NPC's on specific Height lvl?
    « on: May 26, 2016, 10:32:03 AM »
    x-j-k-x and runescape sucks are both right.

    You'll either have to store the npcs in a list/map of some form, or you have to loop the existing array in your npchandler.

    Yes, you can use a variable to declare whether or not the npc is in the instance, but that should already be covered in your PI (The "barrows npc spawn" sets the npc to your pid.. so doing similar to that works). All you'd have to check for is if it's not a summoning npc (if your server has it).

    A quick mock-up of searching through the npcs:
    Code: Java
    1. publicvoid killNpcs(int playerId){
    2.      for(NPC npc : NPCHandler.npcs){
    3.           if(npc !=null&& npc.spawnedBy== playerId){// the npc was spawned by this playerid.
    4.                // kill the npc here.
    5.           }
    6.      }
    7. }
    Note: Variables are assumed.

    Might aswell go with Streams.

    Code: Java
    1. publicvoid killNpcs(){
    2.  NPCHandler.npcs.stream().filter(Objects::nonNull).forEach(npc ->{
    3.    if(npc.spawnedBy== playerId && npc.height== h){//replace h with the height you'd like to check for
    4.     npc.die());
    5.   }
    6.  }
    7. }
    8.  
    ^not sure if the code works correctly, didn't test and I can just assume that NPCHandler.npcs is a List. Perhaps, the NPC will still stay in the List, which could cause problems.

    If you want to know how to cause the NPC to die, take a look into your NPC class / NPC handler. It should be NPC, hence NPC is a child of Entity, and if PI would be atleast in some point good, Entity should abstract that kind of method (maybe called 'die') which get's inherited into NPC. I can't tell tho, get used to the source, would be a solution for you then.

    13
    mooo

    14
    Trash Can / Re: moparscape.org ownership change
    « on: May 23, 2016, 06:25:06 AM »
    ggwp mopar rip in peace


    15
    Client Help / Re: client error
    « on: January 07, 2016, 11:06:24 AM »
    Thank you for giving us code, or atleast a snippet of how the error looks like.  :palm:

    16
    Client Help / Re: Cache Downloading bar
    « on: January 07, 2016, 11:04:35 AM »
    The loading bar is not a Sprite (an already made image being placed), but drawn in java. Therefore you can actually modify it in the code. The code is located at the client class. Try looking at a different clients client class and compare it. You'll see the differences.

    The message in the command prompt has nothing to do with the client's message.

    EDIT:
    https://forum.moparscape.org/index.php/topic,673151.0.html/

    I wouldn't even bother answering if posted twice, next time please seek forward to only post it once and I'm sure a moparian will be more than glad to help you out.

    17
    Server Help / Re: Cache Problems! Acheron Source/client/cache!
    « on: January 07, 2016, 09:56:50 AM »
    Paying for help is not allowed in this section.

    "7. Offering a reward for someones help is not allowed, help is free on this community. "

    See here: https://forum.moparscape.org/index.php/topic,331370.0.html/

    None the less, go to your Dropbox download, click and hold on the download button, drag it into the upper bar of your browser (to create a new tab opening the link specified by the button). Copy the link given (at the URL-bar). That'd be your link for downloading the Cache, don't forget the "dl" after the ";. I wouldn't recommend Dropbox tho, because of its deficient bandwith. (Cache downloading will be slow - but works).

    18
    Server Help / Re: Stuck on this variable!
    « on: December 14, 2015, 07:53:10 PM »
    in your method change
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. strBonus = c.playerBonus[10];
    to
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. int strBonus = c.playerBonus[10];

    19
    Games / Re: League of Legends?
    « on: November 02, 2015, 03:23:37 AM »
    Idk in which server I am playing (I think EU WEST), but I am level 15 and maining Yasuo. I got Zed, Yasuo, Sion and that other champ (something with V?) who teleports you behind an enemy with its E (i think it was valon or something like that). Never the less, if anyone's up for playing, add me: HiImSh0ck


    20
    Server Help / Re: [718] Alter Dialogue
    « on: November 02, 2015, 03:17:51 AM »
    I'm horrible at dialogues..so could you guide me in the direction of what I would need to put next?  :|
    Has nothing to do with dialogues, you just didn't understand what I said.

    You either change
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. case1:
    to
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. case -1:
    or you assign a value to the stage field in the start method, which in this case would be 1.
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. stage = 1;

    Pages: [1] 23 ... 5
    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal