Simba Code:(*
GetWildernessLevel
~~~~~~~~~~~~
.. code-block:: pascal
function GetWildernessLevel: Integer;
Returns the wilderness level. Defaults to -1 if the number can't be read (out of wilderness)
.. note::
by litoris
Example:
.. code-block:: pascal
*)
function GetWildernessLevel : Integer;
var
Lev : String;
begin
Lev := GetNumbers(GetTextAtExWrap(490, 85-50, 508, 102-50, 0, 10, 1, 1939681, 20, XPChars));
if ((Lev <> '') or (Lev <> ' ') or (Lev <> ' ') or (Lev <> ' ')) then
Result := StrToInt(Lev)
else
Result := -1;
end;
I came up with this manually while working on my current script, I was amazed that the include didn't have such a function yet.
Anyway, this function basically read the wilderness level. I tested it at various levels, it works, but I would really like it if some others could also test it. I have to use getnumbers, or else the string will also include a few colons when you are at single-digit levels.
It's uses are twofold: It can both tell you what level you are(useful for teleporting) and tell you whether you are in the wilderness, because it returns -1 if the string is empty. I'll send a pull request after some people test it, don't want a disaster like the last time :P

