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.

Shop Interface (just like Bank but then for shops!)

Featured Replies

Hello,
 
This snippet is for people that want to interact easily with shops (like a general shop, runes shop, etc...).
The commands are very similar to bank and to start of you import the source/jar and make a new shop:

Shop s = new Shop(this); // This must be a script object so your main file does fine!
if (s.isOpen()){
    // And close the shop immediately 
    s.close();
}

As you can see the isOpen method is there just like the one in the bank class.
Next you can get a ShopItem by using this methods:

ShopItem[] allItems = s.getAllShopItems();
ShopItem itemSlot4 = s.getShopItem(4); //4 is the slotID you can debug that by using the store debugger
ShopItem hammer = s.getShopItemByName("Hammer"); // Wont break on patches 
ShopItem byId = s.getShopItemByID(123); // You can use it if you want but you should prefer ByName

And for the final part you can interact with the shop items.

itemSlot4.value(); // Wont return a value you must catch it in your onMessage(String s)
itemSlot4.buy1();
hammer.buy5();
byId.buy10()

int amountOfHammers = hammer.getAmount();
String hammerName = hammer.getName();
int hammerId = hammer.getID();
int hammerSlotID = hammer.getSlotID();

// You can also get the slot rectangle if you need it for painting:
Rectangle rect = hammer.slot;

Now you can buy stuff from the store! Remember: the ShopItem won't update you need to refresh it everytime by using hammer = s.getShopItemByName("Hammer"); (for example)
There are also a few commands you can use for the shop like getting the shopname:

// First check if the shop is open
s.updateShopName();
s.updateInstructions();
String shopName = s.getShopName();
String instructions = s.getInstructions();

Screens (using the ShopDebugger):

3wwFH.png

3wwK3.png

3wwVI.png

3wy4K.jpg

 

Download (jar): http://uppit.com/v6mr2nxmamsm/Shop.jar

Source (pastebin):
If you use the source then make a new package called com.merccy.Shop and place the Shop.java and ShopItem.java there!
 
Download ShopDebugger (jar): http://uppit.com/68erm8t8a9bh/ShopDebugger.jar
 
Credits:
Jelknab - Gave me his debugger which contained the search for item loop (which I modified)
XavierM - Told me that you would just have to use the x/y for clicking the items.
 
Goodluck

 

Edited by Merccy

  • Author

Great coding! Keep up the great work. I might just actually implement this in my farming script tongue.png.

 

Thanks!

Good job! x3
 

Peace :D
 

grtz
H0ppy

 

Edited by H0ppy

  • Author

This is da bomb tongue.png

 

Thank you smile.png. Hopefully OSBot will implement this soon™

  • Author

Thanks :)

QBot it still uses rectangles but with some maths it will automatically make them according to the slotID.

First of all thanks for this! Really appreciate it.

However, is there a way to see the amount of an item in the shop?

 

Edit: Never mind, had a blank spot in my brain. Thanks again!

 

EDIT2: This spam clicks when i only want to buy once, any idea how to stop?

Edited by Moody

Does this spam buy for anyone else?

 

 

It's spam clicking for me and I haven't been able to solve the problem yet. I don't like the osbot API very much.

 

If I could do someting simple like this:

public void buy10() {

        Point p = item.getPoint();

        scr.client.moveMouseTo(p);

        scr.sleep(Script.random(250, 300));

        scr.client.clickMouse(false);

        Point optionPoint = new Point(p.x, p.y + Script.random(67, 70));

        scr.client.moveMouseTo(optionPoint);

        scr.client.clickMouse(true);

    }

I would be able to make something that atleast works, but we have to use MouseDestinations, RectangleDestinations and have a bunch of extra arguments to the mouse methods and I can't find any explanation of these objects and methods. http://osbot.org/api/ is not very helpful.

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.