Skip 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.

Make a bot pray at an altar?[new]

Featured Replies

Hey, I'm new to scripting and just wondering how I would make my bot pray at an altar every x seconds. Thanks. (example please)

use #interact to interact with the altar, make a timer to interact with it every x seconds

Hey, I'm new to scripting and just wondering how I would make my bot pray at an altar every x seconds. Thanks. (example please)

why every x seconds? why not do it at prayer %?

 

for the interaction:

RS2Object ALTER = closestObjectForName("Alter");

if(/*Condition you want to pray at*/){
if(ALTER != null){

alter.interact("Pray-at", true, true);
sleep(random(300, 900)):

}

}

i think (sorry if im wrong i am very tired and just woke up XD )

edit: id also add an animation/moving check but i wasnt sure if you'd be standing at time before praying

Edited by Isolate

Add that in the script outside of onLoop() : 

final int[] ALTAR_IDS = { ALTARIDHERE#, #, #, # }; // add the ID's there.

onLoop() :  

Entity altar = closestObject(ALTAR_IDS); // The reason i didn't get by name is due to the fact that he might want multiple altars.


if (altar.isVisible()) {
	if (!client.getMyPlayer().isMoving()) {
               if (!client.getMyPlayer().isAnimating()) {
               altar.interact("Pray-at"); //not sure what the actual right click option is
               sleep(random(1250, 2250));
               }
        }
}

As the the at x second thing, you REALLY shouldn't use that. You'd have to use a Timer class, (i have one if you want it.) And it wouldn't be as.. accurate. 

 

It would be much more efficient if you made the script go to the altar at a certain amount of remaining prayer points.

You can go to the API section at the top to find what the check prayer points method is. I personally do not know it.

Edited by Bitter

Add that in the script outside of onLoop() : 

final int[] ALTAR_IDS = { ALTARIDHERE#, #, #, # }; // add the ID's there.

onLoop() :  

Entity altar = closestObject(ALTAR_IDS); // The reason i didn't get by name is due to the fact that he might want multiple altars.


if (altar.isVisible()) {
	if (!client.getMyPlayer().isMoving()) {
               if (!client.getMyPlayer().isAnimating()) {
               altar.interact("Pray-at"); //not sure what the actual right click option is
               sleep(random(1250, 2250));
               }
        }
}

As the the at x second thing, you REALLY shouldn't use that. You'd have to use a Timer class, (i have one if you want it.) And it wouldn't be as.. accurate. 

 

It would be much more efficient if you made the script go to the altar at a certain amount of remaining prayer points.

You can go to the API section at the top to find what the check prayer points method is. I personally do not know it.

 

Why visiblity check? Interact method will auto rotate camera and thus if you visibility check you may not pray when needed and maybe die if in combat

 

  • Author

Thanks a lot for your help guys.

 

Edited by Tom1759

  • Author

why every x seconds? why not do it at prayer %?

 

for the interaction:

RS2Object ALTER = closestObjectForName("Alter");

if(/*Condition you want to pray at*/){
if(ALTER != null){

alter.interact("Pray-at", true, true);
sleep(random(300, 900)):

}

}

i think (sorry if im wrong i am very tired and just woke up XD )

edit: id also add an animation/moving check but i wasnt sure if you'd be standing at time before praying

How would I do the condition? Like if I wanted it to be if prayer percent is under 50?

How would I do the condition? Like if I wanted it to be if prayer percent is under 50?

Familiarise yourself with the OSBot API.

 

 

This may work, you'll have to test.

if(sA.client.getSkills().getCurrentLevel(Skill.PRAYER)/sA.client.getSkills().getLevel(Skill.PRAYER)*100 < 50) {
// do stuff

}

  • Author

 

Familiarise yourself with the OSBot API.

 

 

This may work, you'll have to test.

if(sA.client.getSkills().getCurrentLevel(Skill.PRAYER)/sA.client.getSkills().getLevel(Skill.PRAYER)*100 < 50) {
// do stuff

}

 

Alright thanks man, and yeah I couldn't find anything with prayer in the API

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.