xtrapsp
2013-03-29 16:48:11
EDIT:
Gaveup with this script. Simba is utter crap at detecting fonts in my opinion. So there's not even a point in me trying to detect text for stuff like this.
hey all.
having a few problems with this script, basically I want it to write out the success rating from below:

This is what happens:
This is the snippet:
Gaveup with this script. Simba is utter crap at detecting fonts in my opinion. So there's not even a point in me trying to detect text for stuff like this.
hey all.
having a few problems with this script, basically I want it to write out the success rating from below:
This is what happens:
Clicking Voyages Button
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
could not find Positive Success rating
Drawing box around Test Text
Drawing box around Test Text
Drawing box around Test Text
Drawing box around Test Text
Drawing box around Test Text
This is the snippet:
function TestRead : String;
//Thanks to NKN for the continued help with my Rage when this wouldn't work.
var
Box:Tbox;
BoxColorArray, FontArray: TVariantArray;
i, j: Integer;
begin
BoxColorArray := [1343050, 1374720];
FontArray := [BigChars,CharsNPC,CharsTrade,FriendChars,LoginChars,SmallChars,StatChars,UpChars,XPChars];
Box := IntToBox(547,444-50,620,466-50);
writeln('Drawing box around Test Text');
SMART_DrawBoxEx(True,False,Box,clyellow);
for i := 0 to High(BoxColorArray) do
begin
for j := 0 to High(FontArray) do
begin
if(not(GetTextAtExWrap(Box.x1,Box.y1,Box.x2,Box.y2,0,10,10,BoxColorArray[i],0,FontArray[j])='')) then
begin
Result := GetTextAtExWrap(Box.x1,Box.y1,Box.x2,Box.y2,0,10,10,BoxColorArray[i],0,FontArray[j]);
exit;
end else
Writeln('could not find Positive Success rating');
exit;
end;
end;
WriteLn('Chance of Success: ' + Result);
end;

I'm not really sure how best to detect it though, its been ages since I've scripted. I am meaning to get back into it and would try help out however I'm going on holiday later today for a week so there's no point right now :(