begginer
2012-04-21 05:57:39
I have never done anything with pots. I need something to after my prayer is in red to drink 2 doses of potion. Anyone can help with this?
2012-04-21 05:57:39
2012-04-21 06:14:53
(*
GetMMLevels
~~~~~~~~~~~
.. code-block:: pascal
Function GetMMLevels(LevelType : String;var ColorSign : String): integer;
Returns the level shown next to the minimap.
Colorsign returns the color of the text (Green,Yellow,Orange,Red).
Returns -1 if failed.
.. note::
by Raymond / Wizzup / Sabzi / NCDS
Example:
.. code-block:: pascal
*)
function GetMMLevels(LevelType: string; var ColorSign: string): Integer;
var
Colors : TIntegerArray;
Signs: TStringArray;
P: TPointArray;
I: Integer;
B: TBox;
begin;
Result := -1;
ColorSign := '';
case LowerCase(Leveltype) of
'health', 'hp', 'hitpoints', 'constitution': B := IntToBox(719,27,745,43);
'prayer', 'pray' : B := IntToBox(735,66,762,82);
'run','energy' : B := IntToBox(735,103,762,122);
'summon', 'summoning' : B := IntToBox(719,119,745,156);
else
begin;
srl_Warn('GetMMLevels', 'Invalid LevelType: ''' + LevelType + '', warn_AllVersions);
Exit;
end;
end;
Colors := [65280, 65535, 2070783, 255];
Signs := ['Green', 'Yellow', 'Orange', 'Red'];
for I := 0 to 3 do
begin
With B do
FindColorsTolerance(P, Colors[i], x1, y1, x2, y2, 30);
if Length(P) < 1 then
Continue;
Result := StrToIntDef(GetNumbers(GetTextAtExWrap(B.X1, B.Y1, B.X2, B.Y2, 0, 4, 4, Colors[i], 20, statChars)), -1);
if (Result > -1) then
begin
ColorSign := Signs[i];
Exit;
end;
end;
end;
2012-04-21 06:16:59
2012-04-21 06:18:06
From: begginer
I know how to get the DTMs. But how to use it. Can I do like hp. When hp is red then do stuff. And make for pray if red open inv tab and click 2 times a pot. or click till green?
2012-04-21 06:19:22
2012-04-21 06:22:46
From: begginer
Looks too complicated to me. :(
procedure CheckPrayer;
begin
Prayer:= GetMMLevels('pray', Color);
writeln('Prayer: ' + IntToStr(Health) + ', Color: ' + Color);
end;2012-04-21 06:29:03
2012-04-21 06:29:34
Function PrayerLevel: Integer;
var
ColourString: String;
begin
Result:= GetMMLevels('Prayer', ColourString);
end;
if (PrayerLevel < 200) then
begin
writeln('Prayer level is under 200');
Pot('prayer');
end;
2012-04-21 06:31:05
From: [J]ustin
I used this for my bandit script
Function PrayerLevel: Integer;
var
ColourString: String;
begin
Result:= GetMMLevels('Prayer', ColourString);
end;
if (PrayerLevel < 200) then
begin
writeln('Prayer level is under 200');
Pot('prayer');
end;
2012-04-21 06:42:36