SRL Archive - OSR Help

GetUpText/IsUpTextEx


EngageTheRage

2013-04-21 20:01:02

for some reason it doesnt seem to work for me when finding monsters.

it works occasionally but not enough, i have re-written the function so the box is the exact size of the work im looking for and re-checked the color.

i have it working perfectly for looting further up in the script but for some reason it just wont work against monsters!useally i get nothing at all (even though its hovering over the monster and there is uptext) and sometimes i get – ', etc. and then it'll work fine for 5/10minutes then go back to being crap ;/

if anyone has any advice on what i could try or would like to point out if im being stupid that'd be great :)

this works almost flawlessly

writeln(getuptext);

case GetUpText of

however this will not


theUpText := GetTextAtExWrap(55, 2, 94, 21, 0, 6, 2, 122074, 40, 'UpChars07');
writeln('checking: ' + theuptext);
if (ExecRegExpr('.*'+'oss'+'.*', theUpText)) then
^^this was originally using IsUpTextEx but it wasnt working at all (nor was GetUpText) so i just copied and changed slightly for my needs.


i have checked and re-checked the co-ords are correct, i have a box painted on to check.


EDIT: could the background affect it? i would have thought not as i am looking for yellow only (used ACA to get the color, hue, sat & tol), but after watching im not sure …

Frement

2013-04-21 20:04:00

Try this and tell me how it works:
function F_GetUpText: String;
var WhiteT, BlueT, YellowT, GreenT, RedT, OrangeT, FoundText: String;
begin
WhiteT := GetTextAtExWrap(8, 8, 400, 25, 0, 5, 1, 14541281, 60, 'UpChars07');
BlueT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 13423640, 65, 'UpChars07');
YellowT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 1235160, 60, 'UpChars07');
GreenT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 714104, 60, 'UpChars07');
RedT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 255, 60, 'UpChars07');
OrangeT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 4687583, 60, 'UpChars07');
FoundText := BlueT + YellowT + ' ' + GreenT + RedT + OrangeT;
if (Pos('/', WhiteT) > 0) then
FoundText := Replace(WhiteT, '/', FoundText + ' /')
else
FoundText := WhiteT + FoundText;
Result := Replace(ReplaceRegExpr('/[^A-Za-z0-9 -\/]/', Replace(Replace(FoundText, '.', ''), '. ', ''), '', False), ' ', ' ');
end;

EngageTheRage

2013-04-21 20:08:50

From: Frement
Try this and tell me how it works:
function F_GetUpText: String;
var WhiteT, BlueT, YellowT, GreenT, RedT, OrangeT, FoundText: String;
begin
WhiteT := GetTextAtExWrap(8, 8, 400, 25, 0, 5, 1, 14541281, 60, 'UpChars07');
BlueT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 13423640, 65, 'UpChars07');
YellowT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 1235160, 60, 'UpChars07');
GreenT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 714104, 60, 'UpChars07');
RedT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 255, 60, 'UpChars07');
OrangeT := GetTextAtExWrap(35, 8, 250, 25, 0, 5, 1, 4687583, 60, 'UpChars07');
FoundText := BlueT + YellowT + ' ' + GreenT + RedT + OrangeT;
if (Pos('/', WhiteT) > 0) then
FoundText := Replace(WhiteT, '/', FoundText + ' /')
else
FoundText := WhiteT + FoundText;
Result := Replace(ReplaceRegExpr('/[^A-Za-z0-9 -\/]/', Replace(Replace(FoundText, '.', ''), '. ', ''), '', False), ' ', ' ');
end;



its the same … getting a lot of nothing and some 'r's 'op's '.''..' s looking for Moss giants by the way :)

Frement

2013-04-21 20:11:42

Post a screenshot.

King

2013-04-21 20:14:39

From: Frement
Post a screenshot.


Was having this problem a while ago, did you change CTS settings somewhere in the script? That could affect its ability to work as well

EngageTheRage

2013-04-21 20:26:44

From: Frement
Post a screenshot.



i will do in the morning, just turned off my windows and off to bed :)


From: King
Was having this problem a while ago, did you change CTS settings somewhere in the script? That could affect its ability to work as well


i have, but i thought i changed everything back afterwards. although i am a bit of a fool, i'll go through and check in the morning :)


thanks for the responses guys :D

King

2013-04-21 20:31:08

From: EngageTheRage
i will do in the morning, just turned off my windows and off to bed :)




i have, but i thought i changed everything back afterwards. although i am a bit of a fool, i'll go through and check in the morning :)


thanks for the responses guys :D


I forget to change it back too, dont worry :P Post the areas of the code you change it in and Ill be more than happy to look it over, also check out this tut, you dont need to change it back when doing it this way.

EngageTheRage

2013-04-22 05:43:18

great shout on the CTS! it turns out that were i was using GetUpText and it was working, was due to me resetting CTS to normal in the if loop just before calling GetUpText, just changed that and set it running, and its going beautifully :)