Jump to content
  • 0
Sign in to follow this  
raivorots

item bonueses unpacked

Question

Hello idk why but itembonuses unpacked didnt make folder bonuses in data/items
but i think it should
i think need make from bonuses.ib to folder but idk it didnt make all works fine no errors nothing but it justs unpacking but didnt make folder:(
Code
[HTML]package com.rs.tools;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import com.rs.cache.Cache;
import com.rs.utils.ItemBonuses;
import com.rs.utils.Utils;

/**
* @author Frosty Teh Snowman
*
* Unpacks the Item Bonuses that are packed into the bonuses.ib file.
*/
public class ItemBonusesUnpacker {

public static final void main(String[] args) {
log("Unpacker Started.");
try {
Cache.init();
log("Cache Initiated.");
} catch (IOException e) {
log("Exception in initializing cache.");
}
ItemBonuses.init();
log("Item Bonuses Initiated.");
for (int itemId = 0; itemId < Utils.getItemDefinitionsSize(); itemId++) {
log("Getting Values for item " + itemId);
int[] bonuses = ItemBonuses.getItemBonuses(itemId);
File file = new File("data/items/bonuses/" + itemId + ".txt");
try {
if (file.createNewFile()) {
BufferedWriter writer = new BufferedWriter(new FileWriter(
file));
writer.write("Attack Bonus");
writer.newLine();
writer.write(Integer.toString(bonuses[0]));
writer.newLine();
writer.write(Integer.toString(bonuses[1]));
writer.newLine();
writer.write(Integer.toString(bonuses[2]));
writer.newLine();
writer.write(Integer.toString(bonuses[3]));
writer.newLine();
writer.write(Integer.toString(bonuses[4]));
writer.newLine();
writer.write("Defense Bonus");
writer.newLine();
writer.write(Integer.toString(bonuses[5]));
writer.newLine();
writer.write(Integer.toString(bonuses[6]));
writer.newLine();
writer.write(Integer.toString(bonuses[7]));
writer.newLine();
writer.write(Integer.toString(bonuses[8]));
writer.newLine();
writer.write(Integer.toString(bonuses[9]));
writer.newLine();
writer.write(Integer.toString(bonuses[10]));
writer.newLine();
writer.write("Damage Absorption");
writer.newLine();
writer.write(Integer.toString(bonuses[11]));
writer.newLine();
writer.write(Integer.toString(bonuses[12]));
writer.newLine();
writer.write(Integer.toString(bonuses[13]));
writer.newLine();
writer.write("Other Bonuses");
writer.newLine();
writer.write(Integer.toString(bonuses[14]));
writer.newLine();
writer.write(Integer.toString(bonuses[15]));
writer.newLine();
writer.write(Integer.toString(bonuses[16]));
writer.newLine();
writer.write(Integer.toString(bonuses[17]));
writer.flush();
writer.close();
}
} catch (Exception e) {
}
}
log("Finished Unpacking.");
}

private static void log(String s) {
System.out.println(s);
}

}[/HTML]

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0
[quote name='raivorots']ok and what this doing?[/QUOTE]

It's a cmd script file. Save it as runItemDefinitionsGen.bat

Share this post


Link to post
Share on other sites
  • 0
[quote name='Jon']It's a cmd script file. Save it as runItemDefinitionsGen.bat[/QUOTE]

i already do that running to but what it do?

Share this post


Link to post
Share on other sites
  • 0
[quote name='raivorots']i already do that running to but what it do?[/QUOTE]

Runs the class? It doesn't sound like your run is actually running the class.

Also... the data/items/bonuses/ folder should be empty of all of txt files.

Share this post


Link to post
Share on other sites
  • 0
[quote name='Jon']Runs the class? It doesn't sound like your run is actually running the class.

Also... the data/items/bonuses/ folder should be empty of all of txt files.[/QUOTE]

there didnt have any bonuses folder
invite me on skype raivis.taurins1
if u can
i need really that folder

Share this post


Link to post
Share on other sites
Sign in to follow this  

×