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

Everything posted by slacky

  1. The activity here has indeed died out, and with it the botters has gone away
  2. 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.
  3. 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.
  4. 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.
  5. 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).
  6. 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.
  7. 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.
  8. 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.
  9. 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! :-)
  10. And I need a hovercraft... Put some work in and you might actually learn to write a script your self
  11. 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?
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. 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.
  17. 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.
  18. The only option is to do what Wanted mentioned, but that won't work without a call to "Wait"-function due to the latency between you and the game, and the softwares response-time. procedure MouseClickReturn(X,Y: Integer; Btn:TMouseButton; WaitMS:Integer); var P:TPoint; begin GetMousePos(P.X, P.Y); ClickMouse(x,y, Btn); Wait(WaitMS); SetMousePos(P.X, P.Y); end; begin MouseClickReturn(100,100, mbRight, 150); end. The last number "150" is the wait-time (in millisec) before it moves back to it's original position. If the game has low response-time you can decrease the value, in worst case you will have to increase the value. This will not be as ghosty as you may want. and it will interrupt what ever else you are doing.
  19. PressVKey(VK_F1) to VK_F12... You can use a hex or number-format as well ($70 - $7B), instead of them constants: $70 = 112 => F1 $71 = 113 => F2 ... $79 = 121 => F10 $7A = 122 => F11 $7B = 123 => F12 Note that I am using PressVKey, and not PressKey. FYI, all the keys F1-F12 are called function-keys.
  20. I assume it's the colors that has been changed ingame, try adding quite a bit of tolerance: function GetManaPercent(): Double; var x: Int32; Area:TBox; begin Area := Box(184,274,301,274); x := CountColorTol(11141120, Area.x1,Area.y1,Area.x2,Area.y2,50); Result := x / (Area.x2-Area.x1+1) * 100; end; function GetHPPercent(): Double; var x: Int32; Area:TBox; begin Area := Box(184,251,301,251); x := CountColorTol(170, Area.x1,Area.y1,Area.x2,Area.y2,50); Result := x / (Area.x2-Area.x1+1) * 100; end; begin WriteLn(GetHPPercent()); WriteLn(GetManaPercent()); end.
  21. You have moved the coords incorrectly then. As clearly shown in my example code both Y's should be the same position, meaning Y1, and Y2 = same. Else the output would be to large, this is obvious if you look at the simple math used to calc the percentile. >> Area := Box(274,417,391,417); >> Area := Box(274,440,391,440);
  22. You can count colors to get a percentile of the HP, and Mana remaining. The Area-boxes must be modified to the correct ingame coordinates, I just tested it on the image you supplied. This is a normal technique used often in RS-botting for a bunch of things, including HP (at least in RS3). function GetManaPercent(): Double; var x: Int32; Area:TBox; begin Area := Box(274,440,391,440); x := CountColor(11141120, Area.x1,Area.y1,Area.x2,Area.y2); Result := x / (Area.x2-Area.x1+1) * 100; end; function GetHPPercent(): Double; var x: Int32; Area:TBox; begin Area := Box(274,417,391,417); x := CountColor(170, Area.x1,Area.y1,Area.x2,Area.y2); Result := x / (Area.x2-Area.x1+1) * 100; end; begin WriteLn(GetHPPercent()); WriteLn(GetManaPercent()); end. This avoids you the "trouble" having to work with scars OCR-engine, tho might not be to hard, if all you need is the number-chars. Tho I do see a bit of smoothing-effects on the characters, so that might cause some trouble, but it does not seem to be to much.
  23. I am not really sure why it's not acting as one would expect, but I made a small work-around which might serve your needs. program New; procedure KeyDownEx(Key: Char); var vkcode:Byte; begin vkCode := ord(lowercase(key)[1]); if (GetCurrentKeyState(VK_SHIFT) and GetToggleKeyState(VK_CAPITAL)) then vkCode := ord(lowercase(key)[1]) else if GetCurrentKeyState(VK_SHIFT) then vkCode := ord(uppercase(key)[1]); if GetCurrentKeyState(VK_SHIFT) then begin if (Key in ['1','2','3','4','5','6','7','8','9']) then vkCode := vkCode - 16; if (Key in ['0']) then vkCode := vkCode + 13; end; KeyDown(chr(vkCode)); end; procedure KeyUpEx(Key: Char); var vkcode:Byte; begin vkCode := ord(lowercase(key)[1]); if (GetCurrentKeyState(VK_SHIFT) and GetToggleKeyState(VK_CAPITAL)) then vkCode := ord(lowercase(key)[1]) else if GetCurrentKeyState(VK_SHIFT) then vkCode := ord(uppercase(key)[1]); if GetCurrentKeyState(VK_SHIFT) then begin if (Key in ['1','2','3','4','5','6','7','8','9']) then vkCode := vkCode - 16; if (Key in ['0']) then vkCode := vkCode + 13; end; WriteLn(vkCode); KeyUp(chr(vkCode)); end; begin Wait(500); VKeyDown(VK_SHIFT); KeyDownEx('a'); KeyUpEx('a'); VKeyUp(VK_SHIFT); end. This is a very stinky and "hacky" solution.. But it might work "good enough".
  24. A bitmap is not A color, it's like a list (array) of colors.. It has pixels, each holding one color. Your bitmap has 80 pixels (10*8), that's 80 colors. And that's not a SCAR 3.4 bitmap, it's from a much older version of SCAR. So I doubt anyone here will help you. In current version of scar (3.4) you can use any of if you want to change one and one pixel: BMP.Pixel[x,y] := 2907022; Or sett the whole bitmap (every pixel) to be 2907022 BMP.Clear(2907022) To replace every color that is equal to 0 (black) you could do something along the lines of: var x, y, repColor, color: Integer; BMP:TSCARBitmap; begin BMP := TSCARBitmap.Create(''); BMP.SetSize(50,50); DebugBitmap(BMP); Wait(500); repColor := 0; Color := 2907022 for y:=0 to bmp.Height-1 do for x:=0 to bmp.Width-1 do if BMP.Pixel[x,y] = repColor then BMP.Pixel[x,y] := Color; DebugBitmap(BMP); end.
×
×
  • Create New...