chooseoption is failing again
bankscreen is failing
amount.scar could use an update
gaaaahhh >.>
~RM
chooseoption is failing again
bankscreen is failing
amount.scar could use an update
gaaaahhh >.>
~RM
BankScreen is working 100% for me![]()
Here you go RM, I made a few modifications to the functions in amount.scar:
SCAR Code:// This one was unable to read 3+ digit numbers, fixed it.
// Also added Result to return -1, when FindColorsTolerance returns false.
function GetAmount(ItemX, ItemY: Integer): Integer;
var
S: string;
Col, II: Integer;
B: TBox;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result := Integer(FindColorsTolerance(TPA, 65536, ItemX - 50, ItemY - 50, ItemX + 50, ItemY + 50, 0)) * -1;
if (Result = -1) then
begin
SortTPAFrom(TPA, Point(ItemX, ItemY));
ATPA := SplitTPAEx(TPA, 5, 5);
B := GetTPABounds(ATPA[0]);
if (Length(ATPA[0]) < 15) or (B.X2 - B.X1 < 5) or (B.Y2 - B.Y1 < 5) then Exit;
Result := 1;
for II := 2 downto 0 do
if (FindColorsTolerance(TPA, 7575987 * II * II - 6796134 * II + 65535, B.X1 - 10, B.Y1 - 10, B.X2 + 10, B.Y2 + 10, 0)) then
Break;
if (II < 0) then Exit;
SortTPAFrom(TPA, Point((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1));
ATPA := SplitTPAEx(TPA, 5, 5);
TPA := ATPA[0];
Col := 7575987 * II * II - 6796134 * II + 65535;
B := GetTPABounds(TPA);
S := Trim(GetTextAtEx(B.X1 - 5, B.Y1 - 1, 0, StatChars, False, False, 0, 1, Col, 4, True, tr_AllChars));
Result := StrToIntDef(GetNumbers(S), 1);
if (Pos('M', S) > 0) then Result := Result * 1000000 else
if (Pos('K', S) > 0) then Result := Result * 1000;
end;
end;
SCAR Code:// I made this into a function.
// Returns false if @param Name, equals the active tab
function ShopSwitchTab(Name: string): Boolean;
begin
if not InStrArr(Name, ['main', 'player'], False) then
begin
srl_Warn('ShopSwitchTab', 'Name: ' + Name + ' is not a valid tab.', warn_AllVersions);
Exit;
end;
if (ShopScreen) then
Result := FindTextTpa(1930687, 0, 50, 65, 225, 83, Capitalize(Name), SmallChars, ClickLeft);
end;
~NS
There are currently 1 users browsing this thread. (0 members and 1 guests)