Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

slacky

 VIPs
  • Content count

    243
  • Joined

  • Last visited

  • Days Won

    2

slacky last won the day on May 31 2013

slacky had the most liked content!

Community Reputation

14 Good

About slacky

  • Rank
    VIP
  • Birthday 10/10/1990

Personal Information

  • Location
    Norway
  • Interests
    stuff
  1. Unknown identifier "Pixel" :(

    MSSL has not been updated to keep up with the newer releases of SCAR (don't think it's been updated in more than 1 year). If I recall correctly `TSCARBitmap.Pixels` was changed to `TSCARBitmap.Pixel` some SCAR-releases ago, so to solve your issue you have to update MSSL yourself, because I don't think anyone else will.
  2. 1. RS_*XT chars, and related OCR functions (IE: XT_GetTextAtEx) was an part of an attempt to have a faster alternative for the simple cases of OCR, IE for reading the login-text. SCARs OCR functions was to slow, and caused a notable delay whenever used, so I replaced it with my simpler method when I could. 2. I dont recall much regarding my RML. So I honestly do not know. 3: UpFont2 / UpCharsShadow -> Shadows are needed to get the uptext, without shadow fonts the engine is useless, and wont match anything. That's all I recall. 4: See below. 5: Just delete it or ignore it, it's just a Windows explorer ("thumbnail cache" file) that accidentally got added. ..... The last parameter in RS_GetTextAtEx is used to speed up the process / just stops reading anything more when the given characters are matched. The "*" indicates that it can match any character(s). RML is really just a big pile of mess as I was only using it as a way to pass some time, and have a simple lib to test out some SCARExt methods with. Your implementation looks good.
  3. Yeah. I never released a standalone SCAR version of the RS07 OCR engine (which I guess is what you want), I planned to, but I went inactive. However the RS07 OCR engine is available in this RS07-extended version of SCARExt: http://slackworld.net/downloads/RML.rar The one file you need is then the: SCARExt.dll (plugin). To use the RS OCR you need the "RS_LoadFont" and "RS_FreeFont" found in OCR.scar And the few functions here: https://github.com/WarPie/SCAR-RML/blob/master/Src/OCR.scar#L74 And so you also need the two "XT_Bmp2Matrix(...)" to convert the bmp to a matrix, and "XT_ClientBMP()" which grabs the client bitmap.
  4. Why it say " Invalid search area" ?

    I think you miss understood. `YS` (counting from top of your screen) should be greater than the bottom `YE`. Hmm.. Maybe just read over this thread a few times, you will probably get it (that is if you still struggle to understand this).
  5. Why it say " Invalid search area" ?

    You need to take a dive in to the basics of programming, man... XS (X-Start) -> XE (X-End) YS (Y-Start) -> YE (Y-End) In what way would giving a start-point which is greater then the stop-point make sense? ┌─────────┤YS├──────────┐ │░░░░░░░░░░░░░░░░░░░░░░░│ ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ XS│░░░░░░SEARCH░BOX░░░░░░░│XE ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ │░░░░░░░░░░░░░░░░░░░░░░░│ └─────────┤YE├──────────┘ ^ look at that... ask yourself if you have a box, how can the TOP (YS) be lower down then the Bottom (YE)? It's impossible.. the top is always the top. So the top YS must ALWAYS be greater than or equal to the bottom YE. Something else does not make sense in this universe. - Gives up Edit: "Greater than the bottom" as in lower value/aka higher up on your screen.
  6. Why it say " Invalid search area" ?

    because you give it an XS which is larger then XE. >>> 963,102, 962,542 That's a negative box since XS is greater then XE... ┌─────────┤YS├──────────┐ │░░░░░░░░░░░░░░░░░░░░░░░│ ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ XS│░░░░░░SEARCH░BOX░░░░░░░│XE ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ │░░░░░░░░░░░░░░░░░░░░░░░│ └─────────┤YE├──────────┘ ^ that is how the four values (two points) [xs,ys,xe,ye] defines the box you search in.
  7. tolerance range?

    I don't use, nor do I have experience with older scar-versions. There is generally no support to get here for prehistoric SCAR-versions. Update you SCAR to the latest and people here can actually help.. rather then using a version of SCAR which belongs in a museum.
  8. tolerance range?

    Color similarity is "a bit" more advanced than that, I can go through the default method in SCAR (known as CTS1) for you. - This is what's by default used in find color and find bitmap methods. The value you have there is a (numeric) representation of a RGB color. var R,G,B:Integer; begin ColorToRGB(100000, R,G,B); WriteLn(TIAToStr([R,G,B])); end. So your example value of 100000 = R: 160, G: 134, B: 1 From the beginning now knowing that: SCAR convert the representation of the color to R, G and B values by doing some bitshifting (separating the 3 first bytes from the 4 byte long number), as so: procedure ColorToRGB(Color:Integer; out R,G,B:Integer); begin R := color and $FF; G := color shr 8 and $FF; B := color shr 16 and $FF; end; Then it compares the color using a function which computes the euclidean distance between the two colors: function ColorSimilarity(Color1, Color2:Integer): Extended; var R1,B1,G1, R2,G2,B2: Integer; begin ColorToRGB(Color1, R1,G1,B1); ColorToRGB(Color2, R2,G2,B2); Result := Sqrt( Sqr(R1-R2) + Sqr(G1-G2) + Sqr(B1-B2) ); end; That means the max tolerance used between two colors when using CTS1 (the formula shown above) is 442 (441,673) `Tolerance` measured this way yields an "exponential-ish growth" in the number of similar colors (up to values): 1 tolerance: ~7 colors 2 tolerance: ~33 colors 3 tolerance: ~123 colors 4 tolerance: ~257 colors ... 8 tolerance: ~2109 colors ... 16 tolerance: ~17077 colors Side note: The number of colors in RGB-color space is (256^3) = 16777216 (0 to 16777215) -------------------- Based on your example color of 100000, using that with this formula and 1 tolerance that would give you the following values: `(99999, 99744, 34464, 100000, 165536, 100256, 100001)` Which is equal to the RGB colors: --------(159,134,1) (160,133,1) (160,134,0) (160,134,1) (160,134,2) --------(160,135,1) (161,134,1) -------------------------------------------------- Read: http://wiki.scar-divi.com/Tolerance I hope this helps, tho if you have any more questions, just ask! :-)
  9. isUpText is gone?

    Errm, TChars.. Note the T.. which is normal prefix for a Type. Would be quite unnecessary to have a psudo-type (TChars = Integer). But I guess I can understand the assumption u made. Can you ever forgive me?
  10. isUpText is gone?

    What the fuck are you talking about? TChars, and the more important TCharsN (used for uptext) is records, defined in SCARExt part of RML. You can't call just the OCR-functions without a lot of extra work. The library and OCR relies on a modified version of my plugin (SCARExt). It would be much simpler to take the OSI functions that you need and wrap that up in another file. https://github.com/WarPie/SCAR-RML/blob/master/Src/Mouse.scar contains some mouse functions, if the once in SCAR does not serve your needs.
  11. isUpText is gone?

    It was extremely usefull in RS, but SCAR is moving towards a more general userbase, and by doing so it was appropriate to remove any function that was directly related to RS. TChars, and TCharsN is not part of SCAR divi, it's part of RML. RML has it's own simple OCR-engine, so..: Download RML (https://github.com/WarPie/SCAR-RML/archive/master.zip) unzip the contents it to Includes/RML {$I RML/RML.scar} //standard setup procedure: begin SetupRML; {//alternative extra setup: ActivateRSWindow; RS_LoginPlayer('someuser', 'somepw'); RS_SetCameraPitch('High'); RS_SetCompassDir('N'); } //then test the OCR-stuff: if RS_IsUpText('Walk') then WriteLn('Uptext is: ' + RS_GetUpText); end.
  12. isUpText is gone?

    Freddy removed it from SCAR. That means that None of the UpText-related functions works anymore. And not really that usefull, as it's only important in older RuneScape versions. I made a replacement half a year ago, with similar accuracy: https://github.com/WarPie/SCAR-RML/blob/master/Src/OCR.scar The FPC source of the OCR-thingy has been upped by Olly (Simba version): https://github.com/Olly-/libUpText/ I mentioned that SCAR removed RS_GetUpText in this thread, where I also mention RML, as OSI was incomplete at that time, and prob still is: http://forums.scar-divi.com/showthread.php?t=2592&p=14111&viewfull=1#post14111 ^ RML might be slightly outdated at some shizzle, but I think it still works.
  13. Click Random Box

    SCAR has autocompletion, open scar and write "Move", and press "CTRL+SPACE", then you get all functions starting with Move. MoveMouseBox(Box:TBox); {or} MoveMouseBoxEx(Box:TBox; MouseSpeed: Integer); EG: begin MoveMouseBox(Box(10,40,20,50)); end.
  14. If PressKey

    PressKey does what it says.. it presses a key. You need to check the STATE of the key.. So GetCurrentKeyState would work fine. begin if GetCurrentKeyState('a') then PressKey(chr(49)); Wait (1000); end. Also, the Wiki contains an example which is as clear as sunny day: begin repeat Wait(500) until GetCurrentKeyState(VK_DOWN); WriteLn('Pressed down'); end.
  15. Clicking on colors

    You have to elaborate a bit further for me to be able to help you. Do you mean at 3pm do something.. or do you mean 10 sec after another thing has been done, do something? There are several functions used to find the pos of a color: » FindColorTol(out x,y:Integer; color, x1,y1,x2,y2, tolerance: Integer); » FindColorSpiralTol(CenterX,CenterY:Integer; var x,y:Integer; Color, x1,y1,x2,y2, tolerance:Integer); x and y is the resulting postion of wherer the color was FIRST found: var Pt: TPoint; //TPoint holds and X, and an Y coordinate. So it can always be used instead of: "var x,y: Integer". begin FindColorTol(Pt.x, Pt.y, 255, 0,0,500,500, 10); WriteLn(PointToStr(Pt)); // Found color 255 (red) at that location end; and then we have more advanced versions, which puts ALL the found results in to an array: » FindColorTolEx(var TPA:TPointArray; color, x1,y1,x2,y2, tolerance: Integer); The TPA is an array of all the points found of the given color. This can be manipulated to find groups/clusters where the color is close to each other, and thereby eliminate noise, and allow for even more checks to ensure we are getting the right group, and in the end we often just click the center of that group. EG: var W,H, i: Integer; TPA:TPointArray; Groups: T2DPointArray; begin // find all black-ish colors in the area 0,0, to 500,500 FindColorTolEx(TPA, 1, 0,0,500,500, 10); // create groups where colors are close to each other // 6 is the max distance between points in that group. Groups := SplitTPA(TPA, 6); // go though each group and check if it's the correct size for i:=0 to High(Groups) do begin // get the group width and height TPADimensions(Groups[i], W,H); if ((W > 5) and (W < 100)) and ((H > 8) and (H < 20)) then // it passes, we print the middle of that group: TPACenter(Groups[i]) WriteLn(PointToStr( TPACenter(Groups[i]) )); end; end. To help more I need you to elaborate further.
×