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.

Get interval between attacks

Featured Replies

So I'm making an AIO fighter and one feature I want to add in is prayer flicking. This of course means I need to figure out the interval between attacks so I can know when to flick prayer. Seems simple enough, but there are a lot of roadblocks I've come across and I'm out of ideas. Here's what I've tried:

*Determining attack animation ID and use that. This won't work because:

1) I'd need to somehow differentiate the block animation ID and the attack ID

2) The NPC doesn't always show the attack animation due to maybe blocking or for some other reason.

 

*Use hitsplats on my player. Unfortunately, for some reason, there isn't any hitsplats API anymore so this isn't possible. An alternative I was thinking of is taking the time between HP changes. This won't work because an NPC might not do damage each attack, leading to an inaccurate interval.

 

Anyone have any other ideas or alternatives I could use? I'd greatly appreciate it.

I'd assume you use a cycle to figure out when you were last hit and then with that info decide which tick to activate prayer, Too much thinking for me though :boge: 

Im interested in this as well curious how you could go about that only script i've seen with that feature is @FrostBug FrostCaves script but could be wrong may others have it :think:

  • Author
12 minutes ago, El_Maestro said:

Have you considered looking into monitoring game ticks? The majority, if not all (correct me if I am wrong), monsters seem to attack at the same rate. If they do then their attack speed is not necessary. 

There is a huge variety of attack speeds that NPCs have. Having a static value wouldn't work out very well.

13 minutes ago, HeyImJamie said:

I'd assume you use a cycle to figure out when you were last hit and then with that info decide which tick to activate prayer, Too much thinking for me though :boge: 

That's what I'm asking how to do. How could I figure out time between I get hit?

20 minutes ago, DeadPk3r said:

Im interested in this as well curious how you could go about that only script i've seen with that feature is @FrostBug FrostCaves script but could be wrong may others have it :think:

The vast majority of all monsters attack at a 4-tick rate. Though a general assumption can't be made since some do break the norm (trolls are slower, for example).
For my script I could simply hardcode their attackspeeds (all of them are 4 ticks except for jad on 8 ticks).

I don't think there's a particularly good way to do it without analyzing the enemy over time. The best approach is probably to make a suggestion to the dev team about hooking hitsplats again.

Edited by FrostBug

  • Author
17 minutes ago, FrostBug said:

The vast majority of all monsters attack at a 4-tick rate. Though a general assumption can't be made since some do break the norm (trolls are slower, for example).
For my script I could simply hardcode their attackspeeds (all of them are 4 ticks except for jad on 8 ticks).

I don't think there's a particularly good way to do it without analyzing the enemy over time. The best approach is probably to make a suggestion to the dev team about hooking hitsplats again.

OK, let's say I want to implement to flick every 4 ticks. How do I know when to start the tick count? Won't I still need to determine when I get attacked so I can starting counting ticks?

1 hour ago, DrizzyBot said:

OK, let's say I want to implement to flick every 4 ticks. How do I know when to start the tick count? Won't I still need to determine when I get attacked so I can starting counting ticks?

You can look out for his first attack animation.

It's true that animations can hide/cancel eachother, but you should be able to see their first attack.
1. If the monster is aggressive and attacks first, there you have it.
2. If the monster is passive and the player attacks first, in order for its first animation to be cancelled, you would have to attack twice before his first attack (unlikely).

In rare cases where you attack an aggressive monster (who is about to hit you) first, you should still be able to see an attack animation eventually.

EDIT: If you do get hitsplat API added, you can use the timestamp of the first hitsplat on you for melee enemies.

Edited by FrostBug

  • Author
1 hour ago, FrostBug said:

You can look out for his first attack animation.

It's true that animations can hide/cancel eachother, but you should be able to see their first attack.
1. If the monster is aggressive and attacks first, there you have it.
2. If the monster is passive and the player attacks first, in order for its first animation to be cancelled, you would have to attack twice before his first attack (unlikely).

In rare cases where you attack an aggressive monster (who is about to hit you) first, you should still be able to see an attack animation eventually.

EDIT: If you do get hitsplat API added, you can use the timestamp of the first hitsplat on you for melee enemies.

How would you differentiate between an attack animation and defense animation?

6 hours ago, DrizzyBot said:

How would you differentiate between an attack animation and defense animation?

They're most likely consistent in their relativity.

Eg. Attack is always higher ID than defense or the other way around

  • Author
14 hours ago, FrostBug said:

They're most likely consistent in their relativity.

Eg. Attack is always higher ID than defense or the other way around

Didn't even think about that! You're probably right, going to take a look at that. Thanks for being helpful!

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.