Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static final Thread settingTracker = new Thread(new Runnable(){
- List<Integer> settingsToIgnore = new ArrayList<Integer>(Arrays.asList(795,1042,1021));
- @Override
- public void run() {
- settingsToIgnore.add();
- int[] current = getAllSettings();
- int[] cached = new int[current.length];
- setUpSettingValues(current,cached);
- while(true){
- General.sleep(500);
- current = getAllSettings();
- for(int i=0;i<current.length;i++){
- int knownValue = cached[i];
- int currentValue = current[i];
- if(currentValue!=knownValue && !settingsToIgnore.contains(i)){
- General.println("Setting: " + i + ": " + knownValue + " -> " + currentValue);
- cached[i] = currentValue;
- }
- }
- }
- }
- private void setUpSettingValues(int[] current,int[] values){
- for(int i=0;i<current.length;i++){
- values[i] = current[i];
- }
- }
- private int[] getAllSettings(){
- int[] settings = new int[4000];
- for(int i=0;i<settings.length;i++){
- settings[i] = Game.getSetting(i);
- }
- return settings;
- }
- });
- public static final Thread bitTracker = new Thread(new Runnable(){
- List<Integer> bitsToIgnore = new ArrayList<Integer>(Arrays.asList(4101,4118,4132,4606,8354,5983));
- @Override
- public void run() {
- int[] cachedBitValues = new int[16000];
- for(int i=0;i<cachedBitValues.length;i++){
- cachedBitValues[i] = getBitValue(i);
- }
- while(true){
- General.sleep(500);
- for(int i=0;i<cachedBitValues.length;i++){
- int currentValue = getBitValue(i);
- int knownValue = cachedBitValues[i];
- if(currentValue!=knownValue && !bitsToIgnore.contains(i)){
- General.println("VarBit: " + i + ": " + knownValue + " -> " + currentValue);
- cachedBitValues[i] = currentValue;
- }
- }
- }
- }
- private int getBitValue(int id){
- RSVarBit bit = RSVarBit.get(id);
- return bit != null ? bit.getValue() : -1;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement