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.

How to use an item or cast a spell

Featured Replies

I'm wondering how to tell the bot to teleport to castlewars if the inventory is full and then do a house teleport after depositing the items. I have the Bank Area part already done.

 

Not sure how to go about this as I'm trying to write my first script.

 

Any help is appreciated.

Edited by pittasium

That's to teleport back to your home if using spell book when inventory isn't full, haven't got any duel rings to make you the other part.

        if (!client.getInventory().isFull()) {
            magicTab.open();
            magicTab.castSpell(Spell.HOME_TELEPORT);
        }

well you will need to write your own method to interact with equipment inside the tab

lucky for you i had the exact same problem so  i wrote a little method to interact with a ring item  in the equipment tab! which i will link below

 

http://osbot.org/forum/topic/7274-interacting-with-equipment/

 

you will put this method inside your script

 

then you will call it as such

interactWithEquipment("STRING",DUEL_RING INT);

as duel rings have many charges and all have separate int's you will need to do a for loop

but i have that in my booleans so i don't worry about that so i use this method to get the id of the ring

   int i = equipmentTab.getItemInSlot(EquipmentSlot.RING).getId();

so you will need a boolean's something that looks like this

    private boolean hasRingOfDuelingEquiped() {
        for (int i : rods) {
            if ((equipmentTab.isWearingItem(EquipmentSlot.RING, i))) {
                return true;
            }
        }
        return false;
    }

Rods is an variable i have set

private final int rods[] = { 2552, 2554, 2556, 2558, 2560, 2562, 2564, 2566 };
    private boolean inventoryHasRing() {
        for (int i : rods) {
            if (client.getInventory().contains(i)) {
                return true;
            }
        }
        return false;
    }

once you have completed this phase you will need another boolean to check if the interface of the duel ring is open and if so you will need to interact with it

sorry i can't spoon fed you anymore of my work hope this helps you!

 

 

 

 

well you will need to write your own method to interact with equipment inside the tab

lucky for you i had the exact same problem so  i wrote a little method to interact with a ring item  in the equipment tab! which i will link below

 

http://osbot.org/forum/topic/7274-interacting-with-equipment/

 

you will put this method inside your script

 

then you will call it as such

interactWithEquipment("STRING",DUEL_RING INT);

as duel rings have many charges and all have separate int's you will need to do a for loop

but i have that in my booleans so i don't worry about that so i use this method to get the id of the ring

   int i = equipmentTab.getItemInSlot(EquipmentSlot.RING).getId();

so you will need a boolean's something that looks like this

    private boolean hasRingOfDuelingEquiped() {
        for (int i : rods) {
            if ((equipmentTab.isWearingItem(EquipmentSlot.RING, i))) {
                return true;
            }
        }
        return false;
    }

Rods is an variable i have set

private final int rods[] = { 2552, 2554, 2556, 2558, 2560, 2562, 2564, 2566 };
    private boolean inventoryHasRing() {
        for (int i : rods) {
            if (client.getInventory().contains(i)) {
                return true;
            }
        }
        return false;
    }

once you have completed this phase you will need another boolean to check if the interface of the duel ring is open and if so you will need to interact with it

sorry i can't spoon fed you anymore of my work hope this helps you!

 

way to use the fore each :)

 

lol

 

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.