Rather than relying on pixel-color matching or image templates, the macro reads item names directly from the screen using the Windows UWP OCR engine (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Flyingbacen/Sols-Biome-Randomizer-Macro/llms.txt
Use this file to discover all available pages before exploring further.
Windows.Media.Ocr). A configurable screen rectangle is captured after searching for the item in the inventory, the text is extracted, and a fuzzy-matching algorithm confirms whether the correct item is visible. This approach is resilient to minor UI changes, font rendering differences, and small variations in how the game renders text — as long as the bounding rectangle is positioned correctly.
How OCR Detection Works
When the scheduler determines an item needs to be used, it callsUseItem(Item). That function:
- Activates the Roblox window and opens the inventory (
InventoryX,InventoryY). - Navigates to the Items tab by clicking (
InventoryItemsX,InventoryItemsY). - Clicks the search box (
SearchX,SearchY) and pastes the item name from the clipboard with^vfor speed and consistency. - Calls
OCR.FromRect()on the screen-adjusted rectangle defined byRectangleTopX,RectangleTopY,RectangleWidth, andRectangleHeightfromsettings.ini. The options passed are:
- Strips the quantity suffix by splitting on
"x"and taking the first segment — for example,"Biome Randomizer x3"becomes"Biome Randomizer"afterTrim(StrSplit(results, "x")[1]). - Passes the cleaned text to
FuzzySearch(). If the Levenshtein distance between the OCR result and the expected item name is ≤ 3, the item is considered found and the macro clicks the slot and the Use button.
UseItem() returns false immediately without clicking anything.
Fuzzy Matching
Levenshtein distance counts the minimum number of single-character insertions, deletions, or substitutions required to transform one string into another. A distance of 0 means the strings are identical; a distance of 3 means up to three characters are wrong or missing. The threshold of ≤ 3 is generous enough to handle common OCR misreads — for instance,"Biorne Randomizer" (one substitution) or "BiomeRandomizer" (one deletion) — without accepting completely different item names.
CaseSense := false in UseItem(), so capitalisation differences from OCR do not cause false negatives.
Bypassing OCR
SettingIgnoreOCR=true in settings.ini under [Toggles] skips the OCR step entirely. When this flag is active, the macro clicks the item slot at the midpoint of the configured rectangle (RectangleMidX, RectangleMidY) without checking what is displayed there.
This can be useful as a workaround when the Windows OCR engine is unavailable or consistently returning empty results, but it carries risk: if the search returns a different item in the first slot, the macro will use that item instead.
OCR Options Used
| Option | Value | Purpose |
|---|---|---|
lang | "en-US" | English language recognition model |
invertcolors | true | Inverts pixel colours before processing — improves detection against Sol’s RNG’s dark inventory background |
grayscale | true | Converts the captured region to greyscale, reducing colour noise before recognition |
scale | 2 | Used in CheckEden() (full-window scan) only — doubles the image size for better small-text recognition |
scale: 2 option is not applied in UseItem(), only in the Eden detection scan via OCR.FromWindow().