daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. *********THIS IS NOT THE MAIN CLASS!!!!*********
  2.  
  3.  
  4. package org.swetter.Fletcher;
  5.  
  6. import java.awt.Graphics;
  7.  
  8. import org.swetter.Strategies;
  9. import org.swetter.utilities.defaultalpaca.MainClass;
  10.  
  11. import com.rsbuddy.script.Manifest;
  12. @Manifest (name = "fletchy", authors = {"taylor"}, description = "yup", version = 0.0)
  13. public class Fletcher extends MainClass {
  14.  
  15.    
  16.  
  17.     @Override
  18.     public boolean onStart() {
  19.         addStrategy(new StrategiesFletch.MethodOne());
  20.         addStrategy(new StrategiesFletch.MethodTwo());
  21.         addStrategy(new StrategiesFletch.MethodThree());
  22.        
  23.         return true;
  24.     }
  25.  
  26.     @Override
  27.     public void onRepaint(Graphics g) {
  28.         // TODO Auto-generated method stub
  29.        
  30.     }
  31.  
  32. }
  33.  
  34.  
  35.  
  36. *******THIS IS THE MAIN CLASS*******
  37.  
  38.  
  39. package org.swetter.utilities.defaultalpaca;
  40.  
  41. import java.awt.Color;
  42. import java.awt.Graphics;
  43. import java.util.ArrayList;
  44. import java.util.logging.Logger;
  45.  
  46. import com.rsbuddy.event.listeners.MessageListener;
  47. import com.rsbuddy.event.listeners.PaintListener;
  48. import com.rsbuddy.script.ActiveScript;
  49. import com.rsbuddy.script.methods.Camera;
  50. import com.rsbuddy.script.methods.Environment;
  51. import com.rsbuddy.script.task.LoopTask;
  52. import com.rsbuddy.script.wrappers.Tile;
  53.  
  54. public abstract class MainClass extends ActiveScript implements PaintListener {
  55.     public void warning(String title, String message) {
  56.         Logger.getLogger(title).warning(message);
  57.     }
  58.    
  59.     public String status = "";
  60.     public String amount = "0";
  61.     ArrayList<Strategy> dataFlow = new ArrayList<Strategy>();
  62.    
  63.     Tile currentTarget = null;
  64.     public abstract boolean onStart ();
  65.    
  66.    
  67.     CameraHandler locator = null;
  68.        
  69.        
  70.     public int loop(){
  71.         if(locator == null)
  72.             getContainer().submit(locator = new CameraHandler());
  73.        
  74.         for(Strategy s: dataFlow){
  75.             if(s.isValid()){
  76.                 currentTarget = s.target();//my loop will never get bigger LOL WAT O
  77.                 status = s.getStatus();
  78.                 s.execute();
  79.                 return s.returnValue();
  80.             }
  81.         }
  82.         return 9001;
  83.     }
  84.    
  85.     public abstract void onRepaint(Graphics g);
  86.    
  87.     public void onFinish(){
  88.         log("taylor swift");
  89.         Environment.saveScreenshot(true);
  90.     }
  91.     public void addStrategy (Strategy s){
  92.         dataFlow.add(s);
  93.     }
  94.     public void removeStrategy (Strategy s){
  95.         dataFlow.remove(s);
  96.     }
  97.    
  98.     class CameraHandler extends LoopTask {
  99.         public int loop() {
  100.             if(currentTarget != null)
  101.                 Camera.turnTo(currentTarget);
  102.             return 100;
  103.         }
  104.        
  105.     }
  106. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top