Jump to content
Sign in to follow this  

Detecting changing spell cast bar

Recommended Posts

There is a bar (with only sides) that is never within predictable coordinates, and is slightly transparent.  I need to be able to detect it if it exists, and if it does, its exact coordinates of where it is.  To make things more complicated, when no spells are selected, the bar disappears entirely.

The bar itself however has a predictable bracket on each side (a "[" and "]" in a brownish colour when there's nothing bright in the background). Please see attached example of 3 different images taken at different times. These are just random samples. As you can see in each case, zoomed out the bar looks the same, but zoomed in the pixel colours of the bar are different. Ignore the 3 circles in the middle, as these change (this is actually what I want to match when I know the relative coordinates of the bar, but these circles can't be matched directly either since they also change colour slightly as they are also slightly transparent). I want to find a way to match the bar wherever it is on the screen with 100% accuracy. From there I can easily deduce the circles, their order, etc.

I'm not sure how I can locate the exact location of this bar whenever needed (as mentioned, there are no predictable coordinates for it, it must be matched somehow from scanning the full in-game client window). 


Things I've tried:

1) Using PixelSearch. This fails because there is no pixel anywhere in the bar that keeps its colour. Now, the obvious thing to do is to increase the shading threshold, however there is another problem. The colours in the bar also exist elsewhere as scenery. As the shading threshold is increased, so too are false matches. Even in conjunction with "and" statements, the shading of the bar is as variable as the scenery itself, which is also matched. The only consistent thing is its bracket shape, not its pixel colour.

2) Using ImageSearch both for the bar and the circles. Once again this would fail since the colours are changing.


As a human it's easy to see the brackets, but I have no idea how to match this consistently with the computer. Could anyone recommend any function? Or, since I assume that programming this script through add-ons wouldn't be an easy task, could someone recommend a good online MOOC or course where I could learn the computer vision necessary (without any prior experience in this field) in order to fulfil this objective of mine?



Share this post

Link to post
Share on other sites


You appear not to have read the Forum rules since your arrival. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.



Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...