SRL Archive - SRL Snippets

GetAbilityName


xtrapsp

2013-01-01 05:05:52

Nearly done, just need to fix the fonts etc

Feel free to chop slice and change, I will upload the font so far later

(*
GetAbilityName
~~~~~~~~~~~~

.. code-block:: pascal

function GetAbilityName(Slot : Integer);

Returns the text of an abilities name in the hotbar

.. note::

by Xtrapsp

.. others::
Olly
JJ
Dynamite

Example:

.. code-block:: pascal

*)

function GetAbilityName(Slot: Integer) : string;
var
Ability : String;
Box, B : Tbox;
i: Integer;
P: TPoint;
cArr: TPointArray;
ResultTPA: String;

begin
Box := AbilitySlotToBox(Slot);
Writeln('found Slot');
Writeln(Box);
MMouse(randomRange(Box.x1, Box.x2), randomRange(Box.y1, Box.y2), 0, 0);
wait(100+Random(1000));
begin
Result := 'Undefined'; // Setting Result to equal nothing
if (findColorsSpiralTolerance(MSCX,MSCY,cArr,1774603,MSX1,MSY1,MSX2,MSY2,0)) then
begin
B := GetTPABounds(cArr);
SMART_DrawBoxEx(True,False,B,clyellow);
wait(100);
Result := GetTextAtExWrap(B.x1,B.y1,B.x2,B.y1+20,1,4,0,3111603,1,UpChars);

Writeln('Result: ' + Result);
end;
end;
end;

The Killer

2013-01-01 05:06:58

ewww xtrapsp is back :'(. why god, why????????????????????????
;)
nice job mate

xtrapsp

2013-01-01 12:36:36

Haha thanks ^^

King

2013-01-01 12:38:22

From: xtrapsp
Haha thanks ^^


Glad to see you back :P Also, I really do appreciate this! It will help my abilities in my waterfiend script!

xtrapsp

2013-01-01 12:44:38

From: SRLKing
Glad to see you back :P Also, I really do appreciate this! It will help my abilities in my waterfiend script!


It's not perfect, needs the fonts redoing but if people wouldn't mind helping with that it'd be much appreciated. I got it to find the Word Sever

King

2013-01-01 12:45:34

From: xtrapsp
It's not perfect, needs the fonts redoing but if people wouldn't mind helping with that it'd be much appreciated. I got it to find the Word Sever


Sweet, I may be able to help some later :P