Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • AutoScapeM: Join autoscape,0rg fun events daily for infernal mystery boxes only server with Infernal Twisted Bow
      September 19, 2019, 11:57:33 PM
    • AutoScapeM: Join autoscape,0rg fun events daily for infernal mystery boxes only server with Infernal Twisted Bow
      September 19, 2019, 11:57:30 PM
    • AutoScapeM: Join autoscape,0rg fun events daily for infernal mystery boxes only server with Infernal Twisted Bow
      September 19, 2019, 11:57:25 PM
    • AutoScapeM: Join autoscape,0rg fun events daily for infernal mystery boxes only server with Infernal Twisted Bow
      September 19, 2019, 11:57:19 PM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 19, 2019, 12:36:06 PM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 19, 2019, 12:35:49 PM
    • Codar: Come join us while we're fresh we're growing fast!! @ [link]
      September 18, 2019, 09:30:25 PM
    • Codar: New RSPS come check us out! @ [link]
      September 18, 2019, 04:07:24 AM
    • Codar: Released a new server come check us out! @ [link]
      September 18, 2019, 02:08:23 AM
    • ragnoroker: RuneGuild will be hosting some tournaments later to win some mystery boxes, join here : [link]
      September 16, 2019, 09:50:10 AM
    • calemx: death's-server has officially been released, come check us out  - [link]
      September 13, 2019, 04:14:21 AM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 12, 2019, 12:26:40 PM
    • cbrophy: would my account from 2013 work?
      September 12, 2019, 05:04:43 AM
    • ragnoroker: RuneGuild has officially been released, come check us out - [link]
      September 11, 2019, 11:26:35 AM
    • ragnoroker: RuneGuild has officially been released, come check us out - [link]
      September 11, 2019, 11:26:31 AM
    • ragnoroker: RuneGuild is due to be released tomorrow! First few players will recieve some goodies. Sign up on our website [link] Join our discord for updates [link]
      September 07, 2019, 07:43:28 PM
    • ragnoroker: RuneGuild is due to be released tomorrow! First few players will recieve some goodies. Sign up on our website [link] Join our discord for updates [link]
      September 07, 2019, 07:42:59 PM
    • ChrisMeadows: Yo, what's the forum's discord?
      September 04, 2019, 08:33:06 PM
    • newerarsps: i cannot register to rsps list anyone can help?
      September 01, 2019, 11:24:00 PM
    • PavSwag: Date Registered: July 03, 2012, 03:54:45 PM Think im just as good vet as u man, + I have over 80B in rs3 think im good on anyones 100k ass lookin bank b oi
      August 27, 2019, 10:48:09 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