Jump to content
shadowrecon

Reading Text

Recommended Posts

Im trying to make a function to read the HP of my character. Ive ran a bunch of test with different fonts and i cant manage to get the complete text. With LoginChars and XPChars I can get the center number but it wont return the first or last. This is the function i was using to test the fonts

 

[scar]

program New;

{$DEFINE RS2}

{$DEFINE SMART}

{$I GMRL/GMRL.scar}

 

Procedure FontTester(X,Y, TextColor, TextLength, Tol, MinS, MaxS: Integer);

Begin

Writeln('OptionChars: '+Trim(GetTextAtEx(X, Y, Tol, OptionChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

Writeln('ScreenChars: '+Trim(GetTextAtEx(X, Y, Tol, ScreenChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

Writeln(' NPCChars: '+Trim(GetTextAtEx(X, Y, Tol, NPCChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

Writeln(' UpChars: '+Trim(GetTextAtEx(X, Y, Tol, UpChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

Writeln(' SmallChars: '+Trim(GetTextAtEx(X, Y, Tol, SmallChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

Writeln(' StatChars: '+Trim(GetTextAtEx(X, Y, Tol, StatChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

Writeln('FriendChars: '+Trim(GetTextAtEx(X, Y, Tol, FriendChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

Writeln(' LoginChars: '+Trim(GetTextAtEx(X, Y, Tol, LoginChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

Writeln(' XPChars: '+Trim(GetTextAtEx(X, Y, Tol, XPChars, false, false, MinS, MaxS, TextColor, TextLength, True, tr_AllChars)));

end;

 

begin

SetupGMRL;

FontTester(700, 28, 65280, 70, 0, 0, 2);

end.

[/scar]

 

Output:

// HP = 680
OptionChars: 
ScreenChars: 
  NPCChars: 
   UpChars: 
SmallChars: 
 StatChars: 
FriendChars: 
LoginChars: 8
   XPChars: 8

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...