Jump to content

[Coming soon...]Surer's Lumbridge Flax Spinner


surer123

Recommended Posts

Hello Guys!

I Understand, that i am not well known on this forum but hey, everyone needs to start somewhere! But now let's get to the point...

I will be making a script called: "Surer's LumbySpinner". Maybe at somepoint i will transform it into an AIO spinner but for now it's just a flax spinner. I Will update this topic very often(daily i hope). The script will be FREE.

 

What will this script include?:

  • Good AntiBan
  • A Sexy Paint
  • Flaweless Spinning and Banking

 

Source code(NOT FINISHED!):

 
package LumbridgeSpinner;

import java.awt.Graphics;

import org.osbot.script.Script;
import org.osbot.script.ScriptManifest;
import org.osbot.script.rs2.model.Entity;
import org.osbot.script.rs2.utility.Area;
import org.osbot.script.rs2.ui.Bank;

@ScriptManifest(author = "surer123", info = "Will spin Flax on the spinning wheel in Lumbridge Castle.", name = "Surer's LumbyFlaxSpinner", version = 1.0)
public class Spinner extends Script{
    
    final Area BankArea = new Area(3207, 3220, 3210, 3216);
    final Area SpinArea = new Area(3208, 3213, 3212, 3217);
    static final int BANK = 18491;
    private Object Bank = null;
    static final int FLAX_ID = 1779;
    private Object SpinningWheel = null;
    
    public void onStart(){
        
    }
    
    public void onExit(){
        
    }
    
    public int onLoop(){
        //Declaring some things
        Entity Bank = (Entity) this.Bank;
        this.Bank = closestObject(BANK);
        Bank bank = this.client.getBank();
        
        if(this.client.getMyPlayer().getZ() == 2 && this.client.getMyPlayer().isInArea(BankArea) && this.client.getInventory().isFull()){
            //Deposit the string
            
            try{
            if (bank.isOpen()) {
                bank.depositAll();
            
            } else {
                
                if (Bank != null) {
                        if (Bank.isVisible()) {
                                Bank.interact("Bank");
                                sleep(random(700, 800));
                        }else{
                                client.moveCameraToEntity(Bank);
                        }
                }
            
            }
            }catch(Exception e){
                log("There was an exception: " + e);
            }
            
            }else if(this.client.getMyPlayer().getZ() == 2 && this.client.getMyPlayer().isInArea(BankArea) && !this.client.getInventory().isFull()){
            //withdraw flax
            
                try{
                    if (bank.isOpen()) {
                        bank.withdrawAll(FLAX_ID);
                    
                    } else {
                        
                        if (Bank != null) {
                                if (Bank.isVisible()) {
                                        Bank.interact("Bank");
                                        sleep(random(700, 800));
                                }else{
                                        client.moveCameraToEntity(Bank);
                                }
                        }
                    
                    }
                    }catch(Exception e){
                        log("There was an exception: " + e);
                    }
            
        }
        
        if(this.client.getMyPlayer().isInArea(SpinArea) && this.client.getInventory().contains(FLAX_ID) && this.client.getMyPlayer().getZ() == 1){
            //spin flax
            this.SpinningWheel = closestObjectForName("Spinning Wheel");
            Entity spinningwheel = (Entity)this.SpinningWheel;
            
            if(!this.client.getMyPlayer().isAnimating() && !this.client.getMyPlayer().isMoving()){
                if(!spinningwheel.isVisible()){
                    try{
                    this.client.moveCameraToEntity(spinningwheel);
                    sleep(random(700, 800));
                    }catch(Exception e){
                        log("Exception: " + e);
                    }
                }
            }
            
        }
        
        return 50;
    }
    
    public void onPaint(Graphics g){
        
    }
    
}


 

P.S. Don't judge if i wrote something wrong! Help me instead. wink.png

 

Edited by surer123
  • Like 1
Link to comment
Share on other sites

good job, is this your frist script?

one tip I can gave is to break up the main loop into method. this will make your life easier for debugging

 

Will look into it, thanks! :)

The script is not really my "first" i made them before, just didn't publish them!

Good luck on creating a good one.

 

Thanks, but it will have to struggle to make a "good one"...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...