- Thread Author
- #1
Can someone help me make an in-activity timer, the idea being: the script stops if you do not gain xp in a desired skill within a specific time.
-I do not know javascript/java
-I have a feeling you would need to use a timer, but as you can see below I have no idea how to use timers
-I dont know where i would place this bit of code.
here is what i have so far:
int cExp = 0;
if(Skill.WOODCUTTING.getExperience() > cExp) { cExp = Skill.WOODCUTTING.getExperience(); } else {
Timer idle = new Timer(5000);
idle.start();
int x = 1;
if(idle.getElapsedTime() > x) {
System.out.println("Idle for " +x + "; Stopping");
stop();}
}
Just a simple bit of code with a lot of potential, especially within darkscape.
Thanks!
-I do not know javascript/java
-I have a feeling you would need to use a timer, but as you can see below I have no idea how to use timers
-I dont know where i would place this bit of code.
here is what i have so far:
int cExp = 0;
if(Skill.WOODCUTTING.getExperience() > cExp) { cExp = Skill.WOODCUTTING.getExperience(); } else {
Timer idle = new Timer(5000);
idle.start();
int x = 1;
if(idle.getElapsedTime() > x) {
System.out.println("Idle for " +x + "; Stopping");
stop();}
}
Just a simple bit of code with a lot of potential, especially within darkscape.
Thanks!