Originally Posted by
elguyboy
I almost wondering the same thing and using Vencillo as a base. however, i am unable to figure out how to create function/task based on same tick or how to create a function that finds the specific ore on a area. Any snippet code would greatly be appreciated to help me and OP.
Ill post a snippet in a bit when i have a chance. ill have to do some testing myself.
Code:
package com.vencillio.core.task.impl;
import com.vencillio.core.cache.map.Region;
import com.vencillio.core.task.Task;
import com.vencillio.rs2.content.skill.mining.Mining;
import com.vencillio.rs2.entity.Entity;
import com.vencillio.rs2.entity.Location;
import com.vencillio.rs2.entity.player.Player;
public class MiningBankTask extends Task {
public MiningBankTask(Entity entity, int delay) {
super(entity, delay);
}
private boolean bank = false;
@Override
public void execute() {
Entity player = getEntity();
Location miningLocation = new Location(0, 0, 0); //put location of tile right next to mining rock here
Location bankLocation = new Location(0, 0, 0); //same as above except for bank
if(player instanceof Player) {
if(!player.getLocation().equals(miningLocation) && !bank) {
player.getMovementHandler().addToPath(miningLocation);
player.getMovementHandler().finish();
//(The above 2 lines will make a player move but im not sure how to make it so it clips correctly, don't have time to look into code for it lol
} else if(player.getLocation().equals(miningLocation) && bank) {
Mining.clickRock((Player)player, Region.getObject(0, 0, 0));
//Click the rock at x, y, z
}
//check for inventory slots and when no more free slots do the same thing above and go to bank and deposit items then restart
}
}
@Override
public void onStop() {
super.stop();
}
}
You can improve the code if you want i don't really care of the quality of it as of now, its just to show a very bare example of what to do.