how to i turn a string with a "," in it into an integer?
SCAR Code:
GetTextatex(x+70, y, 0, SmallChars, false, false, 0, 3, 0, i, true, tr_AllChars);
Im making a GetCurrentXp('skill'); function and that GetTextatex reads the experiencetext correctly, but it has commas like 332,123 Xp. I tried putting range to tr_Digits, but then it was like 332 123. (with space instead of a comma)
How do i turn "332 123" or "332,123" into integers? no matter which
Here's the function as it is now.
SCAR Code:
function GetCurrentXp(skill: string): integer;
var XP : string;
XPint, x, y: integer;
begin
HoverSkill(skill, false);
FindText(x, y, 'Current', SmallChars, MIX1, MIY1, MIX2, MIY2);
XP := GetTextatex(x+70, y, 0, SmallChars, false, false, 0, 3, 0, 15, true, tr_AllChars);
writeln('Current xp = '+XP);
XPint := strtoint(XP);
result := XpInt;
end;
Its ALMOST working ^^ as mentioned, it gets the xp as a string correctly.