SRL Archive - OSR Help

Getting XP


dousty45

2013-03-27 09:29:14

I'd like to be able to get the current XP of a certain skill.
I'm still learning the API but I'm fluent in Java and powerbot's API so it shouldn't be too hard.

How would I go about doing this?

EDIT: Using the 07 client

The Mayor

2013-03-27 16:57:56

From: dousty45
I'd like to be able to get the current XP of a certain skill.
I'm still learning the API but I'm fluent in Java and powerbot's API so it shouldn't be too hard.

How would I go about doing this?

EDIT: Using the 07 client


You should checkout the OSR include.

(*
GetXP
~~~~~

.. code-block:: pascal

function GetXP(Skill: Variant): Integer;

Returns current xp for a skill. Returns -1 if failed.

.. note::

by DannyRS, based off original by Nielsie95
Last Modified: Feb. 28th, 2013 by DannyRS

Example:

.. code-block:: pascal
*)


and there is also:


(*
XPTillNextLevel
~~~~~~~~~~~~~~~

.. code-block:: pascal

function XpTillNextLevel(Skill: Variant): Integer;

Returns current xp until you level up in a skill.
Returns -1 if failed.

.. note::

by DannyRS
Last Modified: Feb. 28th, 2013 by DannyRS

Example:

.. code-block:: pascal
*)



So in your script you would go something like:


XPTL := XPTillNextLevel('mining');
WriteLn('Xp until level: ' + IntToStr(XPTL));