Jump to content

Quests


harrypotter

Recommended Posts

I'm continuing on with my learning on how to use the API, I'm currently looking into how to detect the current progress of a quest. I can see via the API that I can check if is quest is complete or started however I can't find anything that will assist in tracking the current progression of a quest?

Thanks for your help!

Link to comment
Share on other sites

Just now, Container said:

Without knowing shit; MAYBE you can write a method that will open said quest window and check the text in the widget that opens. If widgetText == "Soemthing something" -> set quest progress. I don't know if there's anything in the API that does anything like that.

There's has to be another method to it as I've used @Token's Quest Script on a trial and it didn't have to check this kind of thing, so reluctant to implement such a method.

Link to comment
Share on other sites

Just now, Container said:

Wrong. It's easier to learn if you just try. You can always learn best practice later.

I'd disagree, I have a software development background and I know from first hand experience that trying to shift bad habits isn't easy, why not kill those bad habits before they develop?

  • Like 1
Link to comment
Share on other sites

4 minutes ago, harrypotter said:

How do you find these configs, is it documented in the API?

In the osbot debug options, turn configs on. Do something in the quest to proceed to the next stage (or even start the quest) and you'll see the id for that quest as well as the value which indicated progress.

  • Like 1
Link to comment
Share on other sites

34 minutes ago, harrypotter said:

I'm continuing on with my learning on how to use the API, I'm currently looking into how to detect the current progress of a quest. I can see via the API that I can check if is quest is complete or started however I can't find anything that will assist in tracking the current progression of a quest?

Thanks for your help!

Use configs.

A config consists of an ID and a value. You can view them as they are updated by selecting the configs option in the OSBot settings.

As you progress through a quest, an associated config's value will be updated indicating the progress.

For example, I think for Tutorial Island the id is 281, so you get the progress using:

int progress = getConfigs().get(281);

This value will change as you progress, for example, when you start Tutorial Island it would be something like:

281 : 0

After you talk to the RuneScape Instructor it might be something like:

281 : 10

Etc.

There is a small section on this in my Scripting 101 tutorial, the link for which is in my signature.

  • Like 4
Link to comment
Share on other sites

19 minutes ago, Explv said:

Use configs.

A config consists of an ID and a value. You can view them as they are updated by selecting the configs option in the OSBot settings.

As you progress through a quest, an associated config's value will be updated indicating the progress.

For example, I think for Tutorial Island the id is 281, so you get the progress using:

int progress = getConfigs().get(281);

This value will change as you progress, for example, when you start Tutorial Island it would be something like:

281 : 0

After you talk to the RuneScape Instructor it might be something like:

281 : 10

Etc.

There is a small section on this in my Scripting 101 tutorial, the link for which is in my signature.

Great, again thanks for you help!

Link to comment
Share on other sites

1 hour ago, Explv said:

Use configs.

A config consists of an ID and a value. You can view them as they are updated by selecting the configs option in the OSBot settings.

As you progress through a quest, an associated config's value will be updated indicating the progress.

For example, I think for Tutorial Island the id is 281, so you get the progress using:

int progress = getConfigs().get(281);

This value will change as you progress, for example, when you start Tutorial Island it would be something like:

281 : 0

After you talk to the RuneScape Instructor it might be something like:

281 : 10

Etc.

There is a small section on this in my Scripting 101 tutorial, the link for which is in my signature.

This is great however I can't seem to check if a quest is actually started or not:

if (!script.getQuests().isStarted(Quests.Quest.IMP_CATCHER)) {
}

According to the API this should return a boolean: https://osbot.org/api/org/osbot/rs07/api/Quests.html#isStarted-org.osbot.rs07.api.Quests.Quest-

This is however throwing the following error:

[ERROR][Bot #1][03/21 01:41:24 PM]: Error in script executor!
java.lang.NullPointerException
	at ImpCatcher.run(ImpCatcher.java:20)
	at Quest.run(Quest.java:66)
	at Main.onLoop(Main.java:88)
	at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ih:18)
	at java.lang.Thread.run(Thread.java:745)

This would suggest that the following param is null:

Quests.Quest.IMP_CATCHER

Am I missing something obvious here?

Edit:- 

This was a problem with my class, resolved.

Edited by harrypotter
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...