SRL Archive - RS3 Help

[SRL-6] new equivalents of old functions


bg5

2015-03-14 03:34:51

Hello,
I'm working on an old include, which was created 3 years ago. I don't know SRL-6 and I'm quite lost in the source, so I need help on how to do some stuff in SRL-6. Here is a list:


function InvFull : Boolean; // returns TRUE if inventory is full

str := CombineStrA( string1 , string2); // merge 2 TStringArrays into one

function IsMoving : Boolean; // returns TRUE if character is moving


now it's going complicated :stirthepot:


function WaitUpTextMulti(TStringArray; MaxTime:integer ) : boolean; // RS has no uptext anymore, mouse-over text instead

c := CountOptionsMulti(StringArray,'all'); // it was counting the number of options of right-click-menu including any string from the array; I'm not sure about second parameter

function ChooseOptionMulti(TStringArray) : boolean // it was choosing ( clicking with mouse) an option of right-click-menu including any string from the array;

riwu

2015-03-14 04:07:56


tabBackpack.isFull()
str := string1.combine(string2)
minimap.isPlayerMoving()

chooseOption.select()
Length(chooseOption.getOptions())
chooseOption.select() //overloaded
i dont use srl6 either but that's what i can gather from reading the include :p

bg5

2015-03-14 04:27:30

From: riwu

tabBackpack.isFull()
str := string1.combine(string2)
minimap.isPlayerMoving()

chooseOption.select()
Length(chooseOption.getOptions())
chooseOption.select() //overloaded
i dont use srl6 either but that's what i can gather from reading the include :p


Thanks Riwu you've saved me a lot of time.

@edit
@riwu
However

Length(chooseOption.getOptions());

and

C := CountOptionsMulti(strArr,'all');

is not the same, I need to count options only containing strings from the array


also :P
function WaitUpTextMulti(TStringArray; MaxTime:integer ) : boolean;

is not like

chooseOption.select();

excluding waiting part, it should check for mouse-over text ( which is like uptext in old RS), not for right-click menu

riwu

2015-03-14 05:03:44


function TRSChooseOption.count(arr: TStringArray): Integer;
var
options: TOptionArray;
i, j: Integer;
begin
options:= self.getOptions();
for i:=0 to High(options) do
for j:=0 to High(arr) do //replace with IsStrInArr(options[i].str, true, arr) if u want exact match
if Pos(arr[j], options[i].str) > 0 then
begin
Inc(Result);
Break;
end;
end;

Add that to your script then call
count:= chooseOption.count(arr);
untested code hopefully it works ^^

Not sure what your second parameter means though.


EDIT: ops for uptext it's
function isMouseOverText(txt: TStringArray; waitTime: integer = 250; useTesseract: boolean = false): boolean;