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.

Hovering entity's option

Featured Replies

  • Author
                if(myPlayer().getInteracting() != null) {
                NPC npc = npcs.closest(npc_name);
                if (npc != null && npc.isVisible()) {
                    if (hoverEntityOption(npc, "Attack")) {
                        if (myPlayer().getInteracting() != npc) {
                            if (npc.isVisible()) {
                                npc.interact("Attack");
                                log("Attacking " + npc_name);
                                sleep(random(400, 800));
                            } else {
                                camera.toEntity(npc);
                            }
                        }
                    }
                }
            }else {
                if(menu.isOpen()) {
                    if(mouse.click(false)) {
                        for(int i = 0; i < 100 && !myPlayer().isUnderAttack(); i++) {
                            sleep(random(20,40));
                        }
                    }
                } else {
                    if(npc != null && npc.isVisible()) {
                        if(npc.interact("Attack")) {
                            for(int i = 0; i < 100 && !myPlayer().isUnderAttack(); i++) {
                                sleep(random(20,40));
                            }
                        }
                    } else if(npc != null && !npc.isVisible()) {
                        camera.toEntity(npc);
                    } else {
                        log(npc_name + " gone?");
                    }
                }
            }

I'm having trouble implementing your method.

 

What am I doing wrong? The script keeps logging "npc_name gone?"

 

Don't use the method of how to attack a goblin, that was just an example. There are plenty of other tutorials which can help you more. This snippet is meant for those who knows java.

I'm not using this for attacking goblins.

 

I'm using the variable npc_name, just implementing this into a fighter script.

  • 1 month later...

I like this

for(int i = 0; i < 100 && !myPlayer().isUnderAttack(); i++) {
	sleep(20, 40);
}

Good job wink.png

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.