SRL Archive - SRL Bugs

ChooseOption Fixed.


Home

2011-11-23 13:21:02

Replaced UpChars with SmallChars. Simple yet effective. Happy botting!

And for people in SRL.

Don't always look for hardest path, because sometimes even smallest things will make great effect.


function ChooseOptionMultiEx(Texts: TStringArray; TextType: String; Action: fnct_ActionOptions): Boolean;
var
B,OptionBox: TBox;
TPA, TPA1, TPA2, TextTPA: TPointArray;
aTPA: T2DPointArray;
I, H, HH, ii, L: Integer;
Colors,SearchCols: TIntegerArray;
begin
Result := False;
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
Dec(B.X2);
Dec(B.Y2);
FindColorsTolerance(TPA1, 4343893, B.X1, B.Y1, B.X2, B.Y2, 0);
FindColorsTolerance(TPA2, 3950929, B.X1, B.Y1, B.X2, B.Y2, 0);
TPA := CombineTPA(TPA1, TPA2);
If Length(TPA) < 10 Then
Exit;
B.X2 := 0;
B.Y2 := 0;
aTPA := SplitTPAEx(TPA, 20, 20);
SortATPASize(aTPA, True);
B := GetTPABounds(aTPA[0]);
Colors := [13034990, 4231423, 2070783, 65535, 16776960, 9812166, 16777215];
TextType := LowerCase(TextType);
case TextType of
'action', 'player': SearchCols := [0,5,6];
'item' : SearchCols := [1,2];
'npc' : SearchCols := [3];
'object': SearchCols := [4];
else
SearchCols := [0,1,2,3,4,5,6];
end;
L := High(SearchCols);
SetLength(aTPA,l+1);
for i := 0 to l do
FindColorsTolerance(aTPA[I], Colors[SearchCols[I]], B.X1, B.Y1, B.X2, B.Y2, 3);
TPA := MergeATPA(aTPA);
aTPA := SplitTPAEx(TPA, 15, 1);
L := High(aTPA);
H := High(Texts);
SortATPAFromFirstPoint(ATPA, Point(OptionBox.X1, optionbox.y1));
for I :=0 To H do
begin
TextTPA := LoadTextTPA(Texts[i], SmallChars, HH);
for ii := 0 to L do
If FindTextTPAInTPA(HH, TextTPA, aTPA[ii], TPA) Then
begin
Result := True;
case Action of
ClickLeft: MouseBoxEx(B.x1 + 5, TPA[0].Y, B.x2 - 5, TPA[0].Y + 5,5, 1);
Move: MouseBoxEx(B.x1 + 5, TPA[0].Y, B.x2 - 5, TPA[0].Y + 5,5, 3);
Nothing: begin end;
else
srl_warn('ChooseOptionMultiEx', 'ClickRight not a valid click for RS menus!', warn_AllVersions);
end;
Exit;
end;
end;
if Action <> Nothing then
begin
MMouse(B.X1 - 50, B.Y1 - 50, 40, B.Y2 - B.Y1);
Wait(200 + Random(100));
end;

if (not result) then
chooseOptionMultiEx(['Cancel', 'ancel', 'ncel'], 'All', clickLeft);
end;


~Home

Mark

2011-11-23 13:27:10

Nice I have been offsetting my x y coords till this was fixed

LSD

2011-11-23 13:27:33

How do i get this to work for me where to put it ?

Home

2011-11-23 13:28:31

From: LSD
How do i get this to work for me where to put it ?


Just wait for official SRL update. Should be pretty soon.


~Home

LSD

2011-11-23 13:28:56

From: Home
Just wait for official SRL update. Should be pretty soon.


~Home


Oke cool :)

DeSnob

2011-11-23 13:45:14

I love you, seriously. :)

Coh3n

2011-11-23 15:54:16

Sorry I have to go, but I'll test and commit this after practice if no one else has.

E: Is it just me or does ChatChars not exist? And in that function, you use SmallChars?

Home

2011-11-23 16:11:02

From: Coh3n
Sorry I have to go, but I'll test and commit this after practice if no one else has.

E: Is it just me or does ChatChars not exist? And in that function, you use SmallChars?


My typo, sorry.

~Home

Wizzup?

2011-11-23 18:36:37

From: Coh3n
Sorry I have to go, but I'll test and commit this after practice if no one else has.

E: Is it just me or does ChatChars not exist? And in that function, you use SmallChars?


I uploaded UpCharsEx (the old UpChars) to the fonts. Simba should add a constant called 'UpCharsEx' to SRL if you have it in your Fonts. You can use this for the BankScreen and all. Smallchars should do for ChooseOption / Chat text.

Wyn

2011-11-23 19:06:02

Just a note if you wanna fix this yourself…

Open Srl/Core/Text.scar
Find the method.
Replace with first post.

quazzymodem

2011-11-23 19:26:32

From: wyn10
Just a note if you wanna fix this yourself…

Open Srl/Core/Text.scar
Find the method.
Replace with first post.


Thanks man, I was looking for that file and then I noticed your post :)

Wyn

2011-11-23 19:39:58

From: quazzymodem
Thanks man, I was looking for that file and then I noticed your post :)


No problem. :spot:

Coh3n

2011-11-23 20:02:02

Committed. :)