Skip to content

Instantly share code, notes, and snippets.

View JeroenMerks's full-sized avatar

Jeroen Merks JeroenMerks

View GitHub Profile
final RSObject Ore = objects.getNearest(oreID); //get the Object
if (Ore.interact("Mine")) { //Do the interaction, continue when it returns true
sleepWhile(new Condition() {
public boolean isTrue() {
return players.getMyPlayer().getAnimation() == -1; //The condition
}
}, Ore, 1000); //The targetObject and Threshold
}
//Version with no walking involved
private boolean sleepWhile(final Condition condition, final int Threshold) {
final int Irritations = Threshold / 25;
for (int i = 0; i < Irritations && condition.isTrue(); i++) {
if (game.getClientState() != 11) {
i = 0;
}
Methods.sleep(Methods.random(20, 30));
}
return condition.isTrue();
@JeroenMerks
JeroenMerks / AIORuneCrafter.java
Created May 3, 2011 11:49
AIORuneCrafter 0.2
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;