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.

[osbot or script issue?] Finally found out whats causing deaths while running my script. but how do i solve it?

Featured Replies

Been having some issues with one of my combat scripts, it died seemingly random. buy i  finally managed to be at the PC when the script was messing up.

What happened was that when the client tried shift dropping a vial, it instead normally clicked on it so basically it clicked "use" on it. and then went on to proceed with the script. it's just that it wont be able to interact with anything since all the interact options is now replaced with use vial > on. And for some reason the osbot wont notice this which results in the bot doing nothing since it cant use any interactions in either the game window or in the inventory. which means even though i have super strict priorities in the script to always eat and teleport away above anything else, it cant execute it cause it cant interact with anything cause the vial is highlighted for use and replace all the items other interactions.

So i was thinking, I'll just add a check for it; if something is highlighted. but how do i do that?

 And also is this a osbot bug i should report, cause im 99% sure the logic in my script isn't causing this. I'm sure this isn't a big problem if your script involves walking around alot since it would simply normal click in the game window and the "use" would go away. but my script is in a super crowded area and walks between 2 tiles that has mobs on them which means it pretty much allways relies on right click>walk here which it cant do when the item is highlighted.

to sum it shortly: highlighted(use) item is fucking my script.

if (getInventory().isItemSelected()) {

getInventory().deselectItem();

}

2 minutes ago, dot_b0T said:

Been having some issues with one of my combat scripts, it died seemingly random. buy i  finally managed to be at the PC when the script was messing up.

What happened was that when the client tried shift dropping a vial, it instead normally clicked on it so basically it clicked "use" on it. and then went on to proceed with the script. it's just that it wont be able to interact with anything since all the interact options is now replaced with use vial > on. And for some reason the osbot wont notice this which results in the bot doing nothing since it cant use any interactions in either the game window or in the inventory. which means even though i have super strict priorities in the script to always eat and teleport away above anything else, it cant execute it cause it cant interact with anything cause the vial is highlighted for use and replace all the items other interactions.

So i was thinking, I'll just add a check for it; if something is highlighted. but how do i do that?

 And also is this a osbot bug i should report, cause im 99% sure the logic in my script isn't causing this. I'm sure this isn't a big problem if your script involves walking around alot since it would simply normal click in the game window and the "use" would go away. but my script is in a super crowded area and walks between 2 tiles that has mobs on them which means it pretty much allways relies on right click>walk here which it cant do when the item is highlighted.

to sum it shortly: highlighted(use) item is fucking my script.

 

"cause im 99% sure the logic in my script isn't causing this"

I wouldn't be so sure about that...

Post your code, otherwise we cannot help.

1 minute ago, Explv said:

 

"cause im 99% sure the logic in my script isn't causing this"

I wouldn't be so sure about that...

Post your code, otherwise we cannot help.

Shift dropping sometimes does cause this issue whether it be from lag or god knows what, but its simple fix as shudsy posted.

for (int i=0; i< 28; i++) {
			if (inventory.isItemSelected())
				break;
			Item item = inventory.getItemInSlot(i);
			if (item != null && item.nameContains(Constants.ITEM_NAME)) {
				inventory.interact(i);
				if (i == 27)
					Utils.condSleep(5000, 20, () -> inventory.getItemInSlot(slot) == null);
			}
		}

A rough solution to your problem

Pay attention to the

if (inventory.isItemSelected())
				break;

part

+ What Shudsy say. Deselect item if it's selected before doing shift dropping

Edited by nosepicker

  • Author
Just now, TrekToop11 said:

Shift dropping sometimes does cause this issue whether it be from lag or god knows what, but its simple fix as shudsy posted.

yes I figured it would be simple solution to have a check for it but just thought it silly to be needed but maybe I'm just spoiled. haha

 

6 minutes ago, Explv said:

 

"cause im 99% sure the logic in my script isn't causing this"

I wouldn't be so sure about that...

Post your code, otherwise we cannot help.

Well since I nowhere in the script call for the client to use a vial it's obviously not something I'm directly causing. however now i know how i can prevent it with a simple check :) just thought I'd share it, maybe someone else had problems with deaths without knowing from what.

  • Author
16 minutes ago, Shudsy said:

if (getInventory().isItemSelected()) {

getInventory().deselectItem();

}

Thank you man :), should probably have poked around my self a bit more. but much thanks for the spoonfeed <3

Yeah, unfortunately this is something you've got to check for. You can't expect the client to click accurately 100% of the time, after all this is a live game so barriers such as latency fluctuation can cause misclicks.

There are other similar situations you might want to consider adding checks for as well, for example if the script misclicks on a bank at an inopportune time, misclicks a ladder, accidentally opens the store/collection box, etc. 

Best of luck

Apa

Since you're doing combat and dropping vials only, can't you just untoggle shift drop and i don't think you will have that problem anymore. 

2 hours ago, Shudsy said:

if (getInventory().isItemSelected()) {

getInventory().deselectItem();

}

Fucking hell, I didn't know there was deselectItem() lol, I used to do this shit 

if (s.getInventory().isItemSelected()) {
            s.getMouse().click(new RectangleDestination(s.bot, new Rectangle(10,10,500,330)));
        }

 

:feels:

3 minutes ago, Viston said:

Fucking hell, I didn't know there was deselectItem() lol, I used to do this shit 

if (s.getInventory().isItemSelected()) {
            s.getMouse().click(new RectangleDestination(s.bot, new Rectangle(10,10,500,330)));
        }

 

:feels:

picard-facepalm.jpg

Create an account or sign in to comment

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.