Adblock breaks this site

Farmville Hay Bale Script Mouse Location Problem

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

  1. valzi

    valzi Newcomer

    Joined:
    Nov 10, 2009
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  2. The Pocked Man

    The Pocked Man Member

    Joined:
    Nov 14, 2009
    Posts:
    29
    Referrals:
    0
    Sythe Gold:
    0
    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;
     
  3. valzi

    valzi Newcomer

    Joined:
    Nov 10, 2009
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  4. The Pocked Man

    The Pocked Man Member

    Joined:
    Nov 14, 2009
    Posts:
    29
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  5. d1343

    d1343 Newcomer

    Joined:
    Nov 24, 2009
    Posts:
    2
    Referrals:
    0
    Sythe Gold:
    0
    Farmville Hay Bale Script Mouse Location Problem

    hey plz tell me how to use this code
    plz help me ty
     
  6. valzi

    valzi Newcomer

    Joined:
    Nov 10, 2009
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0
    Farmville Hay Bale Script Mouse Location Problem

    Thanks Pocked Man; that fixed my problem.
     
  7. d1343

    d1343 Newcomer

    Joined:
    Nov 24, 2009
    Posts:
    2
    Referrals:
    0
    Sythe Gold:
    0
    Farmville Hay Bale Script Mouse Location Problem

    can someone tell me how to use this program plz plz ty
     
  8. ervisijuve

    ervisijuve Newcomer

    Joined:
    Dec 9, 2009
    Posts:
    1
    Referrals:
    0
    Sythe Gold:
    0
    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. >


 
 
Adblock breaks this site