SRL Archive - RS has been updated.

Dec 16th 2009 UpText not working


WT-Fakawi

2009-12-18 03:46:06

Due to the recent update the padding of runescape's Uptext has been altered. As a result rs_GetUpTextAt and GetUpText do not function reliable anymore.

You can continue to use scripts but be aware that UpText will no longer render predictable results.

benjaa

2009-12-18 04:37:33

how long do you reckon itll take to come back up? is there anything we can do?

WT-Fakawi

2009-12-18 05:04:44

That entirely depends on Freddy's abilites to work out a new algorithm.

Dub

2009-12-18 17:03:25

Damnit. So I guess it's back to ye old FindColor/FindDTM to check if there's an uptext.. :(

Bad Boy JH

2009-12-18 21:29:24

I went to check it out at freddy1990 forums, and someone had posted this as a bug. He had this to say
I'm aware that Jagex applies random padding to the text, however, the algorithm should correct that as it does not rely on padding…

He is also on a break from scripting, (he went on a month break about a month ago)
Topic in Freddy1990 Forums

WT-Fakawi

2009-12-19 03:52:05

I Found a temporary solution to the UpText problem:

isTextInAreaEx!


function IsTextInAreaEx(x1, y1, x2, y2: Integer; var x, y: Integer; S: string; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer): Boolean;
Searches for text in area specified by x1, y1, x2, y2. Other parameters match IsTextAtEx.

If used like this:
if IsTextInAreaEx(7, 7, 160, 20, x, y, 'theuptextyouarelookingfor', 100, Upchars, True, True, 0, 2, -1) then
.....

Then you will at least be able to compare UpText. You can't read it but only compare. Well,at least it's something. I can script again. pfew.



EDIT: Forget it :(((((… Doesnt Work. I will revert to crude Bitmaps :(

Gu3st...

2009-12-19 04:13:39

Yay! :D
I'll test it right away :)

E: It works :)
function IsUpText2(S : String): Boolean;
var x, y : Integer;
begin
Result := IsTextInAreaEx(7, 7, 160, 20, x, y, S, 100, Upchars, True, True, 0, 2, -1);
end;


E2: So it doesn't work after all? :confused: huh..

tompa55

2009-12-19 04:31:41

Where do i put in this:

function IsUpText2(S : String): Boolean;var x, y : Integer;begin Result := IsTextInAreaEx(7, 7, 160, 20, x, y, S, 100, Upchars, True, True, 0, 2, -1);end;

?? I just delete something from the script and replace it with this or what??

Dub

2009-12-19 05:27:43

From: tompa55
Where do i put in this:

function IsUpText2(S : String): Boolean;var x, y : Integer;begin Result := IsTextInAreaEx(7, 7, 160, 20, x, y, S, 100, Upchars, True, True, 0, 2, -1);end;

?? I just delete something from the script and replace it with this or what??


Go read some tutorials. I'll explain it to you this time only :P.
This is a procedure not included in SRL, being that that one is broken. You have to implement this in your script. Put it somewhere outside of your main loop, along with your other functions & procedures. Then instead of using UpText, just use UpText2. Simple as that. :D

Btw, does this work or not? Fawaki and Zyt3x are saying different things, I'm confused :confused:

Sir R. M8gic1an

2009-12-19 05:28:07

From: Zyt3x
Yay! :D
I'll test it right away :)

E: It works :)
function IsUpText2(S : String): Boolean;
var x, y : Integer;
begin
Result := IsTextInAreaEx(7, 7, 160, 20, x, y, S, 100, Upchars, True, True, 0, 2, -1);
end;


I changed SRL's uptext to this, can't test tho.

~RM

WT-Fakawi

2009-12-19 05:50:28

From: WT-Fakawi
EDIT: Forget it :(((((… Doesnt Work. I will revert to crude Bitmaps :(


For some reason it doesn't work on Blue UpText, but it does work for Yellow Uptext…. so I was prematurely wrong.

Simtoon

2009-12-19 20:19:50

Can't we help him maintain the fonts?
Instead of him maintaining them himself?

Wanted

2009-12-19 20:35:48

From: Simtoon
Can't we help him maintain the fonts?
Instead of him maintaining them himself?


Fonts aren't broken, using get text for UpText in the upper left corner jagex killed because they are doing some randomizing stuff.

Freddy1990

2009-12-19 21:17:56

From: Simtoon
Can't we help him maintain the fonts?
Instead of him maintaining them himself?


Maintaining the fonts is no problem at all, I think most people will agree I've been doing a pretty decent job at that, however, Jagex somehow broke my OCR algorithm, I have no clue how though, by all means it should still work… But I'm having some difficulties fixing it, partially due to the fact that it's over 2 years old and I don't really comment my code often, like only 1% of the time or so, and my code from back then is usually almost unreadable, even by me, so it's rather hard to figure out where it goes wrong… I can't practically test it either because the whole thing is written in Delphi 7 and I'm developing with Delphi 2010, so I have to do the whole thing in a VM which is a slow and annoying process… And most of my spare time is already dedicated to developing SCAR 3.50 to get it ready as soon as possible…

The Claw

2009-12-20 03:18:06

By the sounds of things then, maybe you should release source so more people can have a look at it. If you're not going to be able to fix it any time soon, it's the right thing to do by the community…it would be pretty slack to leave us all effectively unable to script and macro for an indefinate amount of time due to a difference in philosophies.

YoHoJo

2009-12-20 04:05:12

Stop it Claw :p, he's not going to. But I do have to admit, Freddy totally set himself up for that in his post!

kingarabian

2009-12-20 04:08:55

From: The Claw
By the sounds of things then, maybe you should release source so more people can have a look at it. If you're not going to be able to fix it any time soon, it's the right thing to do by the community…it would be pretty slack to leave us all effectively unable to script and macro for an indefinate amount of time due to a difference in philosophies.


Do it Freddy! Wouldnt hurt…

Freddy1990

2009-12-20 05:33:27

From: YoHoJo
Stop it Claw :p, he's not going to. But I do have to admit, Freddy totally set himself up for that in his post!


I'm not going to lie to keep people from asking for my source code… To be honest, I've come to a point where I don't care anymore, I'm not releasing any of SCAR's source code regardless of how many people nag about it, they were only getting on my nerves anyway, just making my job harder…

Wizzup?

2009-12-20 06:34:00

From: Freddy1990
Maintaining the fonts is no problem at all, I think most people will agree I've been doing a pretty decent job at that, however, Jagex somehow broke my OCR algorithm, I have no clue how though, by all means it should still work… But I'm having some difficulties fixing it, partially due to the fact that it's over 2 years old and I don't really comment my code often, like only 1% of the time or so, and my code from back then is usually almost unreadable, even by me, so it's rather hard to figure out where it goes wrong… I can't practically test it either because the whole thing is written in Delphi 7 and I'm developing with Delphi 2010, so I have to do the whole thing in a VM which is a slow and annoying process… And most of my spare time is already dedicated to developing SCAR 3.50 to get it ready as soon as possible…


Why dedicate any time to SCAR 3.50 if the current one isn't even working?
Last time I read something about it you were at 10%, in what, 2 weeks? So it's going to take 18 more weeks before you finish it?

People are already flocking to RSBot just because SCAR simply fails at uptext.

Simtoon

2009-12-20 06:37:26

Just post the uptext function so people can help fix it you don't have to OS it.

Dub

2009-12-20 10:23:16

What possible evil could we do with it..? Besides, you have a trustworthy community behind you Freddy, I really do think you should reconsider it so SRL Members can ease your job and help you.. :D

Town

2009-12-20 18:06:36

Are we aware of the extent of the randomness yet, or if it is random at all? Maybe someone should run a test of how the area varies over a certain amount of time.

Freddy1990

2009-12-20 19:48:40

From: Wizzup?
Why dedicate any time to SCAR 3.50 if the current one isn't even working?
Last time I read something about it you were at 10%, in what, 2 weeks? So it's going to take 18 more weeks before you finish it?

People are already flocking to RSBot just because SCAR simply fails at uptext.


I'm aware that nothing I will ever do will satisfy you. And btw, it's actually 10% in 4 months, but that's the completion ratio of the entire program, not just the vital parts requires to run scripts, which is obviously my aim to finish first. No go ahead and twist that into something meaningful to you, I don't care…

From: Simtoon
Just post the uptext function so people can help fix it you don't have to OS it.


The uptext functions is built on several functions and algorithms that make it what is is, to os the function would mean open-sourcing half of SCAR.

From: Town
Are we aware of the extent of the randomness yet, or if it is random at all? Maybe someone should run a test of how the area varies over a certain amount of time.

I think it's probably completely random, someone who's currently occupied with client hacking can probably confirm that, same as the color changes are random and such… The padding also randomizes when the screen shifts, or so I've noticed…

Wizzup?

2009-12-20 19:58:20

From: Town
Are we aware of the extent of the randomness yet, or if it is random at all? Maybe someone should run a test of how the area varies over a certain amount of time.


There can be text without any spacing. I did some testing. Which means there is no real way to detect the characters. They just look like one.

From: Freddy1990
I'm aware that nothing I will ever do will satisfy you. And btw, it's actually 10% in 4 months, but that's the completion ratio of the entire program, not just the vital parts requires to run scripts, which is obviously my aim to finish first. No go ahead and twist that into something meaningful to you, I don't care…


There's a difference between satisfying people and having realistic views. I don't believe that if you write an OCR for SCAR 3.2x now, you can't use it in 3.50.

Cazax

2009-12-20 20:06:10

From: Wizzup?
There can be text without any spacing. I did some testing. Which means there is no real way to detect the characters. They just look like one.

You can separate characters by detecting the black outline and since their X value is always 1 you know there ends the last character.

Wanted

2009-12-20 20:10:15

Funny how people say they want to help, that plugin folder is there for a reason.

Freddy1990

2009-12-20 20:17:32

From: Wizzup?
There's a difference between satisfying people and having realistic views. I don't believe that if you write an OCR for SCAR 3.2x now, you can't use it in 3.50.


Actually, I really can't… First of, my code, currently uses loads of stuff that's only possible in modern Delphi compilers, not in Delphi 7 which SCAR 3.2x is still using, and going by your own arguments, writing a full OCR would take too much time, so basically you want me to write an OCR just for uptext, which I can't use in SCAR 3.50 because it will be 100% rs-specific-stuff-free.

From: Cazax
You can separate characters by detecting the black outline and since their X value is always 1 you know there ends the last character.


Hmm, that's not such a bad idea actually, I might be able to make use of that…

From: IceFire908
Funny how people say they want to help, that plugin folder is there for a reason.


You have no idea how incredibly happy I am that you're saying that… If they think they can fix my old crappy code when I myself failed, they they should be able to create it themselves just as well… They like to complain when I do all of the work, but well, never does that thought come up…


EDIT: Also, on a note, I never said I wouldn't try to fix it, I am still working on the problem, but I'm also still working on SCAR 3.50, which often takes precedence… If I get the uptext to work, and I have no doubt I will, in time, I will gladly update SCAR 3.23 with it. Fixing it however, will require me to create a completely new ocr algorithm, and with the time available to me that will unfortunately have to be rs-specific. The reason I can't get the current algorithm fixed has 2 main reasons, one being that it's old crap, horrible coding if I say so myself, the idea was great, but take in mind the code is over 2 years old, I've advanced quite a bit in that time… Also, it was never designed to function with the current conditions of the uptext, basically, it simply isn't made to handle it, modifying it to do would be simply ridicules, basically just postponing having it break down again a few weeks later or so…

Wizzup?

2009-12-20 20:38:29

From: Cazax
You can separate characters by detecting the black outline and since their X value is always 1 you know there ends the last character.


I don't see how it helps, because there is no outline in this case, the other character overlaps it:

Freddy1990

2009-12-20 20:50:11

From: Wizzup?
I don't see how it helps, because there is no outline in this case, the other character overlaps it:


Hmm, that's interesting, the r actually touches the t, never seen that before…

Town

2009-12-20 21:05:10

Is it possible that the only way to have two characters touching is while there are no shadows? That would make sense. I don't know if writing two separate cases is an option.

Freddy1990

2009-12-20 21:37:54

From: Town
Is it possible that the only way to have two characters touching is while there are no shadows? That would make sense. I don't know if writing two separate cases is an option.


There are always shadows, not because you don't see them that they aren't there… The game won't make that distinction either…

Town

2009-12-20 21:46:38

From: Freddy1990
There are always shadows, not because you don't see them that they aren't there… The game won't make that distinction either…


I'm not sure I understand what you said. I was on the assumption that Wizzup's example was showing the uptext on a screen in which the background was the color 0. The shadow of the uptext (or outline as it's been called) is not visible. This, it seems to me, allows the allows the "r" and "t" in the picture to be a pixel or two closer together as there is no shadow in between. Is that more clear, or is that what you have already answered to?

I may be wrong if that picture isn't directly from the game, though.

Wizzup?

2009-12-20 21:51:48

From: Town
I'm not sure I understand what you said. I was on the assumption that Wizzup's example was showing the uptext on a screen in which the background was the color 0. The shadow of the uptext (or outline as it's been called) is not visible. This, it seems to me, allows the allows the "r" and "t" in the picture to be a pixel or two closer together as there is no shadow in between. Is that more clear, or is that what you have already answered to?

I may be wrong if that picture isn't directly from the game, though.


No, the background wasn't black. It's just a render of a picture I filtered.

Town

2009-12-20 21:55:05

I had that impression. Alright, I'm embarrassed.

YoHoJo

2009-12-20 22:00:17

Town, you forgot to :redface:

Town

2009-12-20 23:14:18

For what it's worth, I still believe that all no letters are connected via a connection pixel-to-pixel horizontally or vertically. All pixels within each letter, however, are. I may be wrong, again, but this seems like another worthwhile comment.

anonymity

2009-12-21 00:00:33

K, please don't bite my head off, because I am not masterfully knowledgeable in Freddy's code or the usage of uptext.

Yes, I understand how much time, patience, energy drinks, women, naps, bacon, and dedication this would take… however:

1. With the randomness… is is possible to qualitatively AND quantitatively 'record' the different types of text shades, styles, and ect?? - then take that and create a OCR algorithm to include all of the above. After that, make an include (or part of the algorithm … whatever) to run through the different types of text that has been encountered before and generate a proper response to the text that it sees now…
- just a thought… it would very time consuming and often buggy…

2. Try a different vantage point… Take the text that SCAR sees and run that through a render… then have SCAR recognize the pattern and associate it with letters, and build what it says on its own. … and go from there..
- just another thought..

Best wishes with getting whatever you are working on done Freddy.
From all of us, for all of us…

Cigue

2009-12-21 17:25:05

Would it help if I screenshotted about a hundred instances of the same uptext taken on different logins to measure what the randomness is?

Freddy1990

2009-12-22 07:18:57

From: Cigue
Would it help if I screenshotted about a hundred instances of the same uptext taken on different logins to measure what the randomness is?


http://www.villavu.com/forum/showthread.php?p=667895

Naike

2009-12-22 17:49:14

Freddy1990, You shouldn't code anything on Luna before having 3.23 fixed.
So if it takes months to finish a new OCR algorithm.

You won't have any users left if you want us to wait months for 3.50, having a broken software.

E: Oh, and for the sake of being nice to each other, could you at least answer to this post? Instead of ignoring me :)

The Claw

2009-12-23 03:31:08

From: anonymity
K, please don't bite my head off, because I am not masterfully knowledgeable in Freddy's code or the usage of uptext.

Yes, I understand how much time, patience, energy drinks, women, naps, bacon, and dedication this would take… however:

1. With the randomness… is is possible to qualitatively AND quantitatively 'record' the different types of text shades, styles, and ect?? - then take that and create a OCR algorithm to include all of the above. After that, make an include (or part of the algorithm … whatever) to run through the different types of text that has been encountered before and generate a proper response to the text that it sees now…
- just a thought… it would very time consuming and often buggy…

2. Try a different vantage point… Take the text that SCAR sees and run that through a render… then have SCAR recognize the pattern and associate it with letters, and build what it says on its own. … and go from there..
- just another thought..

Best wishes with getting whatever you are working on done Freddy.
From all of us, for all of us…


1. The possible combinations are way to large to bother. Plus, it changes with background colours so depending where you are on RS, your camera angle and so on the variables change. Basically this idea is a less-accurate way of using bitmaps but making a library of every possible letter-overlapping combination at every possible place in RS first, instead of making them as you need them for your script.

2. Yup, thats the current method. The image of the text is manipulated and filtered greatly, removing all the random effects and tricks Jagex play on us basically by recognising patterns, until it is in a standardised form SCAR can recognise and assign to the letter it is.

The problem is, the filtering algorithms and such cannot handle the current uptext. Good train of thought

acureon

2009-12-30 22:26:43

Guys after reading this thread I was on the side that Freddy should just work on 3.50 and OS 3.23 so that everyone else could work on that while Freddy will speedyly finish 3.50 but I just realized that if it's made OS jagex would totally know exactly how to counter SCAR so.. I don't think SCAR could ever go OS maybe only shared with the select few trusted people