SRL Archive - Help and Support

Uptext


Junior

2006-12-28 18:46:44

Ok, in my air crafter theres always this one stupid ass problem I keep getting. The uptext changes randomly. It has 2 forms, a thick dark text, and the other, a thinner lighter text. The only way IsUpTextMulti will work is if the text is dark and thick, and now I made a bitmap of the uptext that is thinner and lighter. I made this procedure that works for me, but doesnt work on anyone elses computer, and I cant find a way to fix it. And ideas?

function checktext:boolean;
var
esstext: integer;
begin
esstext := BitmapFromString(61, 12, 'z78DAED954B0E80200C44A' +
'F4457B8558CF73F9246360821E9874262E62DBA00DAC284811000' +
'0000FC81AB832EAB972B5D2FDDDBAAFA3A9DF308453A42E4F7957' +
'6C9F5DBC8EFC2192F67A575EC3BF1A8E3778BEC6A8FD5CA436D8B' +
'47A4DD69A32471500BED747E1D3147EDB12FC9A8F7DFBEBED5B68' +
'C7E5E98A992C77F64B91BFC5C9DAA734E01743CCE4AAFBFAA0865' +
'D67203E9428950');
begin
if(IsUpTextMulti('draw 1','une','esse'))then
begin
Result:=true;
end else
if not(IsUpTextMulti('draw 1','une','esse'))then
begin
If(findBitmapToleranceIn(esstext,x,y,msx1,msy1,235,24,25))Then
Begin
Result:=true;
end else
if not(IsUpTextMulti('draw 1','une','esse'))and
not(findBitmapToleranceIn(esstext,x,y,msx1,msy1,235,24,25))then
Begin
Result:=false;
end;
end;
end;
end;

tarajunky

2006-12-28 19:52:18

If I NEED uptext to work reliably for something, I always use DTMs. I've found that it's the only way to see text that shifts position, spacing, and also color depending on the background behind it.

So, if I want to look for the yellow text Essence, I would pick the top left pixel of the E, the bottom right, of the E, somewhere at the top of the s, etc. The E shouldn't change size, so there is no need for area tolerance for those points, but add 1 or 2 area to each other point on other letters so they can move around a little. The further you get from the first letter the more area tolerance you will need in case the spacing changes, since each space between letters will add x amount of distance.

Then I would set the color tolerance for each point to something insane like 80 so that it will see anything resembling yellow at all. And of course since you know approximately where on the screen the uptext will be, you can search a pretty small area.

Then when you run it, if it ever fails to detect the text, you should open up the DTM editor and tweak the area values until it works.

This works really well once you have it optimized as far as the pixels and area tolerances go.

It also helps if there are tall or short letters in the word. Like if you want to click on the Magic tutor you could include a point from the bottom of the g, or if you want the Melee tutor, the top of the l. If you just picked from Ma or Me the e/a pixels might overlap with each other since they are roughly the same size. One of these days I will completely convert my scripts over to this method and stop using IsUpText/IsUpTextMulti. They are easy and quick, but not reliable enough, in my opinion.