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 constantly check if under attacked?

Featured Replies

  • Author
8 hours ago, Sysm said:

YEET :gnome:

yeet

8 hours ago, Juggles said:

If using states, put it as your first state so it will prioritze over everything 

Thanks!

16 hours ago, The Legman said:

yeet

Thanks!

YEEEEEEEEEEEEEEEEEEEEEEETTTTTTTTTTTTTTTTTTTTTT

u got my skype u know u can ask me code questions m8

I personally have a thread that checks for danger (players within x combat wearing x items etc) while running other tasks and then if a danger is found, activate a handlePker task that prioritises above all others to escape.

  • Author
12 hours ago, Sysm said:

YEEEEEEEEEEEEEEEEEEEEEEETTTTTTTTTTTTTTTTTTTTTT

u got my skype u know u can ask me code questions m8

no idea what your on about :doge:

 

On 24-11-2017 at 12:14 PM, The Legman said:

onLoop.PNG.2e966a32ebee923378562df4e2e9c591.PNG This currently how I build my scripts. The issue is when it runs through a task, such as normalRocks ( a completely different script btw), it will never interrupt that task while it's mid way done - which is what I want it to do. Thus I will end up trying to put that code in the onLoop. Thanks!

Stopscript == true?

 

If you're using conditional sleeps, your bot will be unresponsive to attacking players. Add a condition in your conditional sleep to check if you're under attack to break out of the sleep, and have your "under attack" case be first in your code so it takes priority.

new ConditionalSleep(45000){
	public boolean condition() throws InterruptedException {
		return myPlayer().isUnderAttack() || (other conditions);
	}
}.sleep();

 

You can add multi threading support which would make it "constant" anti-pk.
Teleblock detector should be done by adding a message listener and don't forget about the timing of the tb when it is off(parse that from the chatbox message)!

Edited by progamerz

Just to expand on what HeyImJamie said. Only teleporting after you're under attack might be too late and hopping afterwards is impossible. You can iterate through the players that are loaded and check if their combat level can attack you(Example: Your combat level is 30, they're 45 and you're in 10 wilderness it won't hop or teleport. If they're 37, you would hop.). If you don't want to do that, an easier way to do it would be to check the size of local players and if it's greater than 2 it will hop(It counts your player). This will hop no matter what though, whether they can attack you or not. Then check for active tasks. 

 

P.S I would also recommend checking for teleblock with onMessage so that you don't have the bot spamming the teleport. And isUnderAttack so it's not trying to hop worlds.

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.