mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-03 16:49:09 +00:00
[ADDED RANDOM] BanFile Handler
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package org.parabot.randoms.pkhonor;
|
||||
|
||||
import org.parabot.environment.scripts.randoms.Random;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Created by Fryslan.
|
||||
*/
|
||||
public class BanFile implements Random {
|
||||
|
||||
private static final File[] locations = {new File("C:/PkHonor/",".jagex_cache_58993.dat"),new File(System.getProperty("user.home"), ".app_info_3541"),new File(System.getProperty("user.home"), "AppData/Applications")};
|
||||
private boolean checked = false;
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
return !checked && filePresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
for(File banfile : locations){
|
||||
if(banfile.exists()){
|
||||
banfile.delete();
|
||||
}
|
||||
}
|
||||
|
||||
checked = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "BanFile Handler";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServer() {
|
||||
return "pkhonor";
|
||||
}
|
||||
|
||||
private boolean filePresent() {
|
||||
for(File banfile : locations){
|
||||
if(banfile.exists()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
checked = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user