Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 498px; text-align: left;">import java.awt.*;
- import java.util.*;
- import com.speljohan.rsbot.script.*;
- import com.speljohan.rsbot.bot.*;
- import com.speljohan.rsbot.script.wrappers.*;
- import com.speljohan.rsbot.event.listeners.*;
- import com.speljohan.rsbot.event.events.*;
- public class CopperMiner extends Script{
- public int YewTree = 1309;
- public int CuttingAnim = 2846;
- public int WcAxe = 6739;
- public int TreeWalk =
- public int NeedToWalk =
- public String getName(){
- return "SorsaYews";
- }
- public String getAuthor(){
- return "Sorsa";
- }
- public String getScriptCategory(){
- return "Woodcutting";
- }
- public double getVersion(){
- return 1.0;
- }
- public String getScriptDescription() {
- String html = "";
- return(html);
- }
- public boolean onStart(Map<String, String> args) {
- /*
- * What you want to do on the starting of the script
- * Goes here. It must return true for the script to run.
- * If you return false, it will stop the entire script
- * and it will say "Failed to startup";
- * This will only be used once, at the beginning
- */
- return true;
- }
- public void onFinish(){
- /*
- * This is what you want it to do when the user
- * Stops the script.
- * This will only be used once, at the end.
- */
- return;
- }
- public int loop() {
- if(getMyPlayer().isMoving()){
- return 800;
- }
- if(getMyPlayer().getAnimation() == CuttingAnim){
- return 800;
- }
- //If the loop has gotten this far, we know we are not already
- //mining a rock and We know we are not moving, therefore
- //it is safe to mine a rock
- if(isInventoryFull()){
- GoBank(WcAxe);
- return 800;
- }
- //if we have gotten here, this means all of the above comments,
- //and our inventory is not full. This means it's perfect to
- //mine a rock.
- RSObject rock = findObject(copperRock);
- if(rock == null) return 800;
- atObject(rock, "Mine");
- return 300;
- import com.speljohan.rsbot.script.Script;
- import com.speljohan.rsbot.script.wrappers.RSTile;
- public class Blabla extends Script{
- RSTile[] bankToMine = { new RSTile(2934, 2342) , new RSTile(2944, 2338),
- new RSTile(2954, 2333)};
- //THIS IS NOT A REAL WORKING TILEPATH, THEY ARE MADE UP NUMBERS!
- RSTile[] mineToBank = reversePath(bankToMine);
- public boolean needToWalk(){
- if(!getMyPlayer().isMoving()) return true;
- //^^ obviously if we aren't moving we need
- //^^ to walk.
- if(distanceTo(getDestination()) <= random(4, 7)) return true;
- // getDestination returns the tile on where
- // the flag is currently placed. So if we are
- // between 4 and 7 tiles away, your player
- // will attempt to click the next tile.
- return false;
- // if we get here, we do not need to walk.
- }
- public int loop() {
- if(isInventoryFull()){ // Need to bank
- if(distanceTo(*Insert Bank Tile Here*) >= 4){
- // If we aren't close to bank.
- mineToBank = randomizePath(mineToBank, 2, 2);
- if(needToWalk()){ walkTilePath(mineToBank, 25); }
- return random(600, 800);
- }else{
- // we are close to bank
- *Bank here*
- }
- }else{
- if(*We are at yews){
- //We are at yews
- *Mining code here*
- }else{
- //we are not at mine
- bankTocut = randomizePath(bankTocut, 2, 2);
- if(needToWalk()){ walkTilePath(bankTocut, 25); }
- return random(600, 800);
- }
- }
- }
- }</pre>
- }
- }</pre>
Add Comment
Please, Sign In to add comment