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.

PPStalls

Featured Replies

It won't work for me , I followed the steps and didn't succeed to put the script into the bot . 

I did it before yesterday but those were scripts I copied , now it's the first time with those yea i dont know how to call it , import org.osbot.script.Script;import org.osbot.script.ScriptManifest; import javax.swing.JComboBox;import javax.swing.JOptionPane;import javax.swing <-- like this , i copied everything and changed it to groovy etc but it won't work will some1 plz help me (:?

 

Does it still work? if it does under what do i have to safe this? i safed it as PPstalls.groovie but wont show up in the scripts :l

 

thx if anybody knows :D

  • 2 weeks later...
  • 4 weeks later...

i fixed the code layout guys, to get it working save this code as PPStalls.groovy.

 

Bugs/missing functions:
stealing is quite slow, cannot compete with real players

Lack of banking and/or dropping

Does not support food

if some one can add any of these into this code, i would be greatful. thx

import org.osbot.script.Script;
import org.osbot.script.ScriptManifest; 
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Graphics; 

@ScriptManifest(name = "PPStalls", author="PengPhin", version = 1.0D, info = "Only Supports upto Master Farmer")
class PPStalls extends Script {
 	enum State {
		INPUT, IDLE, ROBBING,	
} 	
Stall[] Stalls = [
			new Stall("Seed Stall", [ 7053, 634 ] as int[]), // Add new Stalls here
		new Stall("Cake Stall", [ 2561, 634 ] as int[]), // Add new Stalls here	
		new Stall("Silk Stall", [ 2560, 634 ] as int[]), // Add new Stalls here	
			] as Stall[]; 	
State state = State.INPUT;
	Stall Stall = null; 	
void onStart() {
		if (state == State.INPUT) {			showInput();		
 }	
} 	
int onLoop() {
		switch(state) {
			case State.IDLE:
				return idl();
			case State.ROBBING:
				return steal();
		}
		return 1000 + gRandom(400, 800);
	} 	
         int steal() {
		def Stall = closestObject(Stall.getIds());
		if (Stall != null) {
			if (selectEntityOption(Stall, "Steal-from")) {
				return 2000 + random(200, 500);
			}
		}
		return 1000 + random(200, 1000);
	}
 	void onPaint(Graphics g) {
		g.setColor(new Color(0.1f, 0.1f, 0.1f, 0.7f));
		g.fillRect(3, 308, 513, 30);
 		g.setColor(Color.GREEN);
		g.drawString("PengPhins Robber | Stall: ${Stall.getName()} | State: ${state}", 10, 327);
	} 	
          void showInput() {
		JPanel panel = new JPanel();
		String[] Stalls = new String[this.Stalls.length];
		for(int i = 0; i < Stalls.length; i++) {
			Stalls[i] = this.Stalls[i].getName();
		}
		JComboBox combo = new JComboBox(Stalls);
		panel.add(combo);
		int ret = JOptionPane.showConfirmDialog(null, panel, "Select Stall", JOptionPane.OK_CANCEL_OPTION);
		if (ret == JOptionPane.OK_OPTION) {
			Stall = this.Stalls[combo.getSelectedIndex()];
			state = State.ROBBING;
		} else {
			showInput();
			//TODO: Add Banking, Food Support
		}
	}
  	class Stall {
 		private final String name;
		private final int[] ids;
 		public Stall(String name, int[] ids) {
			this.name = name;
			this.ids = ids;		
}
		public String getName() {
			return name;
		}
 		public int[] getIds() {
			return ids;
		}
  	}
 }

Edited by spodermon

Thx for making it easier for me!

 

i fixed the code layout guys, to get it working save this code as PPStalls.groovy.

 

Bugs/missing functions:
stealing is quite slow, cannot compete with real players

Lack of banking and/or dropping

Does not support food

if some one can add any of these into this code, i would be greatful. thx

import org.osbot.script.Script;
import org.osbot.script.ScriptManifest; 
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Graphics; 

@ScriptManifest(name = "PPStalls", author="PengPhin", version = 1.0D, info = "Only Supports upto Master Farmer")
class PPStalls extends Script {
 	enum State {
		INPUT, IDLE, ROBBING,	
} 	
Stall[] Stalls = [
			new Stall("Seed Stall", [ 7053, 634 ] as int[]), // Add new Stalls here
		new Stall("Cake Stall", [ 2561, 634 ] as int[]), // Add new Stalls here	
		new Stall("Silk Stall", [ 2560, 634 ] as int[]), // Add new Stalls here	
			] as Stall[]; 	
State state = State.INPUT;
	Stall Stall = null; 	
void onStart() {
		if (state == State.INPUT) {			showInput();		
 }	
} 	
int onLoop() {
		switch(state) {
			case State.IDLE:
				return idl();
			case State.ROBBING:
				return steal();
		}
		return 1000 + gRandom(400, 800);
	} 	
         int steal() {
		def Stall = closestObject(Stall.getIds());
		if (Stall != null) {
			if (selectEntityOption(Stall, "Steal-from")) {
				return 2000 + random(200, 500);
			}
		}
		return 1000 + random(200, 1000);
	}
 	void onPaint(Graphics g) {
		g.setColor(new Color(0.1f, 0.1f, 0.1f, 0.7f));
		g.fillRect(3, 308, 513, 30);
 		g.setColor(Color.GREEN);
		g.drawString("PengPhins Robber | Stall: ${Stall.getName()} | State: ${state}", 10, 327);
	} 	
          void showInput() {
		JPanel panel = new JPanel();
		String[] Stalls = new String[this.Stalls.length];
		for(int i = 0; i < Stalls.length; i++) {
			Stalls[i] = this.Stalls[i].getName();
		}
		JComboBox combo = new JComboBox(Stalls);
		panel.add(combo);
		int ret = JOptionPane.showConfirmDialog(null, panel, "Select Stall", JOptionPane.OK_CANCEL_OPTION);
		if (ret == JOptionPane.OK_OPTION) {
			Stall = this.Stalls[combo.getSelectedIndex()];
			state = State.ROBBING;
		} else {
			showInput();
			//TODO: Add Banking, Food Support
		}
	}
  	class Stall {
 		private final String name;
		private final int[] ids;
 		public Stall(String name, int[] ids) {
			this.name = name;
			this.ids = ids;		
}
		public String getName() {
			return name;
		}
 		public int[] getIds() {
			return ids;
		}
  	}
 }

 


Lol doesnt work...

works for me

I exactly did it how i was supposed to add it but when i refresh i dont see anything i did it in the notepad safed it as PPStalls.groovy          all files.

And than when i refresh i dont see anything.

Hello guys! I'm new to this forum so i ain't no pro in scripts(although i know how they work) so my question is: How do you guys copy what he wrote? I've googled for the solution but idk what the problem is, won't come up. Thanks for the help guys! :)

Guest
This topic is now closed to further replies.

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.