Jump to content

Hello


mousbros

Recommended Posts

40 minutes ago, mousbros said:

Hello,

 

how do I let the script know that the Player is level 3 and if the player is level 3 he should go on, else he wouldnt.

so I need to get the combat level and how do I return that.

 

thank you guys

https://osbot.org/api/org/osbot/rs07/api/model/Player.html

 

myPlayer().getCombatLevel();

It's in the API section I linked. Try learning how to read the API docs. A lot of questions can be answer by shifting through them and messing around with wording.

Link to comment
Share on other sites

6 minutes ago, Gunman said:

https://osbot.org/api/org/osbot/rs07/api/model/Player.html

 


myPlayer().getCombatLevel();

It's in the API section I linked. Try learning how to read the API docs. A lot of questions can be answer by shifting through them and messing around with wording.

I was alread ythere but how can I fully implement that in the script. thats the problem I'm facing. Thank you for the answer tho!

Link to comment
Share on other sites

38 minutes ago, mousbros said:

I was alread ythere but how can I fully implement that in the script. thats the problem I'm facing. Thank you for the answer tho!

:???:

It return an int of your player level. If you combat level is 3 it will return 3. So you can do something like this.

if (myPlayer().getCombatLevel() < 20) {
  //get Combat levels or whatever
} else {
  //other code.
}

So as long as your combat level is below 20 it won't go past the first if statement. You probably should learn some Java first. Try reading this a bit.

https://www.programiz.com/java-programming

Link to comment
Share on other sites

On 2/28/2020 at 7:50 AM, Gunman said:

:???:

It return an int of your player level. If you combat level is 3 it will return 3. So you can do something like this.


if (myPlayer().getCombatLevel() < 20) {
  //get Combat levels or whatever
} else {
  //other code.
}

So as long as your combat level is below 20 it won't go past the first if statement. You probably should learn some Java first. Try reading this a bit.

https://www.programiz.com/java-programming

thanks you, I hate reading im learning trough projects and face problems like this and overcome them.

I wont stop untill I got a fully functional script and hopefully understand JAVA way better. 

thanks for the help

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