SRL Archive - OSR Help

How reliant is UpText?


Total

2012-04-15 20:29:16

So I'm trying to make a script that is heavily reliant on uptext as it is the only way I can think of doing it. I am having problems with IsUpText and WaitUpText though because it doesn't seem to be accurate. Here is an example. I ran my script to hover over the slot in my invy with my allotment seed, put a 1 second wait, then Writeln the current uptext. The seed was a potato seed and this is what was written


Loading variables...
Use Pocaco seed / 2 more options
Your alloment seed slot is incorrect, please change in script settings

So I guess my question is there any way to make uptext more accurate? It detected Potato as Pocaco, and as funny as that is, it will not make my script run as well as I would like it to. I think I remember seeing something where you choose the color of the uptext(the text of Potato is orange) but maybe I'm thinking of ChooseOption.

Er1k

2012-04-15 20:35:06

Do it by trial and error. Uptext is quite reliable in that it usually works, but sometimes the spacing might mess it up, as well as RS updates. Better failsafe it, or think of a backup method in case it doesn't work.

Total

2012-04-15 20:47:46

Just did another test and this is what it showed. O.O


Loading variables...
Use ..c.c.!c.. .i.i... / 2 more options

Sooo….I guess the text finding on the orange text isn't too good. I'm thinking it has to do with the background color being the farming patch, but regardless I guess I need to find another way. Kinda sucks but oh well.

Upon further investigation, I think it had to do with the orange text color. When I am looking for patches I have it writeln the uptext and it works 100% of the time but the color of the text is blue.


Pick Marigold / 5 more options
Found grown crop
Harvesting
Patch is Flower
Finding Flower patch
Inspect Flower Patch / 3 more options *47 .
Centering
Finding Harvest patch
Inspect Marigold / 3 more options *9 .
Pick Herbs / 5 more options *9 .
Found grown crop
Harvesting
Patch is Herb
Finding Herb patch
Inspect Herb patch / 3 more options *15 .
Centering
Finding Harvest patch
Inspect Marigold / 3 more options *13 .
Inspect Herbs / 3 more options *13 .
Inspect Potato plant / 3 more options *13 .
Inspect Potato plant / 3 more options *13 .
Inspect Potato plant / 3 more options -l-1.3 .
Clear Dead potatoes / 4 more options
Found a dead Allotment crop
Finding Allotment patch
Inspect Allotment / 3 more options
Centering
Finding Harvest patch
Inspect Marigold / 3 more options *8 .
Inspect Herbs / 3 more options *8 .
Inspect Potato plant / 3 more options *8 .
Inspect Potato plant / 3 more options *8 .
Inspect Potato seed / 3 more options
Inspect Potato plant / 3 more options
Inspect Potato seed / 3 more options
Inspect Potato plant / 6 more options
Inspect Potato seed / 3 more options
Inspect Potato seed / 3 more options
Inspect Potato plant / 3 more options
Inspect Potato seed / 6 more options
Nothing to harvest, back to alching

So I'll jut use OptionsExist to load the variable since it seems to be more accurate than IsUpText for orange text.

Abu

2012-04-16 18:50:05

I'm thinking whatever is in the background is causing the UpText to be misread. My advice is that you use ClickNorth(1) before checking for uptext, it may change the background color and help you read the uptext correctly :)

J J

2012-04-17 14:00:02

You can much better use bitmaps/DTM's to find stuff in your inventory.

Here is an example of a part of my procedure that drinks a summoning flask:
procedure RenewFamiliar;
var
Flask, SumTab, X, Y: Integer;

begin
if TimeFromMark(n)>300000 then
begin;
if FindColor(X, Y, 127, 0, 338, 518, 479) then
begin
ResetTime;
WriteLn('Renewing familiar');
if GetCurrentTab = (tab_Inv) then
begin
WriteLn('Inventory tab')
end else
begin
MouseBox(642, 168, 671, 204, 1); //FTab(tab_Inv);
WriteLn('Inventory tab');
Wait(100 + Random(100));
end;

Flask := DTMFromString('mAAEAAHic42FgYHBiYmBwBmJrKLYEYhsgdgRidyD2BmIfKA3iPwPquQHEt4H4ARC/AOIPQPwJit8C8ROo3B0glj12BkgyEY3/A0lGGmJkAAAVShDj');
if FindDTM(Flask, X, Y, MIX1, MIY1, MIX2, MIY2) then
MMouse(X, Y, 5, 5);
case Random(6) of
0..3: Mouse(X, Y, 0, 0, 1);
4..5: begin;
Mouse(X, Y, 0, 0, 0);
WaitOptionMulti(['Dri', 'ink'], 150);
end;
end;
FreeDTM(Flask);
WriteLn('Renewed summoning points');
Wait(100 + Random(300));

DTM Guide: http://villavu.com/forum/showthread.php?t=77691
Bitmap guide: http://villavu.com/forum/showthread.php?t=47374

This way you won't have to use UpText ;)

Total

2012-04-17 14:04:26

But I don't want to get a bitmap/DTM of every single type of seed and of every single stack type(they have different pictures for each size stack 1 - 5 i believe). That would be way too much of a hassle and probably not even possible.

J J

2012-04-17 14:08:40

Well, you can just make it a requirement for the users to make sure they have atleast 5 or more seeds. Making a farming script takes extremely long, but it's definately worth it to make bitmaps or DTM's IMO. Makes the script much more stable.

You can rely on uptext though, but there are some minor problems with detecting the uptext with certain backgrounds.

Abu

2012-04-17 14:09:56

Have you tried?

http://villavu.com/forum/showthread.php?t=79237

Total

2012-04-17 14:11:44

It's only checking the uptext of the seeds once in the beginning to know what type of seed it is, then storing it in a variable to check for grown crops so it isn't a big deal to just right click them and check for the option in the beginning. Also making DTM's/Bitmaps for the herb seeds would be completely useless as they all look the same. You need some way to distinguish them from one another so I pretty much have to use uptext.

And no, will have to take a look at it if I decide to go back to uptext. Thanks.