Jump to content

Search the Community

Showing results for tags 'faq'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Forum Rules
    • Announcements
    • General Discussion
    • Forum Discussion
  • Support
    • Download SCAR Divi
    • SCAR Divi Manual
    • General Help
    • Scripting Help
    • Script Help
    • Tutorials and FAQ
  • Scripts
    • Scripts For Games
    • Game Scripts
    • Other Scripts
    • Requests
  • Include Libraries
    • OSI
    • MSSL
    • GMRL
    • SSIL
    • Archive
  • Code Bin
    • Mouse & Keyboard
    • Screen & Client
    • Color, Bitmap, DTM & OCR
    • Points & Boxes
    • Files & Networking
    • Math
    • Other Snippets
  • Development
    • Development Roadmap
    • Bugtracker
    • Development Discussion
  • Games
    • RuneScape
    • Seafight
    • Other Games
  • Misc
    • Native Corner
    • Programming
    • Graphics
    • Music
    • Movies & TV

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Location


Interests


Occupation


Studies


Skype

Found 6 results

  1. In SCAR Divi 3.31 I've made a small change to the encoding for bitmaps so it can very easily be encoded or decoded outside of SCAR. The 'c' type bitmap encoding is set up by converting every pixel of the bitmap row-by-row into a RGB values and suing those in the same sequence as ANSI encoded characters to build a string formatted as 'RGBRGBRGB...', after this the string is compressed with the ZLib compression library and encoded in Base64. Finally 'c' is appended to the front of the string to indicate the encoding type. Here an example of how a bitmap is manually decoded in SCAR (you need SCAR Divi 3.31): [scar]var Bmp, Bmp2, W, H, I, Color: Integer; Str, Tmp: AnsiString; begin try // Load bitmap Bmp := BitmapFromString(19, 16, 'ceNplkwmWojAURd1Tb6HW0lvotfQW3EKBIKgoEAI' + 'IKFOCyiDI4A7sH1JSnOp33mH8l4Sfl/WxWDPnsptLznWyDHZv8Fw5lhu/2p3uWvjQ4w6lg' + '0XBT3j1ZZexsnMDLxYL2b3CE+WYq165DUrtVB+ixkg6iwx29gTzSrA0ejHq9ZufR5yxxS6' + 'o9iGArUV7Oxvcy7DC2WSOzA2S7GztXDderp0rI24w6W06ONkgmKlgEgFRARE+ivnrmwKJK' + 'JUsojiXrV/oUW0lrU06h/afRjI65WXv8nHCrxccBT0UUSzbZHO8HU6lGdeYAPvgIB8IPLF' + 'wPX1ENELZYjVaUBhhjZIGpw1MlRdzc/b/OfOj5ud6dEdJDaBosZ78eWvCp/p5o0AGB5OGr' + '9rHW3N8AudrZEQ1gt6mD8Ut4Ha5XH7MxPHvLgH+d/TI4pQ1R/Eq1at4wRzn4A+EC9PWoR0' + 'HVb/a+Pc5zsHpZ7/albSYJaeHdWQJ9wrFKxW/BFx94z+0jx6QNzPtMYWsDjbtV/gi2Syls' + 'BdYyFngYbOUkG01qLZBvT3Xu3Ozj9tD0plsazwxmAyfEDnEIieiDJaGhda+rJzb2snZTMZ' + 'fABD21CFu9bRH9GllgPf/ABzKAUs='); // Convert the bitmap back to a string ^^^ Str := BitmapToString(Bmp); // Get the dimensions of the bitmap GetBitmapSize(Bmp, W, H); finally // Free the original bitmap FreeBitmap(Bmp); end; // Create a new bitmap with the dimensions of the original Bmp2 := BitmapFromString(W, H, ''); try // Check the bitmap prefix (This is an indicator for the bitmap string format) if Str[1] = 'c' then begin // Decode and decompress the bitmap with the prefix removed Str := ZLibDecompress(Base64ToStr(Copy(Str, 2, Length(Str) - 1))); // Loop through all pixels which are stored in the string as RGBRGBRGB... for I := 0 to Length(Str) div 3 - 1 do begin // Get the RGB characters for the current pixel Tmp := Copy(Str, I * 3 + 1, 3); // Convert the RGB characters to a color Color := RGBToColor(Byte(Tmp[1]), Byte(Tmp[2]), Byte(Tmp[3])); // Calculate the coordinates of the color on the bitmap and color the pixel FastSetPixel(Bmp2, I mod W, I div W, Color); end; // Show the new bitmap DebugBitmap(Bmp2); end; finally // Free the new bitmap FreeBitmap(Bmp2); end; end.[/scar] This insight should make it easier for people to for example encode bitmaps in PHP or other languages which can then be used in SCAR.
  2. SCAR Divi 3.25 supports commandline interaction a whole lot better than any previous versions. There was a lot of demand for it, hence I decided to expand on it a bit. Aside from all previous commands now working properly, there's a few new ones. Here's a small guide: -nonews Prevents SCAR from downloading and displaying the news. -noupdate Prevents SCAR from checking for updates and showing an alert if an update is available. -open Opens all scripts specified after this parameter. -run Runs the script that was last opened. -tray Moves SCAR to the tray when it's opened or an open instance when single window mode is active. -force Forces open a new window when single window mode is enabled. The system is pretty flexible too. Any file that is in the parameters and not behind a specific parameter that takes file arguments (currently only -open), will be associated with -open. So you can for example open a file by running "scar.exe file.scar" instead of "scar.exe -open file.scar" I hope this thread was of use, if you have questions, be sure to post them in here. ~Freddy
  3. Also note that BEFORE you use these methods, you can change the Color Accuracy by changing the Color Tolerance Speed. Default is RGB w/ 3D space, but you can change this to HSL, or XYZ...this explains this here and here's the CTS function here. Note the higher the CTS the slower finding will be, but more accurate. Note: CTS2 is preferred if you want to change it from the default (CTS1) just remember if you want it back to default you have to set it to 1. FindColor(s)(Tol)Ex functions + Split TPA, + Filtering TPA's out by Length: DTM Finding, or using DDTM's: Find MMDots: Find MMDots -> MMsToMS: GetUpText Method/ Text Methods in general: FindObj(Spiral)(Size) Methods, these use some of the Same TPA Splitting and Sorting found in the first screenie: ---- PixelShift detection function (we need these, can't find working ones at the moment) I think MSSL's don't work? Well they won't work on these Bankers. CountColor is another notable function. Some of these functions are more meant for Finding then others. Others are just meant to tell you general information rather than find a specific object in 3D space. Like CountColor can't be used to Find a Banker. But could be used to tell if we were at the bank, or to make sure the banker IS a banker, etc, But NEVER where the banker is (usually). These methods use Color Finding combined with Distance (most of the time), these drive the whole finding process for SCAR Divi, and are used throughout the Runescape related includes, and other game includes. If anyone has any other methods, please post a reply, and I might add them to the list! ------------------------------------------------------------------------------------------------------------------------------------------------- Bitmaps are great too! They have some setbacks. I wouldn't recommend them for Runescape or games in general. Some good Tol, Rotated, finding functions, but I think the GREATEST one, being FindDeformedBitmap is still broke (I could be wrong though). There's a bug for it in the bugs section. Here's some of the bitmap functions that work, but keep in mind that if ONE pixel is off or something, you might never find the bitmap in the game. Works well for Inventory items though... Note: you can also load a bitmap and grab the colors from it, make a TPA, etc. Or ANY of these IMAGE TYPES: Png, Jpeg, Bmp 2nd Note: Spiraling, points, or using Find(Blank)Spiral functions are good too, you can start your search and go outward from a point. Last Note: In 3D games, like Runescape 2. Most MMO's or some have a Mini Map or some way so you know where your character is going. Might even show you what Camera rotation you are at. If you set your camera to North, and find what position you are at (using minimap functions or etc.). You can, sometimes use functions like CountColor to find objects on the 3D world because you have a scenario. E.g. Camera's north, I'm at the Bank, camera's height is set high. You'll probably be able to see the Blue color of the bankers in this Box(X1, Y1, X2, Y2). This can go for other games too. So you can "Blindly" do things sometimes too based on that. ------------------------------------------------------------------------------------------------------------------------------------------------- ~LordJashin DTM's, if they were expanded to an array level they'd be the best! I think doing FindColor(s)(Tol)Ex + SplitTPA + FilterATPAMinSize + Comparing the distance with other objects = The most accurate it can be at the moment. Edit: Need to add ACA/auto coloring on here eventually, and maybe SPS.......SPS uses some crazy functionality with the accuracy var and the T3DIntArray comparisons.
  4. SCAR Divi allows you to use the string and AnsiString types to represent strings. The difference is that string supports unicode and AnsiString does not. Due to backwards compatibility concerns, SCAR does however not support unicode, and all functions in SCAR use AndiString because of this. Therefore it's suggested that scripters use AnsiString rather than string in scripts as well as using string might cause unwanted issues. Support for unicode may be added to Divi in the future, but for now it will not be as it would break backwards compatibility, this would only be done in a single release to avoid spreading out large breaking changes over multiple releases.
  5. ~ The Includes Manager ~ The includes manager is SCAR's primary source of include downloads. If you're not an include developer, you should normally always use it to install and receive updates for includes. Installing To install an include, simply click it and press the install button. Updating Once an update is available for your installed include, No will show up in the updated column for the include. You can now select the include and press the update button. Note that an update will erase any changes you may have made to the include. Reinstalling If you've made some changes to the include and wish to erase them, you can select the include and rpess the reinstall button. Removing A removal option is also available, select an installed include and press Remove. Note: Finally note that after you've made any changes in the includes manager, you should go into SCAR's Tool menu and press "Reload Plugins". The includes manager does not do this by itself because it stops the execution of scripts accross all active instances of SCAR, which may not be desirable.
  6. SCAR contains a number of standard compiler defines that allow you to easily create backwards compatibility in your scripts. You can include/exclude code from a script during compilation with these. Defines: DIVI - Defines in every SCAR Divi version since about 3.04 SCAR3xx-yy_UP - Defined in every SCAR Divi version since 3.38.00, the xx is replaced by the major version number and yy by the minor version number. For 3.38.00 this would be SCAR338-00_UP. These defines remain in every version following the one where it was added. SCAR3xx_UP - Defined in every SCAR Divi version since about 3.04, the xx is replaced by the major version number. For 3.25 this would be SCAR325_UP. These defines remain in every version following the one where it was added. SCAR3xx - Defined in every SCAR Divi version since about 3.04, the xx is replaced by the major version number. This is removed witht he next version where a new one for that version is present. PORTABLE - Only present in the portable version of SCAR as of the 3.25 release. SCAR_PREALPHA - Only present in pre-alpha releases of SCAR as of the 3.32 release. Pre-alpha releases are usually not distributed to the public. SCAR_ALPHA - Only present in alpha releases of SCAR as of the 3.32 release. SCAR_BETA - Only present in beta releases of SCAR as of the 3.32 release. SCAR_RC - Only present in release candidate releases of SCAR as of the 3.32 release. SCAR_FINAL - Only present in final build releases of SCAR as of the 3.32 release. Note that the SCAR3xx_UP and SCAR3xx defines will change to SCAR4xx_UP and SCAR4xx for SCAR 4 when it's released, all older 3xx defines will still be in there.
×
  • Create New...