61 lines
1.9 KiB
Java
61 lines
1.9 KiB
Java
package io.reisub.dreambot.cshopper;
|
|
|
|
import io.reisub.dreambot.cshopper.tasks.Buy;
|
|
import io.reisub.dreambot.cshopper.tasks.Hop;
|
|
import io.reisub.dreambot.cshopper.tasks.Open;
|
|
import io.reisub.dreambot.cshopper.tasks.Stop;
|
|
import io.reisub.dreambot.util.CTaskScript;
|
|
import io.reisub.dreambot.util.Constants;
|
|
import io.reisub.dreambot.util.tasks.Run;
|
|
import org.dreambot.api.methods.container.impl.Inventory;
|
|
import org.dreambot.api.script.Category;
|
|
import org.dreambot.api.script.ScriptManifest;
|
|
import org.dreambot.api.wrappers.items.Item;
|
|
|
|
import java.awt.*;
|
|
|
|
@SuppressWarnings("unused")
|
|
@ScriptManifest(category = Category.MISC, name = "CShopper", description = "Shops like a woman with an unlimited Visa card", author = Constants.AUTHOR, version = 1.0)
|
|
public class CShopper extends CTaskScript {
|
|
private static final Configuration configuration = new Configuration(
|
|
Constants.LUNDAIL,
|
|
new ItemWrapper(Constants.COSMIC_RUNE, -1),
|
|
new ItemWrapper(Constants.NATURE_RUNE, 6000)
|
|
);
|
|
|
|
private Buy buyTask;
|
|
|
|
public static Configuration getConfiguration() {
|
|
return configuration;
|
|
}
|
|
|
|
@Override
|
|
public void onStart() {
|
|
getUI().setCustomLines(configuration.getItems().length);
|
|
|
|
buyTask = new Buy();
|
|
|
|
addNodes(
|
|
new Run(),
|
|
new Open(),
|
|
buyTask,
|
|
new Hop(),
|
|
new Stop()
|
|
);
|
|
}
|
|
|
|
@Override
|
|
public void onPaint(Graphics g) {
|
|
super.onPaint(g);
|
|
|
|
if (buyTask == null) return;
|
|
|
|
for (ItemWrapper iw : configuration.getItems()) {
|
|
String name = iw.getName();
|
|
Item item = Inventory.get(iw.getName());
|
|
int current = item == null ? 0 : item.getAmount();
|
|
getUI().drawString("Bought " + buyTask.getBought(name) + " " + name + " (" + current + ")");
|
|
}
|
|
}
|
|
}
|