Jump to content
shadowrecon

RS07 Random devolment

Recommended Posts

I have started trying to create random detection systems and solving routines.

 

Randoms currently in progress:

 

Rick Turpentine - Easy - 85% Testing

River Troll - Easy 0% - Detection will be tricky

Rock Golem - Easy 0% - Detection will be tricky

Tree Spirit - Easy 0% - Detection will be tricky

Strange Fruit - Easy 0% - Detection will be tricky without false positives using colors.

Drunken Dwarf - Easy 0%

Security Guard - Easy 0%

Evil Chicken - Easy 10% - Started getting colors and determining a way to detect

 

Cap'n Hand - Medium 0% - Solving will be tricky

Sandwich Lady - Medium 0%

Kiss The Frog - Medium 0%

Lost and Found - Medium 0%

Bee-Keeper - Medium 0%

Quiz Master - Medium 0%

Mysterious Box - Medium 50 % - Solving will be tricky, Could make a guess?

Pillory - Medium 0%

 

Drill Daemon - Hard 0%

Freaky Forester - Hard 0%

Gave Digger - Hard 0%

Mime - Hard 0%

Prison Pete - Hard 0%

Pinball - Hard 0%

Evil Bob - Hard 0%

Prison Pete - Hard 0%

 

 

Maze - Impossible 0% - Hopefully with the use of SPS this can be done

Evil Twin - Impossible 0%

 

If anyone gets stuck in a random please take some HIGH Quality pictures and post them in this thread. Also if you could crop them that would help out and do not re-size as this can change the colors! I have wanted to take on this project for a while and honestly to do it all i have to do is let my character stand around and they pop up.. haha.

 

** Rating system based off of movement and static vs dynamically changing environment.

 

*** If anyone has or has written any functions for detecting or solving a random please post as it could help me determine a good method for solving a random. Thanks!

Edited by shadowrecon
Link to comment
Share on other sites

Shotty is a wonderful screen shot tool you guys could use. Just click the icon, you can select part of screen to do screenshot, then you can click upload, to upload it to a server, and copy the link and post it here in the thread.

 

Oldschool way: PrintScreen, Open paint, Ctrl+V (to paste the screenshot in), crop it, save it, upload it.

Link to comment
Share on other sites

It was harder to solve randoms than I remember. But at least I think that I soon will be able to detect all talking randoms in a generalized way! :-)

 

The way I am trying to do it is to search the screen for all (yellow) text, if the text is recognized as a random-events text (EG: Evil Chicken`s: "Bwak", "Begone, ", or my nickname; then search for colors that identifies the randoms we think it might be..

 

With the found colors:

Cluster (SplitEx) the points by a distance together to extract every object (/NPC if you'd like), sort am by their distance from me, then hover every object: read the uptext, if it's a random do a left-click on the object, read the option menu (more accurate OCR in menu) and identify.

 

- I think that will cover detection for most randoms. And in a fast way, as I managed to read the screen in 2-100ms (depending on how much text there is to read)! :) But, some randoms does not tend to talk much, then there`s a chance we'll not be in time to read their text, some other method will be needed then..

 

 

The sad part, in your case is that it's a work in progress in Python, and as it's now, it's rather hard to port to Pascal/scar even tho you guys got most/all functions that I use...

Edited by slacky
Link to comment
Share on other sites

That is a in-genius idea. I had not thought of that. I was going to / am looking for colors of the randoms in the detection methods. If there is any code or colors you have post them and maybe as a group we can create detection and solving routines!

 

If we could find a super old SRL include with randoms this could also be a lot easier! does anyone have a old copy around on a backup of a backup? This include just needs to predate Halloween of 2010! As that was the date the randoms were truly removed.

Link to comment
Share on other sites

You might want to take a look at SRL OSR: https://github.com/SRL/SRL-OSR/tree/master/SRL/core/antirandoms

 

This is the some of the shit I use to read the whole rs main screen with a pretty accurate result (even catches waved text with close to perfect recognition)..

http://pastebin.com/kx0kAdKB #--- Used to find each font and interpret them (it's pretty darn accurate..).

http://pastebin.com/JJpdBpyb #--- Interesting parts are: __extractTextRect, and rs07_getScreenText

Bot these files are simply prototypes, so you will find am a little hardcoded..

 

If you give it a shot to port that, I am sure I can help, and it should be quite easy (accuracy depends on the image matching algo we'll use)...

Edited by slacky
Link to comment
Share on other sites

It was harder to solve randoms than I remember. But at least I think that I soon will be able to detect all talking randoms in a generalized way! :-)

 

The way I am trying to do it is to search the screen for all (yellow) text, if the text is recognized as a random-events text (EG: Evil Chicken`s: "Bwak", "Begone, ", or my nickname; then search for colors that identifies the randoms we think it might be..

 

With the found colors:

Cluster (SplitEx) the points by a distance together to extract every object (/NPC if you'd like), sort am by their distance from me, then hover every object: read the uptext, if it's a random do a left-click on the object, read the option menu (more accurate OCR in menu) and identify.

 

- I think that will cover detection for most randoms. And in a fast way, as I managed to read the screen in 2-100ms (depending on how much text there is to read)! :) But, some randoms does not tend to talk much, then there`s a chance we'll not be in time to read their text, some other method will be needed then..

 

 

The sad part, in your case is that it's a work in progress in Python, and as it's now, it's rather hard to port to Pascal/scar even tho you guys got most/all functions that I use...

 

The Split function and then get rid of any tpa's that are small, works effectively. I'm a big fan of this method because you can do like you said and compare distance with other points, and etc. I think it's the pinnacle of color finding, probably works better than DTM's, and better than other color finding methods. GetText functions are key too. Some possibilities would be minimap to mainscreen functions (ClYellowDot), or maybe auto coloring. Haven't had much experience with auto coloring yet. But that brings up another good point, you can change the CTS to 2 for the randoms if need be.

 

DDTM's are also amazing because you can have several of them linked together, I think this is also called Object DTM's. But I remember this one method I read, you just link them together, and makes them more accurate. Same can be said with the find colorEx function too tho.

 

Another good fallback would be CountColor.

Edited by LordJashin
Link to comment
Share on other sites

I will look into that slacky i have alot of free time this summer and am trying to find some projects that will last some time and randoms have been something i can focus on now that SPS is working =)

 

 

@LordJashin Good idea with the MMtoMS i didn't even think of that... If you remember in GMRL i had those functions that could interact with NPC's just using the MM dots <_>. I forgot about that, it was only a year ago tho ha-ha. I think if we keep just looking at this in different directions we can come up with some pretty nifty ideas.

 

 

Side note: Ive started creating a RS07 include for SCAR 4! I've about got all the core functions done then it will just be porting and re-configuring OSI2 which shouldn't be hard so far its been easy and i really like SCAR 4 its buggy as hell because its a alpha and there is no documentation except the DWScript site but hell they haven't even formatted some of there pages. ha-ha. Once there is a stable release im going to start working on getting SPS to work with it. I have all my mouse functions created, color finding, bitmaps, timing, math, client, keyboard and other vital function created and organized in a library. The rest will simply be TPA, TIA and other array based functions (Arrays are difficult... in my experience i cant even get it to add an item to a dynamic array without it being a string.. I don't know if Freddy just hasn't implemented it yet but Dynamic TPA's don't work! Heck any array that is dynamic and not a string)

Link to comment
Share on other sites

I will look into that slacky i have alot of free time this summer and am trying to find some projects that will last some time and randoms have been something i can focus on now that SPS is working =)

 

 

@LordJashin Good idea with the MMtoMS i didn't even think of that... If you remember in GMRL i had those functions that could interact with NPC's just using the MM dots <_>. I forgot about that, it was only a year ago tho ha-ha. I think if we keep just looking at this in different directions we can come up with some pretty nifty ideas.

 

 

Side note: Ive started creating a RS07 include for SCAR 4! I've about got all the core functions done then it will just be porting and re-configuring OSI2 which shouldn't be hard so far its been easy and i really like SCAR 4 its buggy as hell because its a alpha and there is no documentation except the DWScript site but hell they haven't even formatted some of there pages. ha-ha. Once there is a stable release im going to start working on getting SPS to work with it. I have all my mouse functions created, color finding, bitmaps, timing, math, client, keyboard and other vital function created and organized in a library. The rest will simply be TPA, TIA and other array based functions (Arrays are difficult... in my experience i cant even get it to add an item to a dynamic array without it being a string.. I don't know if Freddy just hasn't implemented it yet but Dynamic TPA's don't work! Heck any array that is dynamic and not a string)

 

It takes some will power for Dynamic TPA's lol. Just have to loop through them. Anyway here's what you can do with that FindColor + Split functions:

 

EyuT5kX.png

 

Take a look at MSSL, there's TONSSSSSSSSSSSSS of functions that are usable from it. I mean he's done it all over there. If you look at his Array functions, you'll probably find some of them useful or similar to SCAR's just in case you want to port them to SCAR 4.

 

You see how long that Scrollbar is!

 

SKI3hMG.png

 

And that file is only for the POINT functions. Imagine what other ones may be out there. Janilabo still owns us all with these scrollbars he has man, wooo.

 

Well I'll be focusing on RS2, good luck with RS07 guys.

Edited by LordJashin
Link to comment
Share on other sites

I can look in to creating a quick and dirty port of isScreenText(), and the getScreenText() for SCAR (reinstalling WinXP in vbox right now), it might be handy in some other cases as well, even tho most can be read in the chatbox (=

 

The accuracy of this OCR method will in the end depend on the image comparison method used. I have a feeling that SCAR uses Squared pixel difference which is not optimal for this (very sensitive to change in color), this might force me to do some more processing. But the end result is pretty flexible (can be used for reading without having to start (x,y) at the perfect coordinates! :)

 

But, I'm a lil' unsure to whether it will work with scar out of the box... :E

Edited by slacky
Link to comment
Share on other sites

Hmm.. That was actually wierd. I was unable to get SCAR to work on a newly installed Virtual machine with XP. It has always worked...

 

I'll check if I can get my Windows XP dualboot working again... But that WinXP installation has a pretty corrupt system register, so I have no expectations. In the worst case, I'll have to walk to my brothers house, and borrow his external (usb) DVD-reader (I got no CD/DVD/BR-player on this computer) and create a bootable WinXP CD from my iso.

 

Pfff... So much work... Well well.

 

-----

Edit: Managed to get my XP install working..

 

So, I've given it a shot to convert to SCAR, and it was pretty complicated, especially since I haven't touched SCAR in a few months... This might take some time. I got other more high priority thing to do so (keep working on Rafiki), I'll have it as a side project :P

Edited by slacky
Link to comment
Share on other sites

Found a way to detect on screen text:

 

[scar]

{$DEFINE SMART}

{$DEFINE RS07}

{$I OSI\OSI.scar}

 

function FindOnScreenTextEx(var P: TPoint; Text: String; Xs, Ys, Xe, Ye: Integer): boolean;

var

T: Integer;

begin

Result := False;

T := GetSystemtime + RR(1000, 1500);

While (T > GetSystemtime) do

begin

Result := IsTextInAreaEx(Xs, Ys, Xe, Ye, P.X, P.Y, Text, 1, ScreenChars, False, False, 0, 1, clYellow);

if Result then

Break;

end;

end;

 

function FindMSText(var P: TPoint; Text: String): boolean;

begin

Result := FindOnScreenTextEx(P, Text, 0, 0, MSPW, MSPH);

end;

 

// To use this test go to the sheep south of varrock and run the script while in the sheep pin

var

P:TPoint;

begin

SetupOSI;

repeat

if FindOnScreenTextEx(P, 'Baa!', 0, 0, MSPW, MSPH) then

WriteLn('Baa! found!');

until False;

end.

[/scar]

Link to comment
Share on other sites

But would it not be simpler to avoid evolving dependencies when creating a module for such as randoms (complex, and sensitive tasks)? I suggest you take the features you need from OSI, and put am in your library which holds the anti-randoms. That way you will not have any problem later with changes made to OSI, also the user wont need OSI to use your anti-randoms.

I can understand you don't want to do this if OSI is something that you expect to use very often, and the functions you use from OSI are pretty complex/long.

 

That's just my thoughts, and usually how I do it... :P

 

 

I think that I might edit this post when I wake up, but I have no idea as to what I will write.. I just got a feeling.

Edited by slacky
Link to comment
Share on other sites

Well yes of course that's always the best plan of action if trying to create a product but honestly i was told by one of my professors to "not re create the wheel." OSI has proven its ability to stand the test of time and i dont think its going to fall off anytime soon. Plus thats less i have to maintain to keep a working product. Know what i mean? I built SPS as a completely stand alone unit and honestly it only used 2 main functions from OSI but that required so much backtracking it was ridiculous. I figure with the randoms most people will be using OSI anyways as it has a lot of functionality. Plus it will allow me to focus on the randoms. I did barrow Wanted's random setup, i like the way it works and how he has it search and detect them so far and again it allows me to focus on the core of the randoms instead of trying to re-create the wheel yet again.

 

Side note: Those functions should of been named like "FindTalkingNPCText"

Link to comment
Share on other sites

Okay guys, lets figure out a way as a combined effort to solve the Strange Box random. Ive been working with different methods trying to capture the box when its open into a bitmap. I use countcolor and found a range where about 70% of the time it can capture the box with a corner in the center showing all three sides, yes there is only 3 sides to the box and 3 answers. I considered the brute-force methods but this would be no fun and was wondering what you guys have tried, or have read to give me some ideas on solving this. So far this thread has managed to stir up some ideas and help with the development i hope it can continue to do so. I consider it like a "Think Tank" of sorts anything goes. (As far as random development).

Link to comment
Share on other sites

Anyone care to share a picture (of rs07 strange box)? Is it all white shapes? Or colored?

 

If you try to bruteforce it, wont that result in creating yet another box (when failed), sounds like a bad idea.. :P

Edited by slacky
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...