Here is a simple script template for everyone to use.
- Code:
import bot.Client;
import bot.Methods;
public class Template extends Methods {
public Template(Client mc) {
super(mc);
}
// Integers and Strings go here
public void main(String args[]) {
//args integer goes here if any
printMessage("This is a Template...");
printMessage("@gre@Please use this for scripting use.");
while(running()) {
if(fatigue() == 100L && !sleeping()) {
}
}
}
//When the script stops
public void onStop() {
handleCommand("status");
printMessage("@or2@Script Stopped");
}
//Now add the Anti-Mod into your script
public void onChatMessage(int modstatus, String name, String message) {
String s = name.toLowerCase();
if (modstatus != 4 && modstatus != 7) {
printMessage("@red@Warning: @whi@Mod detected");
String m = message.toLowerCase();
if (m.contains("YOUR NAME HERE")) {
printMessage("@ran@Mod is talking! Abandoning script! Respond if you can!");
stop();
}
if(s.startsWith("Mod") || s.contains("mod") || s.contains("bot") || s.contains("Bot") || s.contains("Pyru") || s.contains("Lister")){ //if loop
speak("Hey");
stop();
printMessage("Mod detected, script and ocr stopped");
}
}
}
} //Make sure you end the class when you finish your script!
Last edited by TimeDead on Thu Dec 02, 2010 3:54 pm; edited 1 time in total