Skip 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.

Help With Scripts

Featured Replies

i have a text document with a script with .groovy and i created folders to C:Documents and SettingsHOMEMy Documentsosbotscripts and when i click the script selecter i still have no scripts

 

help is appreciated thanks

 

i have a text document with a script with .groovy and i created folders to C:Documents and SettingsHOMEMy Documentsosbotscripts and when i click the script selecter i still have no scripts

 

help is appreciated thanks

 

Make sure the .groovy is named correctly.

If it is named correctly, and saved properly, then it's an error with the script.

i have a text document with a script with .groovy and i created folders to C:Documents and SettingsHOMEMy Documentsosbotscripts and when i click the script selecter i still have no scripts

 

help is appreciated thanks

Can you please tell me what Script you are trying to use and what you are naming it? Thanks.

You placed the script in the wrong location please next time place your scripts in "C:/user/username/OSBot/scripts".

You placed the script in the wrong location please next time place your scripts in "C:/user/username/OSBot/scripts".

Does it matter where the Folder itself is located?

I don't think so

On Topic:

Example:

SilkTrader.groovy

import org.osbot.script.Script

import org.osbot.script.ScriptManifest

import org.osbot.script.mouse.*

import org.osbot.script.rs2.*

import org.osbot.script.rs2.ui.RS2InterfaceChild

import org.osbot.script.rs2.ui.RS2Interface

import org.osbot.script.rs2.map.Position

import org.osbot.script.rs2.model.GroundItem

import org.osbot.script.rs2.model.Item

import org.osbot.script.rs2.model.PrimaryObject

import org.osbot.script.rs2.model.RS2Object

import org.osbot.script.rs2.model.Player

import org.osbot.script.rs2.model.Character

import org.osbot.script.rs2.model.Entity

import org.osbot.script.rs2.model.NPC

import org.osbot.script.rs2.ui.*

import javax.swing.JComboBox;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import java.awt.Color;

import java.awt.Font;

import java.awt.Graphics;

@ScriptManifest(name = "SilkTrader", author = "KrulVis", version = 3.0D, info="Buys/Sells Silkies")

class SilkTrader extends Script {

enum State {

BUY, TOBANK, TOBUY, BANK, START, SELL

}

int i = 0;

int silk = 950

def state = State.START

int bankId = 2213

def starttime = null

//NPC trader = new NPC(106)

int parent1 = 241;

int child1 = 3

int parent2 = 228

int child2 = 1

int parent3 = 64

int child3 = 3

int parent4 = 242

int child4 = 4

int parent5 = 519

int child5 = 2

int silkBought = 0;

Position bankp = new Position(3270, 3169, 0)

Position bankp1 = new Position(2653, 3284, 0)

Position sellp = new Position(2656, 3298, 0)

int p1 = 65

int c1 = 4

int p2 = 242

int c2 = 4

int p3 = 232

int c3 = 3

int p4 = 64

int c4 = 3

int p5 = 230

int c5 = 2

int Y = 0;

int X = 0;

private final Color backColor = new Color(0.1f, 0.1f, 0.1f, 0.7f);

private final Color stringColor = new Color(10, 255, 0);

private final Font font1 = new Font("Calisto MT", 0, 16);

private final Font font2 = new Font("Calisto MT", 0, 11);

void onStart(){

starttime = System.currentTimeMillis();

if(state == State.START){ showInput(); }

/*int Y = client.getMyPlayer().getY()

if(client.getInventory().contains(995) && !client.getInventory().isFull() && Y > 3199){

state = State.BUY

}else if(client.getInventory().isFull()){

state = State.TOBANK

}else if( Y < 3201 && !client.getInventory().isFull()){state = State.TOBUY}*/

}

void showInput() {

JPanel panel = new JPanel();

String[] Options = new String[3];

Options[1] = "Buy";

Options[2] = "Sell";

JComboBox combo = new JComboBox(Options);

panel.add(combo);

int ret = JOptionPane.showConfirmDialog(null, panel, "Select what you want to do.", JOptionPane.OK_CANCEL_OPTION);

if (ret == JOptionPane.OK_OPTION) {

int Choise = combo.getSelectedIndex()

if(Choise == 1){

log("Buying")

state = State.BUY;

}else if(Choise == 2){

log("Selling")

state = State.SELL;

}

} else {

showInput();

}

}

int onLoop(){

switch(state){

case State.BUY:

return buy()

case State.TOBANK:

return toBank()

case State.TOBUY:

return toBuy()

case State.BANK:

return bank()

case State.SELL:

return sell()

}

return 1000 + random(500)

}

int buy(){

if(!client.getInventory().isFull() && client.getInventory().contains(995)){

if(client.getMyPlayer().getY() > 3199){

if(client.getInterface(parent1).isValid()){

selectInterfaceOption(parent1, child1, "Continue")

return 500

}

if(client.getInterface(parent2).isValid()){

if(client.getInterface(parent2).getChild(1).getMessage() == "How much are they?"){

selectInterfaceOption(parent2, 1, "Continue")

return 500

}else {

selectInterfaceOption(parent2, 2, "Continue")

return 500

}

}

if(client.getInterface(parent3).isValid()){

selectInterfaceOption(parent3, child3, "Continue")

return 500

}

if(client.getInterface(parent4).isValid()){

selectInterfaceOption(parent4, child4, "Continue")

return 500

}

if(client.getInterface(parent5).isValid()){

if(selectInterfaceOption(parent5, child5, "Continue")){

silkBought ++;

return 500

}

}

else{

selectEntityOption(closestNPC(106), "Talk-to")

return 1000

}

}else{state = State.TOBUY; return 1000}

}else if(!client.getInventory().contains(995)){ stop(); }

else if(client.getInventory().isFull()){ state = State.TOBANK;return 1000 }

}

int sell(){

if(client.getMyPlayer().getY() > 3295 && client.getInventory().contains(silk)){

if(client.getInterface(p1).isValid()){

selectInterfaceOption(p1, c1, "Continue")

return 500

}

if(client.getInterface(p2).isValid()){

selectInterfaceOption(p2, c2, "Continue")

return 500

}

if(client.getInterface(p3).isValid()){

selectInterfaceOption(p3, c3, "Continue")

return 500

}

if(client.getInterface(p4).isValid()){

selectInterfaceOption(p4, c4, "Continue")

return 500

}

if(client.getInterface(p5).isValid()){

if(selectInterfaceOption(p5, c5, "Continue")){

silkBought = silkBought + 28;

return 500

}

}else{

selectEntityOption(closestNPC(532), "Talk-to")

return 1000

}

}else if(!client.getInventory().contains(silk)){

log("no silk in inventory, going to bank")

state = State.TOBANK

return 1000

}else{

walkExact(sellp)

return 2000

}

}

//BANKING WHILE BUYING

int toBank(){

Y = client.getMyPlayer().getY();

X = client.getMyPlayer().getX();

if(X > 3000){

if(Y > 3171){

walkExact(bankp)

return 1000

}else if(!client.getBank().isOpen()){selectEntityOption(closestObject(bankId), "Bank", "Bank booth"); return 1000}

else{state = State.BANK; return 1000}

}else if(X < 3000){

if(Y > 3286){

walkExact(bankp1)

return 1000

}else if(!client.getBank().isOpen()){ selectEntityOption(closestObject(bankId), "Bank", "Bank booth"); return 1000}

else if(client.getBank().isOpen()){state = State.BANK; return 1000}

}

else{log("Choise couldn't be found: "); return 1000 }

}

int bank(){

X = client.getMyPlayer().getX();

if(X > 3000){

if(client.getInventory().isFull()){

int slot = client.getInventory().getSlotForId(silk)

selectInventoryOption(slot, "Store All")

return 1000

}else if(!client.getInventory().isFull()){state = State.TOBUY;return 100;}

}else if(X < 3000){

if(!client.getInventory().contains(silk)){

client.getBank().withdraw(silk, 0)

return 1000

}else{state = State.SELL; return 1000}

}

}

int toBuy(){

Y = client.getMyPlayer().getY();

if(Y < 3200){

walkExact(new Position(3301, 3204, 0))

return 1000

}else if(Y > 3200) { state = State.BUY; return 1000}

}

void onPaint(Graphics g) {

String runtime = format(System.currentTimeMillis() - starttime)

g.setColor(backColor);

X = client.getMyPlayer().getX();

String wat = "";

if(x > 3000){wat = "Bought";}else if(X < 3000){wat = "Sold";}

g.fillRect(1, 51, 209, 94);

g.setFont(font1);

g.setColor(stringColor);

g.drawString("Krulvis' Silk Trader V2.0", 7, 76);

g.setFont(font2);

g.drawString("Running: " + runtime, 7, 130);

g.drawString("Silk "+wat+":" +"(${silkBought})", 7, 100);

}

g.drawString(test, 50, 315);

}//smart

String format(final long time) {

final StringBuilder t = new StringBuilder();

final long total_secs = time / 1000;

final long total_mins = total_secs / 60;

final long total_hrs = total_mins / 60;

final int secs = (int) total_secs % 60;

final int mins = (int) total_mins % 60;

final int hrs = (int) total_hrs % 24;

if (hrs < 10) {

t.append("0");

}

t.append(hrs);

t.append(":");

if (mins < 10) {

t.append("0");

}

t.append(mins);

t.append(":");

if (secs < 10) {

t.append("0");

}

else if (secs < 0){

t.append("0")

}

else{

t.append(secs);

}

return t.toString();

}

}

Does it matter where the Folder itself is located?

I don't think so

 

Your such a ignorant guy around the forums, it does matter where the folder itself is located reason, the client only picks up scripts which is located in the folder structure which I gave him, as you see he said "created folders to C:Documents and SettingsHOMEMy Documentsosbotscripts" meaning he created the folder, so he created the folder in the wrong section I've fixed minor mistakes that people encounter when trying to add scripts to their client so I myself have experience in what I'm doing as you see a lot off people have used my service which is located here http://osbot.org/forum/topic/499-free-bot-services/

 

Also mate if you can run your client under a batch that will be great because it will show us the errors you encounter.

 

@echo offjava -jar "osbot 1.2.2.jar"exit
 
Save it as Run.bat (All Files) and make sure the client and the batch file is in the same folder when running the extension .bat

Your such a ignorant guy around the forums, it does matter where the folder itself is located reason, the client only picks up scripts which is located in the folder structure which I gave him, as you see he said "created folders to C:Documents and SettingsHOMEMy Documentsosbotscripts" meaning he created the folder, so he created the folder in the wrong section I've fixed minor mistakes that people encounter when trying to add scripts to their client so I myself have experience in what I'm doing as you see a lot off people have used my service which is located here http://osbot.org/forum/topic/499-free-bot-services/

 

Also mate if you can run your client under a batch that will be great because it will show us the errors you encounter.

 

 

@echo offjava -jar "osbot 1.2.2.jar"exit
 
Save it as Run.bat (All Files) and make sure the client and the batch file is in the same folder when running the extension .bat

 

Ignorant?

I'm sorry if you took it that way.

 

I was asking the question, then stating that I don't think it matters where it's located.

 

Sorry if you read that in a rude manor, as that was not my intention for it.

  • 2 weeks later...

Make sure once you change the file extension to .groovy, that you save it as 'all files' not 'text document' other wise it won't load on the script selector

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.