Jump to content

how can i check my worn Equipment


Recommended Posts

Posted

so its my first script and i need a little help :) title pretty much says all

my code:

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.ui.EquipmentSlot;
import org.osbot.rs07.api.Equipment;

if (!equipment.isWearingItem(EquipmentSlot.RING, duelring -> duelring.getName().contains("Ring of dueling"))){
            getBank().withdraw("Ring of dueling(8)",1);
            sleep(random(500, 1000));
            bank.close();
            sleep(random(500,1000));
            inventory.getItem("Ring of dueling(8)").interact("Wear");
            sleep(random(500,1000));

and one more question why i am getting this error ? 

5EDz4nYoT36lda5DtvBc_w.png

Posted (edited)
3 minutes ago, bulv3e3 said:

so its my first script and i need a little help :) title pretty much says all

my code:


import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.ui.EquipmentSlot;
import org.osbot.rs07.api.Equipment;

if (!equipment.isWearingItem(EquipmentSlot.RING, duelring -> duelring.getName().contains("Ring of dueling"))){
            getBank().withdraw("Ring of dueling(8)",1);
            sleep(random(500, 1000));
            bank.close();
            sleep(random(500,1000));
            inventory.getItem("Ring of dueling(8)").interact("Wear");
            sleep(random(500,1000));

and one more question why i am getting this error ? 

5EDz4nYoT36lda5DtvBc_w.png

 

You are getting that error because the file name should match the name of the public class inside of it. Also class names should start with a capital letter.

Not sure what your are asking in the first part, you check equipment using the isWearingItem method..

Edited by Explv
Posted
42 minutes ago, Explv said:

 

You are getting that error because the file name should match the name of the public class inside of it. Also class names should start with a capital letter.

Not sure what your are asking in the first part, you check equipment using the isWearingItem method..

yes im checking at the bank area and trying to check if ring is worn and if its not then bot should withdraw a new one to be able to teleport to a clan wars and my in my code im getting this error 44iakCA6Rb61NPi2UY_NzA.png i though mb its cuz of libraries and still cannot resolve this problem 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...