Farmville Hay Bale Script Mouse Location Problem

Discussion in 'Scar/Simba Help' started by valzi, Nov 10, 2009.

Farmville Hay Bale Script Mouse Location Problem
  1. Unread #1 - Nov 10, 2009 at 2:50 AM
  2. valzi
    Joined:
    Nov 10, 2009
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0

    valzi Newcomer

    Farmville Hay Bale Script Mouse Location Problem

    I'm trying to get just one piece of this code to work correctly. The rest works fine. After selecting a hay bale and choosing to sell it, the mouse moves to about an inch above the confirmation dialog to click "accept" rather than where it should be. What do I need to change to help it find the "accept" button?

    I found the script here: http://www.sythe.org/showthread.php?t=705528&highlight=farmville

    Code:
    program FarmVilleAutoSellHayBales;
    var x, y, max_x, max_y, fx, fy, hay, accept, sell : integer;
    var acc : extended;
    
    function randify(i, q : integer):integer;
    begin
    if(random(14)<=5)then
    begin
    q:=q+random(i);
    end else
    begin
    q:=q-random(i);
    end;
    Result:=q;
    end;
    
    function Click(x,y:integer) : boolean;
    begin
    ClickMouse(x, y, true);
    Result:=true;
    end;
    
    begin
    hay := BitmapFromString(1, 9, 'beNqrE+sIkjneYrghX/ZQh/btGQY' +
           'f1zh+3uDyaZPrPgCtKA3H');
    sell := BitmapFromString(1, 60, 'beNpzdv7///+9e/d0dXVVVVWZm' +
           'Zk3bNjwHwxmz57tDAD9XxE7');
    accept := 4308116;
    x:=0; y:=0;
    ClearDebug;
    GetClientDimensions(max_x, max_y);
    ActivateClient;
    GetMousePos(fx, fy);
    wait(1000+random(500));
    
    repeat
    
    if(FindDeformedBitmapToleranceIn(hay,x,y,0,80,max_x,max_y,20,0,False,acc))then
    begin
    Click(x+7, randify(4,y+7));
    wait(100+random(100));
    repeat
    wait(50);
    until(FindDeformedBitmapToleranceIn(sell,x,y,0,80,max_x,max_y,20,0,False,acc));
    Click(x+7+random(50), randify(2,y+4));
    repeat
    wait(50);
    until(FindColor(x,y,accept,120,150,max_x,max_y));
    wait(250+random(250));
    Click(257+random(100), randify(11,390));
    wait(1000+random(250));
    end;
    
    wait(50+random(50));
    
    until(IsFKeyDown(2));
    
    MoveMouse(fx, fy);
    
    end.
     
  3. Unread #2 - Nov 14, 2009 at 11:10 AM
  4. The Pocked Man
    Joined:
    Nov 14, 2009
    Posts:
    29
    Referrals:
    0
    Sythe Gold:
    0

    The Pocked Man Member

    Farmville Hay Bale Script Mouse Location Problem

    Code:
    until(FindColor(x,y,accept,120,150,max_x,max_y));
    wait(250+random(250));
    //Click(257+random(100), randify(11,390)); //<---- Problem
    Click(x,y); //<-- FIXED
    wait(1000+random(250));
    end;
     
  5. Unread #3 - Nov 14, 2009 at 3:44 PM
  6. valzi
    Joined:
    Nov 10, 2009
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0

    valzi Newcomer

    Farmville Hay Bale Script Mouse Location Problem

    The cursor moves CLOSER to the accept button now, but it still doesn't make it there. Thanks for the effort.
     
  7. Unread #4 - Nov 14, 2009 at 9:36 PM
  8. The Pocked Man
    Joined:
    Nov 14, 2009
    Posts:
    29
    Referrals:
    0
    Sythe Gold:
    0

    The Pocked Man Member

    Farmville Hay Bale Script Mouse Location Problem

    gah, just add a number to x & y then so it clicks the right place....

    click(x+10,y+10);

    adjust the numbers until it clicks the right spot.
    positive number on x moves the mouse to the right, negative to the left.
    positive number on y moves the mouse down, negative moves it up.
     
  9. Unread #5 - Nov 24, 2009 at 2:39 AM
  10. d1343
    Joined:
    Nov 24, 2009
    Posts:
    2
    Referrals:
    0
    Sythe Gold:
    0

    d1343 Newcomer

    Farmville Hay Bale Script Mouse Location Problem

    hey plz tell me how to use this code
    plz help me ty
     
  11. Unread #6 - Nov 24, 2009 at 2:43 AM
  12. valzi
    Joined:
    Nov 10, 2009
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0

    valzi Newcomer

    Farmville Hay Bale Script Mouse Location Problem

    Thanks Pocked Man; that fixed my problem.
     
  13. Unread #7 - Nov 24, 2009 at 2:48 AM
  14. d1343
    Joined:
    Nov 24, 2009
    Posts:
    2
    Referrals:
    0
    Sythe Gold:
    0

    d1343 Newcomer

    Farmville Hay Bale Script Mouse Location Problem

    can someone tell me how to use this program plz plz ty
     
  15. Unread #8 - Dec 9, 2009 at 2:38 PM
  16. ervisijuve
    Joined:
    Dec 9, 2009
    Posts:
    1
    Referrals:
    0
    Sythe Gold:
    0

    ervisijuve Newcomer

    Farmville Hay Bale Script Mouse Location Problem

    can you explain it to me please.thnx
     
< Scar Freezes while in script | Problem on Colorsearching 2 things. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site