Jump to content

Cannot activate prayer


AlphaBeta

Recommended Posts

	private void pray() throws InterruptedException {
                //open prayer tab
		if (!getTabs().open(Tab.PRAYER)) {
			getTabs().open(Tab.PRAYER);
		} else {
                       
                        //flick rapid heal prayer
			getPrayer().set(PrayerButton.RAPID_HEAL, true);
			sleep(random(500,1000));
			getPrayer().set(PrayerButton.RAPID_HEAL, false);
                        
                        //update the last prayer time to check when to pray again
			lastPray = System.currentTimeMillis();
		}
	}

Hi,

 

I am trying to make a simple rapid heal script for NMZ, but for some reason I can't activate the prayer. It would just open the prayer tap and hover over it. The lastPray would update, so I know that the script does go through the else statement.

 

Thanks.

	private void pray() throws InterruptedException {
		//open prayer tab
		if (!getTabs().open(Tab.PRAYER)) {
			getTabs().open(Tab.PRAYER);
		} else {
			//flick rapid heal prayer
			RS2Widget rapidHeal = getWidgets().get(541,11);
			if(rapidHeal != null && rapidHeal.isVisible()){
				rapidHeal.interact("Activate");
				sleep(random(500,1000));
				rapidHeal.interact("Deactivate");
				lastPray = System.currentTimeMillis();
			}
		}
	}

I got it to work using widget. 

  • Like 1
Link to comment
Share on other sites

Have you tried the new Prayer API update in .108? Make sure to also compile on the new version.

The new Prayer API update did fixed it. can you explain what is the advantages and disadvantages of using the Prayer API vs using widget? Right now i'm using the Prayer API because I think it is simply more reliable.

Edited by AlphaBeta
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...