Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

script wont launch

Featured Replies

 
I kinda need help with a tanning script i wrote, whenever I launch it via OSbot i get a couple of error messages and since im new to this all info and help would be accepted, thanks in advance.
 
 
package tanHide;
 
import java.awt.Graphics;
 
import org.osbot.rs07.script.Script;
import org.osbot.rs07.api.Bank;
 
import org.osbot.rs07.api.Inventory;
 
import org.osbot.rs07.api.map.Area;
 
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.Player;
 
import org.osbot.rs07.script.ScriptManifest;
@ScriptManifest(author = "Andrey", info = "Tans hides(osrs_f2p)", logo = "kek", name = "Hide_tanner", version = 0.1)
 
public class TanHide extends Script {
   //executes code
final Area BANK_AREA = new Area(3272,3173,3269,3161);
final Area TAN_AREA = new Area(3270,3189,3277,3194);
final int BANK_BOOTH_ID=396;
final int ELLIS_ID=3231;
public void onStart(){
 
 
 
}
//code executed at end
public void onExit(){
 
 
 
}
Inventory inven = client.getMethods().getInventory();
Player player = client.getMethods().myPlayer();
Bank bank = client.getMethods().getBank();
 
 
//code in loop, goes into bank, takes hide, goes to tanner and back
public int onLoop() throws InterruptedException {
//banker interaction
if(inven.isEmptyExcept(995)){
if(BANK_AREA.contains(player)){
             NPC banker = npcs.closest(BANK_BOOTH_ID);
if(bank.isOpen()){
           
             bank.withdrawAll(1739);
           
              }else{
             if(banker!=null){
             if(banker.isVisible()){
             banker.interact("Bank");
             sleep(random(700,800));
             }
           
             }
           
           
              }
 
 
}else{
 
getLocalWalker().walk(BANK_AREA,true);
 
}
 
 
}else{
//tanner interaction
getLocalWalker().walk(TAN_AREA,true);
NPC ellis = npcs.closest(ELLIS_ID);
NPC banker = npcs.closest(BANK_BOOTH_ID);
if(ellis!=null){
         if(ellis.isVisible()){
         ellis.interact("Trade");
       
        sleep(random(700,800));
        ellis.getMethods().getWidgets().getWidgetContainingText("Hard Leather").interact("All");
        getLocalWalker().walk(BANK_AREA,true);
        if(banker!=null){
         if(banker.isVisible()){
         banker.interact("Bank");
         sleep(random(700,800));
         bank.depositAllExcept(995);
         }
      }
         }
}
 
 
 
}
return 50;
}
//paint
public void onPaint(Graphics g){
 
}
}
 

 

Impossible to read haha!

format the code then copy and paste it using the code posting button (<€

>)

might be easier to help u then :)

  • Author
package tanHide;

import java.awt.Graphics;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.api.Bank;
import org.osbot.rs07.api.Inventory;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.Player;

import org.osbot.rs07.script.ScriptManifest;
@ScriptManifest(author = "Andrey", info = "Tans hides(osrs_f2p)", logo = "kek", name = "Hide_tanner", version = 0.1)

public class TanHide extends Script {
   //executes code
	final Area BANK_AREA = new Area(3272,3173,3269,3161);
	final Area TAN_AREA = new Area(3270,3189,3277,3194);
	final int BANK_BOOTH_ID=396;
	final int ELLIS_ID=3231;
	public void onStart(){}
	//code executed at end
	public void onExit(){}
	Inventory inven = client.getMethods().getInventory();
	 Player player = client.getMethods().myPlayer();
	 Bank bank = client.getMethods().getBank();
	  
	 
	//code in loop, goes into bank, takes hide, goes to tanner and back
	public int onLoop() throws InterruptedException {
		//banker interaction
		if(inven.isEmptyExcept(995)){
			if(BANK_AREA.contains(player)){
				NPC banker = npcs.closest(BANK_BOOTH_ID);
				if(bank.isOpen()){
            	                bank.withdrawAll(1739);
            	  }else{
            		  if(banker!=null){
            			  if(banker.isVisible()){
            				  banker.interact("Bank");
            				  sleep(random(700,800));
            			  }
            		  
            		  }
            	  
            	  
            	  }
				
				
			 }else{
				 getLocalWalker().walk(BANK_AREA,true);
			 }
			
			
		}else{
			//tanner interaction
			getLocalWalker().walk(TAN_AREA,true);
			NPC ellis = npcs.closest(ELLIS_ID);
			NPC banker = npcs.closest(BANK_BOOTH_ID);
			if(ellis!=null){
       		 	if(ellis.isVisible()){
       		 		ellis.interact("Trade");
       		        sleep(random(700,800));
       		        ellis.getMethods().getWidgets().getWidgetContainingText("Hard Leather").in  teract("All");
       		        getLocalWalker().walk(BANK_AREA,true);
       		        if(banker!=null){
       		        	if(banker.isVisible()){
       		        		banker.interact("Bank");
       		        		sleep(random(700,800));
       		        		bank.depositAllExcept(995);
       		        	}
       		        }
       		  }
		    }
	  	
		
		
		}
		return 50;
	}
	//paint
	public void onPaint(Graphics g){
		
	}
}

Would this help?

 

Edited by MightySir2

  • Author

Oh yeah another thing, it tells me  Failed to start script [insertscripthere] regardless of what i execute

I don't even know where to start tongue.png

Well... first of all, this:

Inventory inven = client.getMethods().getInventory();
Player player = client.getMethods().myPlayer();
Bank bank = client.getMethods().getBank();

What are you trying to do here? You already have access to the inventory by calling, for example, inventory.contains() directly. Same for player and bank. The reason the script doesn't start is that client doesn't exist yet, any initialization should be done in onStart. 
 

if(inven.isEmptyExcept(995)){

Should just use inventory.isEmptyExcept(995).
 

if(BANK_AREA.contains(player)){

You have access to the local player through myplayer()

 

ellis.getMethods().getWidgets().getWidgetContainingText("Hard Leather").in  teract("All");

All methods are already accessible from the script itself. You can directly call :
 

getWidgets().getWidgetContainingText("Hard Leather").interact("All");

Also, banking can simply be done by calling bank.open(), you don't have to do there interaction yourself wink.png

Edited by Flamezzz

  • Author

Thanks, I realized what I did wrong, anyways I started a new script from scratch using state/enum, and everything is functional so far.

  • Author

another question, huh.png , how do i go about interacting(al kharid ellis tanner in my case) a widget?

 


and finally how do improve my walking and interacting code to prevent ban?

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.