Adblock breaks this site

Advanced question regarding mouse cursor detection

Discussion in 'Scar/Simba Help' started by Janektamm2, Sep 17, 2009.

  1. Janektamm2

    Janektamm2 Newcomer

    Joined:
    Sep 17, 2009
    Posts:
    1
    Referrals:
    0
    Sythe Gold:
    0
    Advanced question regarding mouse cursor detection

    Hello scar scripters,

    I'm looking for a way to detect if the current mouse position is on a link by looking at the mouse cursor's image itself. I'm afraid this is the only way i can do it.

    I've already tried to take a screenshot of mouse cursor that displays when
    it's on a link however screenshots don't include cursor images. Nor does scar
    count the cursor's bitmap or colors when looking for pixels/bitmaps on the screen.

    I'll give you a not working sample of the outcome i'm looking for:

    Code:
    Program new;
    var
    x,y,cursorimage:integer;
    begin
    cursorimage := loadbitmap('C:\junkfolder\cursor.bmp');
    repeat
    movemousesmooth(500+random(100),200+random(100));
    wait(200);
    until(findbitmapin(cursorimage,x,y,500,200,600,300));
    getmousepos(x,y);
    wait(200)
    movemousesmooth(x,y);
    wait(200)
    clickmouse(x,y,true);
    end.
    Thats it, help is appreciated.


    EDIT:

    I'm thinking that there can be an alternative after all.

    Could something like this work?

    Code:
    if(not(findcolor(x,y,16777215,100,500,200,600)))then
    movemousesmooth(x,y)
    This doesn't work but i would like the program to store coordinates where the color WASN'T 16777215.

    The moving object i'm trying to click has too many color variations to effectively detect it's location by color. But the background of the object is moving on is always white(16777215).

    This shouldn't be too hard so there actually must be a way to solve this.
     
  2. dopeness

    dopeness Newcomer

    Joined:
    May 5, 2009
    Posts:
    5
    Referrals:
    0
    Sythe Gold:
    0
    Advanced question regarding mouse cursor detection

    u need to put the bitmap into a string
     
< how to use for statements in scar? | i need a quick answer please, its an easy question that im asking >


 
 
Adblock breaks this site