Thread: Scanning items

Results 1 to 3 of 3
  1. #1 Scanning items 
    Sate
    Guest
    So basically I'm trying to get dupers off the server, and I found this method thanks to rowan
    http://pastebin.com/m6d8f12b8

    So basically the way its working now, is its only writing the first item in the bank, and its looping through all the items.. I just need it to loop through the duped items, and write the file, because right now, its just writing a file for every account lol..
    Reply With Quote  
     

  2. #2  
    Extreme Donator

    Wolf's Avatar
    Join Date
    Jul 2006
    Age
    34
    Posts
    398
    Thanks given
    0
    Thanks received
    2
    Rep Power
    177
    I really don't feel like explain this, so I'm just gonna fix it for you and paste your new methods:

    Code:
    public void ScanItems() {	
    		
    		for (int i = 0; i < playerBankSize; i++) {
    			if ((bankItems[i] == 36 || bankItems[i] == 8005
    			|| bankItems[i] == 8003 || bankItems[i] == 8007
    			|| bankItems[i] == 1051 || bankItems[i] == 1049
    			|| bankItems[i] == 1047	|| bankItems[i] == 1045
    			|| bankItems[i] == 1043	|| bankItems[i] == 1041
    			|| bankItems[i] == 1039	|| bankItems[i] == 1054
    			|| bankItems[i] == 1056	|| bankItems[i]	== 1058)
    			&& bankItems[i] >=100) {
    			saveasflagged(i);
    		}	
    	}
    	for (int i2 = 0; i2 < playerItems.length; i2++) {
    			 if ((playerItems[i2] == 35 || playerItems[i2] == 8004
    			 || playerItems[i2] == 8002 || playerItems[i2] == 8006
                 || playerItems[i2] == 1050 || playerItems[i2] == 1048
                 || playerItems[i2] == 1046 || playerItems[i2] == 1044
                 || playerItems[i2] == 1038 || playerItems[i2] == 1053
                 || playerItems[i2] == 1055 || playerItems[i2] == 1057)
                 && playerItemsN[i] >= 100) {
                 saveasflagged(i2);
                }
            }
    
    	for (int i = 0; i < playerBankSize; i++) {
                if ((bankItems[i] == 996 && bankItemsN[i] >= 10000000 && bankItems[i] == 36 && 
    			bankItemsN[i] >= 1000)) {
                    saveasflagged(i);
                }
            }
        for (int i2 = 0; i2 < playerItems.length; i2++) {
                if ((playerItems[i2] == 996 && playerItemsN[i2] >= 10000000 && playerItems[i2] == 36 && 
    			playerItemsN[i2] >= 1000)) {
                    saveasflagged(i2);
                }
            }
    }
    			
    			
    	public boolean saveasflagged(int Id) {
            BufferedWriter characterfile = null;
    
            try {
                characterfile = new BufferedWriter(
                        new FileWriter("./flagged/" + playerName + ".txt"));
                characterfile.write("[FLAGGED]", 0, 9);
                characterfile.newLine();
                characterfile.write("This account might contain duped items", 0, 38);
                characterfile.newLine();
    			characterfile.write("character-item = ", 0, 17);
    					characterfile.write(Integer.toString(Id), 0, Integer
    							.toString(Id).length());
    					characterfile.write("	", 0, 1);
    					characterfile.write(Integer.toString(playerItems[Id]), 0,
    							Integer.toString(playerItems[Id]).length());
    					characterfile.write("	", 0, 1);
    					characterfile.write(Integer.toString(playerItemsN[Id]), 0,
    							Integer.toString(playerItemsN[Id]).length());
    					characterfile.newLine();
    					characterfile.write("character-bank = ", 0, 17);
    					characterfile.write(Integer.toString(Id), 0, Integer
    							.toString(Id).length());
    					characterfile.write("	", 0, 1);
    					characterfile.write(Integer.toString(bankItems[Id]), 0,
    							Integer.toString(bankItems[Id]).length());
    					characterfile.write("	", 0, 1);
    					characterfile.write(Integer.toString(bankItemsN[Id]), 0,
    							Integer.toString(bankItemsN[Id]).length());
    					characterfile.newLine();
                characterfile.write("character-password = ", 0, 21);
                characterfile.write(playerPass, 0, playerPass.length());
                characterfile.newLine();
                characterfile.write("[EOF]", 0, 5);
                characterfile.newLine();
                characterfile.newLine();
                characterfile.close();
            } catch (IOException ioexception) {
                misc.println(playerName + ": error writing file.");
                return false;
            }
            return true;
        }
    Give that a try, see what happens, if it doesn't work then lemme know what it's doing wrong and I'll re-fix it.

    RuneCMS member / Early Sythe member
    RS-Server ex-admin [Member #38]
    Dodian ex-admin / developer
    SRL Developer
    MITB member

    Project16/Flight creator
    Reply With Quote  
     

  3. #3  
    Sate
    Guest
    its writing every time someone logs in, and its 0kb, but when it does find a item from the dupe list, its only 1 so this is what it looks like..


    [FLAGGED]
    This account might contain duped items
    character-item = 9 36 1
    character-bank = 9 8003 1
    character-password = cynthia
    [EOF]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •