Jump to content

godzskillz

Member
  • Content count

    90
  • Joined

  • Last visited

About godzskillz

  • Rank
    Iron Member
  • Birthday 06/21/1996

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks guys for your answer, would anyone know if there's a tutorial or something I could base off? Because I really have no idea on how to pack a cache with higher revision stuff haha
  2. Hi! As the title say, I'd like to know if it's possible to add, in my case, higher revision features (like 718+++) into a 562 cache? My server is already 562 loading 659. However, what if i'd like to add newer items/bosses from higher revision? I only know bases of java.. but when it's about caches, i'm really lost lol. Thanks in advance for helping out! Have a great day, Alex.
  3. godzskillz

    562 Java 8

    You should use JDK 6 and JRE 6 with 562's.
  4. I got the same, and it's working perfectly! Did you try with another cache for fun?
  5. [quote name='Stacx']My solution uses a string either ways... But the class does not know which player instance "player" is, Java does not allow you to do that in a field. If the player instance was a field in the bank class, it'd be another story. But since the player instance is only passed to the methods via parameters, you cannot use a parameter inside a variable (if it is only passed by with parameters).[/QUOTE] Oh alright! Then i'll use your solution I guess, and do copy paste if i want to change it haha :P Thanks a lot !
  6. This is not what I wanted to do.., Have you ever seen the Bank.java file? There's about 20 lines to change the bank name... Why do copy paste when we can do a String? :P But if my idea can't work with a string.. i'll just make it like that I guess! Thanks :) Edit : Heres my Bank.java. [CODE]package com.rs2hd.model; import com.rs2hd.model.Player; /** * Manages the player bank. * * [MENTION=52317]auth[/MENTION]or Graham */ public class Bank { public static final int SIZE = 500; public String BANK_NAME = "<col=00CCFF>"+player.getDisplayName()+"'s Bank Account</col>"; public Container bank = new Container(SIZE, false); private transient Player player; public int[] tabStartSlot; public void setPlayer(Player player) { this.player = player; if(this.tabStartSlot == null) { this.tabStartSlot = new int[11]; } } public void openBank() { player.getActionSender().sendConfig2(563, 4194304); player.getActionSender().sendConfig2(1248, -2013265920); player.getActionSender().sendString("+BANK_NAME+", 762, 32); player.getActionSender().sendBankOptions(); refresh(); player.getActionSender().sendInterface(762, true); player.getActionSender().sendInventoryInterface(763); } public void refresh() { player.getActionSender().sendItems(-1, 64207, 95, bank); player.getActionSender().sendItems(-1, 64209, 93, player.getInventory().getContainer()); player.getActionSender().sendItems(149, 0, 93, player.getInventory().getContainer()); player.getActionSender().sendString("+BANK_NAME+", 762, 32); player.getActionSender().sendString(bank.getSize() - bank.getFreeSlots() + "", 762, 97); sendTabConfig(); } public Container getContainer() { return bank; } public int getFreeSlots() { return bank.getFreeSlots(); } public Item get(int slot) { return bank.get(slot); } public void set(int slot, Item item) { bank.set(slot, item); } public void bankItem(int slot, int amount) { if (slot < 0 || slot > Inventory.SIZE || amount <= 0) { return; } Item item = player.getInventory().getContainer().get(slot); if (item == null) { return; } if (amount > player.getInventory().getContainer().getNumberOf(item)) { item = new Item(item.getId(), player.getInventory().getContainer() .getNumberOf(item)); } else { item = new Item(item.getId(), amount); } if (player.getInventory().getContainer().contains(item)) { if (item.getDefinition().isNoted()) { item = new Item(item.getId() - 1, item.getAmount()); player.getInventory().deleteItem(item.getId() + 1, item.getAmount()); } else { player.getInventory() .deleteItem(item.getId(), item.getAmount()); } if (bank.containsOne(item)) { for (int i = 0; i < SIZE; i++) { Item bankItem = bank.get(i); if (bankItem == null) { continue; } if (bankItem.getId() == item.getId()) { bank.set(i, null); bank.set(i, new Item(item.getId(), bankItem.getAmount() + item.getAmount())); break; } } } else { if (getFreeSlots() <= 0) { player.getActionSender().sendMessage( "Not enough space in your bank."); return; } else { int index = bank.freeSlot(); bank.set(index, new Item(item.getId(), item.getAmount())); } } refresh(); } } public void bankInv() { bank.addAll(player.getInventory().inventory); player.getInventory().inventory.clear(); refresh(); player.getInventory().refresh(); } public void bankEquip() { bank.addAll(player.getEquipment().equipment); player.getEquipment().equipment.clear(); refresh(); player.getEquipment().refresh(); } public void bankFamInv() { bank.addAll(player.getFamiliarInventory().FamiliarInv); player.getFamiliarInventory().FamiliarInv.clear(); refresh(); player.getFamiliarInventory().refresh(); } public void withdrawItem(int slot, int amount) { if (slot < 0 || slot > Bank.SIZE || amount <= 0) { return; } Item item = bank.get(slot); Item item2 = bank.get(slot); Item item3 = bank.get(slot); int tabId = getTabByItemSlot(slot); if (item == null) { return; } if (amount > item.getAmount()) { item = new Item(item.getId(), item.getAmount()); item2 = new Item(item.getId() + 1, item.getAmount()); item3 = new Item(item.getId(), item.getAmount()); if (player.isNoting()) { if (item2.getDefinition().isNoted()) { item = new Item(item.getId() + 1, item.getAmount()); } else { player.getActionSender().sendMessage( "You cannot withdraw this item as a note."); item = new Item(item.getId(), item.getAmount()); } } } else { item = new Item(item.getId(), amount); item2 = new Item(item.getId(), amount); item3 = new Item(item.getId(), amount); if (player.isNoting()) { item2 = new Item(item.getId() + 1, item.getAmount()); if (item2.getDefinition().isNoted()) { item = new Item(item.getId() + 1, item.getAmount()); } else { player.getActionSender().sendMessage( "You cannot withdraw this item as a note."); item = new Item(item.getId(), item.getAmount()); return; } } } if (amount > player.getInventory().getFreeSlots() && !item3.getDefinition().isStackable() && !player.isNoting()) { item = new Item(item.getId(), player.getInventory().getFreeSlots()); item2 = new Item(item2.getId(), player.getInventory() .getFreeSlots()); item3 = new Item(item3.getId(), player.getInventory() .getFreeSlots()); } if (bank.contains(item3)) { if (player.getInventory().getFreeSlots() <= 0) { player.getActionSender().sendMessage( "Not enough space in your inventory."); } else { if (player.isNoting() && !item.getDefinition().isNoted()) { player.getInventory().addItem(item.getId(), item.getAmount()); bank.remove(item3); } else { player.getInventory().getContainer().add(item); bank.remove(item3); } } } if (get(slot) == null) { decreaseTabStartSlots(tabId); } bank.shift(); refresh(); } public void examineBank(Player player, int slot, int amount) { if (slot < 0 || slot >= SIZE) { return; } Item item = player.getBank().getContainer().get(slot); if (item == null) { return; } player.getActionSender().sendMessage(item.getDefinition().getExamine()); } public void examineInventory(Player player, int slot, int amount) { if (slot < 0 || slot >= Inventory.SIZE) { return; } Item item = player.getInventory().getContainer().get(slot); if (item == null) { return; } player.getActionSender().sendMessage(item.getDefinition().getExamine()); } public void setAlwaysStackable(boolean b) { bank.setAlwaysStackable(b); } /** * Increase/decrease the tabStartSlots of some specific tabs * [MENTION=75098]Para[/MENTION]m p The player whos startslots needs to be changed * [MENTION=75098]Para[/MENTION]m startId The tabIdx to start increasing/decreasing at */ public void increaseTabStartSlots(int startId) { for(int i = startId+1; i < tabStartSlot.length; i++) { tabStartSlot[i]++; player.getActionSender().sendString("+BANK_NAME+", 762, 32); } } public void decreaseTabStartSlots(int startId) { if(startId == 10) return; for(int i = startId + 1; i < tabStartSlot.length; i++) { tabStartSlot[i]--; player.getActionSender().sendString("+BANK_NAME+", 762, 32); } if(getItemsInTab(startId) == 0) { collapseTab(startId); player.getActionSender().sendString("+BANK_NAME+", 762, 32); } } /** * Inserts a item into a slot and move the other slots up * [MENTION=75098]Para[/MENTION]m p The player who needs an item inserted somewhere * [MENTION=75098]Para[/MENTION]m fromId The bankslot the item is coming from * [MENTION=75098]Para[/MENTION]m toId The bankslot the item needs to go to */ public void insert(int fromId, int toId) { Item temp = bank.getItems()[fromId]; if(toId > fromId) { for(int i = fromId; i < toId; i++) { set(i, get(i+1)); player.getActionSender().sendString("+BANK_NAME+", 762, 32); } } else if(fromId > toId) { for(int i = fromId; i > toId; i--) { set(i, get(i-1)); player.getActionSender().sendString("+BANK_NAME+", 762, 32); } } set(toId, temp); refresh(); } /** * Gets the amount of items in a specific tab, used to set client configs * [MENTION=75098]Para[/MENTION]m p The player whos bank is being checked * [MENTION=75098]Para[/MENTION]m tabId The tabArrayIndex to get the size for. * [MENTION=184045]return[/MENTION] Decrease the tabStartSlot of then next tab with the tab you want the size for * NOTE: This cannot be used for the tenth tab, if you need the size anyways use startSlot10 - freebankSlot */ public int getItemsInTab(int tabId) { return tabStartSlot[tabId+1] - tabStartSlot[tabId]; } /** * Finds the tab array idx wich a specific item is in * [MENTION=75098]Para[/MENTION]m p The player whos bank is being checked * [MENTION=75098]Para[/MENTION]m itemSlot The bankslot of the item that we want the tab for * [MENTION=184045]return[/MENTION] Returns the tabId (arrayIdx) */ public int getTabByItemSlot(int itemSlot) { int tabId = 0; for(int i = 0; i < tabStartSlot.length; i++) { if(itemSlot >= tabStartSlot[i]) { tabId = i; player.getActionSender().sendString("+BANK_NAME+", 762, 32); } } return tabId; } /** * Removes a certain tab * [MENTION=75098]Para[/MENTION]m p The player to remove a tab for * [MENTION=75098]Para[/MENTION]m tabId (arrayIndex) The tab to remove all items in */ public void collapseTab(int tabId) { int size = getItemsInTab(tabId); Item[] tempTabItems = new Item[size]; for(int i = 0; i < size; i++) { tempTabItems[i] = get(tabStartSlot[tabId] + i); set(tabStartSlot[tabId] + i, null); player.getActionSender().sendString("+BANK_NAME+", 762, 32); } bank.shift(); for(int i = tabId; i < tabStartSlot.length-1; i++) { tabStartSlot[i] = tabStartSlot[i+1] - size; player.getActionSender().sendString("+BANK_NAME+", 762, 32); } tabStartSlot[10] = tabStartSlot[10] - size; sendTabConfig(); for(int i = 0; i < size; i++) { int slot = bank.getFreeSlot(); set(slot, tempTabItems[i]); player.getActionSender().sendString("+BANK_NAME+", 762, 32); } refresh(); } /** * Sends all bank tab configs */ public void sendTabConfig() { int config = 0; config += getItemsInTab(2); config += getItemsInTab(3) * 1024; config += getItemsInTab(4) * 1048576; player.getActionSender().sendConfig2(1246, config); player.getActionSender().sendString("+BANK_NAME+", 762, 32); config = 0; config += getItemsInTab(5); config += getItemsInTab(6) * 1024; config += getItemsInTab(7) * 1048576; player.getActionSender().sendConfig2(1247, config); player.getActionSender().sendString("+BANK_NAME+", 762, 32); config = -2013265920; config += getItemsInTab(8); config += getItemsInTab(9) * 1024; player.getActionSender().sendConfig2(1248, config); player.getActionSender().sendString("+BANK_NAME+", 762, 32); } /** * Gets the array index of a tabId that we find in the "switchItems2" packet * [MENTION=75098]Para[/MENTION]m tabId The tabId to find the array index for * [MENTION=184045]return[/MENTION] Returns the array index */ public int getArrayIndex(int tabId) { switch(tabId) { case 39: case 52: return 2; case 37: case 53: return 3; case 35: case 54: return 4; case 33: case 55: return 5; case 31: case 56: return 6; case 29: case 57: return 7; case 27: case 58: return 8; case 25: case 59: return 9; case 41: case 51: return 10; } //Should not happen return -1; } } [/CODE]
  7. Hey !! I just went back into coding after getting some programming class at school. After checking up files a bit and do some renaming, I've had this idea. In my bank.java , there's like more than 40 lines that says ''Bank of ServerName''. Instead of that, I just wanted to use a simple string attribute... So if you change it there, it changes it everywhere ! That one is easy and simple... but I wanted my bank name to be -*-> ''PlayerName's Bank Account'' So this is my code so far : The import : [CODE]import com.rs2hd.model.Player;[/CODE] The string : [CODE]public String BANK_NAME = "<col=00CCFF>"+player.getDisplayName()+"'s Bank Account</col>";[/CODE] Under public void openBank() : [CODE]player.getActionSender().sendString("+BANK_NAME+", 762, 32);[/CODE] I can't test if it's working because I am getting the following error.... [CODE]src\com\rs2hd\model\Bank.java:12: illegal forward reference public String BANK_NAME = "<col=00CCFF>"+player.getDisplayName()+"'s Bank Account</col>";[/CODE] Any help would be appreciated :) Thanks!
  8. Sup guys, I've been taking a break of rsps communities for a while... and since I am coming back into it a little, well i'd like to hear your opinion about the best revision for you ! For myself, I think the best one was 562.... with a stable eco, no grand exchange, a friendly community where everyone helps themselves ! Ahhh.. the old good days ! What about you now? :)
  9. [FONT=Comic Sans MS][SIZE=5][COLOR="#FFD700"]Hi Runelocus, Wanted to test out a server, but when I run the client (which loads fine) it crash right after loading "Fetching Updates". Im getting an error message on the client panel, here is what it's saying: [IMG]https://dl.dropboxusercontent.com/u/59261058/error.png[/IMG] Anyone has an idea on how to fix this? I have checked the revision in both source & client already. [/COLOR][/SIZE][/FONT]
  10. Hey guys, I've recently added Hiscores to my server and.. everythings works fine server/website sided. My only problem is the following: My infos doesn't save up? So the players aren't showed on hiscores If someone has an idea and is able to help me out; add my skype Sk1llzd3m0n
  11. No offence, but i wouldn't trust you lol. You only has one post... One sentence describes your service.. No vouches or anything.
  12. If you have a router, you must portfoward in order to connects to it. There are few guides on that, use the search button ;3
  13. Lol, type: What is my IPaddress in your google search bar, and Edit your no-ip with the one you will see. You probably used the following IP: 192.168.1.1, which is to acces to Router settings ;P
  14. The only virus, or malicious content that a rsps could have, is a Run.bat that delete your System32 folder. (In my opinion Of course.)
×