All pastes #2046589 Raw Edit

Untitled

public text v1 · immutable
#2046589 ·published 2011-04-14 23:30 UTC
rendered paste body

import net.c2d.sharpf2.api.Script;
import net.c2d.sharpf2.api.ScriptData;
import net.c2d.sharpf2.api.model.InteractionPolicy;

/**
 *
 * @author Rick
 */
@ScriptData(name = "PowerMiner", author = "Rick", version = "1.0.0", description = "Mines copper and drops the shit")
public class ObjectScript extends Script {

    /**
     * Can be overridden but u dont hav 2 use start() at all unless u want to pre-set shit
     */
    @Override
    public void start() {
        objects.setInteractionPolicy(InteractionPolicy.WAIT_FOR_INTERACTABLE); // When clicking an object also react on its dissapearance
    }

    /**
     * Main loop of script
     * @return lol
     */
    @Override
    public int tick() {
        if (!inventory.isFull()) {
            if (objects.objectExists(11962, 11960, 11961)) {
                objects.interactWith("Mine", 11962, 11960, 11961);
            }
        } else {
            inventory.dropAll();
        }
        return 200;
    }
}