mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-04 16:49:11 +00:00
[FEATURE] File Ban Random
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package org.parabot.randoms.dreamscape;
|
||||
|
||||
import org.parabot.environment.randoms.Random;
|
||||
import org.parabot.environment.randoms.RandomType;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author EmmaStone
|
||||
*/
|
||||
public class FileBan implements Random {
|
||||
|
||||
private boolean checked = false;
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
if (!checked) {
|
||||
if (doesFileExist()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
File file = new File(System.getProperty("user.home") + "/jagex_rs.txt");
|
||||
file.delete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "File Ban";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServer() {
|
||||
return "dreamscape";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RandomType getRandomType() {
|
||||
return RandomType.ON_SERVER_START;
|
||||
}
|
||||
|
||||
private boolean doesFileExist() {
|
||||
checked = true;
|
||||
|
||||
File file = new File(System.getProperty("user.home") + "/jagex_rs.txt");
|
||||
return file.exists() && file.exists();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user