Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 71

Thread: Facebook - Farmville Bot

  1. #26
    Join Date
    Dec 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    When I want to collect from animals, it clicks on one, and then it misclicks and it moves my farm out of view.

    I'm using scar divi 3.21b, on windows 7, crosshair on farmville in firefox, farmville is zoomed out to the max and i've downloaded srl through scar.

  2. #27
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Nadeem View Post
    lol nice job nick rules i made a small bot aswell for me, buys/sells haysacks aswell for quick exp. i'll post it here if u want to take anything u find useful (:
    ~NS

    Hey there Nadeem and everyone!.

    I just studied the exp-generating methods of farmville a bit. The following solution seems to be the best one:

    1. Generate an empty field with the plowing tool. 1 exp - 15 g
    2. Place Soy-Beans on that field. 2 exp - 15 g.
    3. remove the soy-beans-field and goto 1.

    that would be 30 g for 3 exp

    1exp = 10 g

    The math for hay bales is:
    5 exp = 100 g

    1 exp = 20 g

    Meaning the method i'm suggesting is probably the best for exp. If someone knows a better method, please post!

    ~caused
    Last edited by caused; 10-24-2009 at 09:13 PM.

  3. #28
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by caused View Post
    Hey there Nadeem and everyone!.

    I just studied the exp-generating methods of farmville a bit. The following solution seems to be the best one:

    1. Generate an empty field with the plowing tool. 1 exp - 15 g
    2. Place Soy-Beans on that field. 2 exp - 15 g.
    3. remove the soy-beans-field and goto 1.

    that would be 30 g for 3 exp

    1exp = 10 g

    The math for hay bales is:
    5 exp = 100 g

    1 exp = 20 g

    Meaning the method i'm suggesting is probably the best for exp. If someone knows a better method, please post!

    ~caused
    Im aware of this strategy (: i was thinking of making a bot for this but if nickrules already has this on mind then i wouldn't need to



    ~NS

  4. #29
    Join Date
    Dec 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, here's the 'bot' for it:
    Code:
    program New;
    begin
    repeat
    ClickMouse(693, 508, True); //plowtool
    wait(1500);
    ClickMouse(390, 315, True);//field
    wait(1500);
    ClickMouse(646, 506, True); //multitool
    wait(1500);
    ClickMouse(417, 277, True);//field
    wait(2000);
    ClickMouse(172, 545, True);//buy
    wait(1500);
    ClickMouse(736, 507, True);//deletetool
    wait(1500);
    ClickMouse(417, 277, True);//field
    wait(1500);
    ClickMouse(328, 389, True);  //accept
    wait(1500);
    until(false);
    end.
    When you start farmville up, you're in the right startingposition. It has no failsafes, and timings could be ajusted a bit, I took quite long waitingtimes, because I run this in a vm, which gives a quite laggy result.

  5. #30
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Terror Factor View Post
    Lol, here's the 'bot' for it:
    Code:
    program New;
    begin
    repeat
    ClickMouse(693, 508, True); //plowtool
    wait(1500);
    ClickMouse(390, 315, True);//field
    wait(1500);
    ClickMouse(646, 506, True); //multitool
    wait(1500);
    ClickMouse(417, 277, True);//field
    wait(2000);
    ClickMouse(172, 545, True);//buy
    wait(1500);
    ClickMouse(736, 507, True);//deletetool
    wait(1500);
    ClickMouse(417, 277, True);//field
    wait(1500);
    ClickMouse(328, 389, True);  //accept
    wait(1500);
    until(false);
    end.
    When you start farmville up, you're in the right startingposition. It has no failsafes, and timings could be ajusted a bit, I took quite long waitingtimes, because I run this in a vm, which gives a quite laggy result.
    That won't work for long :P... Feel Free to add my "Anti Random Procedure". Here it is:
    SCAR Code:
    Function HandleRandoms:Boolean;
    var
    x,y,okbutton,coinsDTM: integer;
    begin

    If FindColor(x,y,3819203,0,195,xw,xh) then
    begin
      WriteLn('Some Window Random.. Killing');
      ClickMouse(x,y,True);
    end;

        coinsDTM := DTMFromString('78DA634C626460E004622470F7C515300D136' +
           '5AC06B25850D584CE9880AA2610C86226A02600C8E24355F3FFEF' +
           '535435A540162F7E730066DF0C24');

     okbutton := DTMFromString('78DA638C676460D809C448E0ED97FB0CAC401' +
           'A24FA1F08186B81ACF5A86AA6EC7104D33051467722D458035947' +
           '08A82926AC0600EF79128A');

    If FindDtm(okbutton,x,y,0,0,xw,xh) then
    begin
      WriteLn('Ok Button Random');
      ClickMouse(x,y,True)
    freedtm(okbutton);
      exit;
    end;

    freedtm(okbutton);
    //facebook window
    If FindColor(x,y,14203047,5,5,xw,xh) then
    begin
      WriteLN('Facebook Window Random');
      ClickMouse(x,y,true);
      result:=true;
      exit;
    end;



    If FindDtm(coinsDTM,x,y,0,0,xw,xh) then
    begin
      WriteLn('BuyCoins Random Detected');
      If FindColor(x,y,3819203,0,0,xw,xh) then
        ClickMouse(x,y,True)
        else
        WriteLn('Could not solve Random');
    end;
    freedtm(coinsDTM);
      result:=false;

    end;

  6. #31
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Red face

    New version released! version 1.4 has a new form design, a built in debug box, functions have been improved, and added. Try it out for yourself, and post feedback please! Read the first post for download and more detail, as well as instructions

    If some person with magical powers wouldn't mind updating the thread title to "[UPDATED 11/7] FB-Farmville Bot" that would be sweet. thanks
    Last edited by nickrules; 11-08-2009 at 01:02 AM.

  7. #32
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ahah Nice Lotsa work has been put in I see.

    Some stuff you can improve would be shortening down ur code for example, your pick procedure can be shortened down from:
    SCAR Code:
    procedure pick(Sender: TObject);
    begin
    ShowMessage('click an unusuall color of the plant your harvesting. basicly, not green...');
    WriteLn('PROCEDURE pick(Sender: TObject); STARTED AT '+TheTime);
    Wait(750)
    pickcolor(c,x,y)
    WriteDB('Picking All plants with that color!');
     repeat
     findcolor(x,y,c,0,0,662,440);
     Popups;
     Cmouse(x,y);
     HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
     L;
     repeat
     Popups;
     findcolor(x,y,c,0,0,662,440);
     Cmouse(x,y);
     HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
     D;
     repeat
     Popups;
     findcolor(x,y,c,0,0,662,440);
     Cmouse(x,y);
     HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
     UR;
     repeat
     Popups;
     findcolor(x,y,c,0,0,662,440);
     Cmouse(x,y);
     HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
     U;
     repeat
     Popups;
     findcolor(x,y,c,0,0,662,440);
     Cmouse(x,y);
     HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
    WriteLn('PROCEDURE pick(Sender: TObject); ENDED AT '+TheTime);
    end;

    to:
    SCAR Code:
    procedure pick(Sender: TObject);
    var left, down, up, right: Boolean;
    begin
      ShowMessage('click an unusuall color of the plant your harvesting. basicly, not green...');
      WriteLn('PROCEDURE pick(Sender: TObject); STARTED AT '+TheTime);
      Wait(750)
      pickcolor(c,x,y)
      WriteDB('Picking All plants with that color!');
      repeat
        if Findcolor(x, y, c, 0, 0, 662, 440) then
        begin
          Popups;
          Cmouse(x, y);
          HandlePause;
        end else
        begin
          if not left then L
          else if not down then D
          else if not up then U
          else if not right then UR
          else break;
        end;
      until (isfkeydown(4));
      WriteLn('PROCEDURE pick(Sender: TObject); ENDED AT '+TheTime);
    end;

    And so on, there are quite a few methods that can be shortened and made a bit more efficient, and standardizing would help [UI]ALOT[/U]



    ~NS

  8. #33
    Join Date
    Dec 2006
    Location
    @ yard
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sweet,I`m using this, its great
    i`m here as long as don`t get in the way...

  9. #34
    Join Date
    Oct 2006
    Posts
    334
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    hah, I have a friend who wanted me to play this. I was thinking, "wow, how stupid he is for just clicking a lot, I should make a script for it..."

    I'll make a farm and try this out!

  10. #35
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    THis thread makes me want to create Facebook bots. I'll start wih mafia.

  11. #36
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Eww, properly format your code... holy hell it's rough on the eyes

    *edit*
    Enjoy:
    SCAR Code:
    program ByNickRules;
    {.include srl/srl.scar}


    var //FORM VARIABLES
      EndInitForm : Boolean;
      frmDesign : TForm;
      Button1, Button2, Button3, Button4,
      Button5, Button6, Button7, Button8 : TButton;
      ComboBox1, ComboBox2 : TComboBox;
      GroupBox1 :TGroupBox;
      DBbox : TMemo;
      Magnify, Close, closes, OOS,enhanced, x,y,c, popu : Integer;  //SCRIPT VARIABLE
      ThePlant : String;
     

    {//////////////////basic procedures (all by me)\\\\\\\\\\\\\\\\\}
    procedure Cmouse(x,y: integer);
    begin
      holdmouse(x,y,true)
      wait(75)
      releasemouse(x,y,true)
    end;

    Procedure WriteDB(S: String);   {Writes in the form debug box}
    begin
     with DBbox.lines do
      begin
       add(s);
      end;
    end;

    Procedure CDB(sender: TObject);
    var
     i: Integer;
    begin
     with DBbox.lines do
      begin
       clear;
      end;
    end;

    procedure L;                    {search left}
    var
     x,y:integer;
    begin
      FindColorspiral(x,y,4758089,239,185,330,267)
      HoldMouse(x, y, True);
      MoveMouse(468, 171);
      ReleaseMouse(468, 171, True);
    end;

    Procedure D;                {search down}
    var
     x,y:integer;
    begin
      FindColorspiral(x,y,4758089,239,185,330,267)
      HoldMouse(x, y, True);
      MoveMouse(0, 107);
      Wait(202);
      ReleaseMouse(2, 107, True);
    end;
     
    Procedure UR;            {search up and right}
    var
     x,y:integer;
    begin
      FindColorspiral(x,y,4758089,239,185,330,267)
      HoldMouse(x, y, True);
      MoveMouse(43, 320);
      Wait(328);
      ReleaseMouse(43, 320, True);
    end;

    Procedure U;               {search up}
    begin
      FindColorspiral(x,y,4758089,239,185,330,267)
      HoldMouse(x, y, True);
      MoveMouse(540, 335);
      ReleaseMouse(540, 335, True);
      ReleaseMouse(540, 335, True);
    end;

    procedure HandlePause;    {checks for F3}
    begin
     if isfkeydown(3) then
      repeat
       wait(500)
      until(not isfkeydown(3))
    end;
    {End of basic procedures for script}

    Procedure LoadDTMs;
    begin
      Magnify := DTMFromString('78DA639CCAC4C0709C910119FCFFFF1F4CC34' +
           '419416A8EA1AAD9BD6C0AA69AA3A86ACA7C3451D5CC06AAB986AA' +
           '66654D00AA9A8544983319A8E61C01352D4035E7F1FB0B007EAD1' +
           '5E5');
      OOS := DTMFromString('78DA63546564606803622430658F239886893' +
           '2AA10A1A610C8FA82A2842174C6045435ED409632AA39FFFF3E45' +
           '55730DC87A4EC09C2540D633026A4481AC7634BBFEFF4755230C6' +
           '4F5E1F71700C794170E');
      Close := DTMFromString('78DA639CCDC8C060CF8002FEFFFF0FA619A17' +
           'CC649409603AA9AC36E56A86A9600598E04D42C00B25CF1DB0500' +
           '7C590C03');
      Enhanced := DTMFromString('78DA6374606460E8066224F0FFFF7F300D136' +
           '53407B2A6A1AA99B2C711554D3A90658F66CEDFA7A86A9A812C5E' +
           '5435A13326A0AA990F6409E2570300810F0DFC');
    end;

    Procedure Check2;
    var
     x,y:Integer;
    begin
     if(FindDTM(enhanced,x,y,0,0,747,480))then
      begin
       WriteLn('=========SCRIPT FAILER NOTICE=========');
       WriteLn('=GAME ENGINE ENHANCED')
       WriteLn('=TERMINATING SCRIPT');
       WriteLn('=========END OF FAILER NOTICE=========')
       terminatescript;
     end;
    end;

    procedure Popups;
    var
     x,y: Integer;
    begin
     If(FindDTM(OOS,x,y,0,0,747,480))then
      begin
       WriteLn('=========SCRIPT FAILER NOTICE=========');
       WriteLn('=THE GAME IS OUT OF SYNC WITH SERVER');
       WriteLn('=TERMINATING SCRIPT');
       WriteLn('=========END OF FAILER NOTICE=========')
       TerminateScript;
      end else
       begin
        If(FindDTM(close,x,y,0,0,747,480))then
         begin
          check2;
          WriteLn('SUCCESFULY BLOCKED A POPUP.');
          Inc(popup);
          WriteLn('POPUP COUNT := '+ IntToStr(popup));
          Cmouse(x,y)
         end;
       end;
    end;

    Procedure FindIt(P,sp: integer);
    begin
      WriteLn('PROCEDURE: FindIt(P,sp: integer); STARTED AT '+THetime);
      sp:=0;
      cmouse(684,558);
      wait(5000)
     for SP := -1  to P-1 do
      begin
       Cmouse(708,333);
       sp:=sp+1;
       wait(500)
      end;
       WriteLn('At page');
       WriteLn('PROCEDDURE FindIt(P,sp: integer); ENDED AT '+tHEtime);
    end;

    Procedure BuyIt(Slot: integer);
    begin
      WriteLn('PPROCEDURE BuyIt(Slot: integer); STARTED AT '+TheTime);
     case (slot) of
      1: begin
          Cmouse(170,351);
         end;
      2: begin
          Cmouse(308,352);
         end;
      3: begin
          Cmouse(446,351);
         end;
      4: begin
          Cmouse(585,351);
         end;
      5:begin
         cmouse(170,545);
        end;
      6: begin
          cmouse(309,545);
         end;
      7: begin
          cmouse(444,545);
         end;
      8: begin
          cmouse(582,545);
         end;
      end;
       WriteLn('PROCEDURE: BuyIt(Slot: integer); ENDED AT '+TheTime);
    end;

    Procedure CompleteIt(Page,Slot:Integer);
    begin
      WriteLn('PROCEDURE STARTED: CompleteIt(Page,Slot:Integer); AT '+TheTime)
      FindIt(Page,1);
      WriteLn('Going to page '+IntToStr(page))
      writeDB('Going to page '+IntToStr(page))
      wait(1000)
      WriteDB('At page. Buying Seed from slot '+IntToStr(slot));
      WriteLn('At page. Buying Seed from slot '+IntToStr(slot));
      BuyIt(Slot);
      WriteLn('PROCEDURE CompleteIt(Page,Slot:Integer); ENDED AT '+TheTime);
    end;

    procedure buylotsahaybales(sender:TObject); //Inspired by Nadeem :P
    var
     x,y,i: Integer;
    begin
      WriteLn('PROCEDURE buylotsahaybales(sender:TObject); STARTED AT '+TheTime);
      showmessage('makes a line from top to Right and down (/). press F4 at where you want the top row to be. Makes 25 haybales.');
     Repeat
      GetMousePos(x,y)
      wait(500)
     Until(isFkeydown(4))
      repeat
       Clickmouse(x,y,true);
       x := x-5;
       y := y+3;
       i := i+1;
      until(i>= 25)
       WriteDB('25 haybales placed!');
       WriteLn('PROCEDURE buylotsahaybales(sender:TObject); ENDED AT '+TheTime);
    end;

    procedure SellAllHaybales(Sender: TObject);
    begin
      writeLn('PROCEDURE SellAllHaybales(sender: TObject); STARTED AT '+THETIME);
      writeDB('Selling haybales!');
      wait(500)
      Cmouse(732,505);
     repeat
      FindColor(x,y,4304372,0,0,761,493);
      Cmouse(x,y)
      wait(400)
      cmouse(301,392)
      wait(400)
      until(isfkeydown(4) or not FindColor(x,y,4304372,0,0,761,493))
      WriteDB('Haybales Sold!');
      writeLn('PROCEDURE SellAllHaybales(sender: TObject); ENDED AT '+THETIME);
    end;

    procedure pick(Sender: TObject);
    begin
      ShowMessage('click an unusuall color of the plant your harvesting. basicly, not green...');
      WriteLn('PROCEDURE pick(Sender: TObject); STARTED AT '+TheTime);
      Wait(750)
      pickcolor(c,x,y)
      WriteDB('Picking All plants with that color!');
     repeat
      findcolor(x,y,c,0,0,662,440);
      Popups;
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
      L;
     repeat
      Popups;
      findcolor(x,y,c,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
      D;
     repeat
      Popups;
      findcolor(x,y,c,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
      UR;
     repeat
      Popups;
      findcolor(x,y,c,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
      U;
     repeat
      Popups;
      findcolor(x,y,c,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,c,0,0,662,440) or  isfkeydown(4)) ;
      WriteLn('PROCEDURE pick(Sender: TObject); ENDED AT '+TheTime);
    end;

    Procedure TS(sender:Tobject);
    begin
     frmDesign.ModalResult:= mrOk;
    end;

    Procedure plow(Sender: TObject);
    Begin
     WriteLn('PROCEDURE plow(Sender: TObject); STARTED AT '+TheTime);
     WriteDB('Plowing land!');
     wait(500);
     Cmouse(637,504);
     repeat
      Popups;
      findcolortolerance(x,y,1005420,0,32,662,440,25);
      Cmouse(x,y);
      HandlePause;
     until(not findcolortolerance(x,y,1005420,0,32,662,440,25) or  isfkeydown(4));
      L;
     repeat
      Popups;
      findcolor(x,y,1005420,0,32,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,1005420,0,32,662,440) or  isfkeydown(4)) ;
      D;
     repeat
      Popups;
      findcolor(x,y,1005420,0,32,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,1005420,0,32,662,440) or  isfkeydown(4)) ;
      UR;
     repeat
      Popups;
      findcolor(x,y,1005420,0,32,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,1005420,0,32,662,440) or  isfkeydown(4)) ;
      U;
     repeat
      Popups;
      findcolor(x,y,1005420,0,32,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,1005420,0,32,662,440) or  isfkeydown(4));
      WriteLn('PROCEDURE plow(Sender: TObject); ENDED AT '+TheTime);
    end;

    Procedure Plant(Sender: TObject);
    begin
      WriteLn('PROCEDURE Plant(Sender: TObject); STARTED AT '+TheTime);
      WriteDB('Planting!');
      CompleteIt(StrToInt(ComboBox1.text),StrToInt(ComboBox2.text))
      wait(1000);
     repeat
      Popups;
      findcolor(x,y,2709397,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,2709397,0,0,662,440) or  isfkeydown(4)) ;
      L;
     repeat
      Popups;
      findcolor(x,y,2709397,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,2709397,0,0,662,440) or  isfkeydown(4)) ;
      D;
     repeat
      Popups;
      findcolor(x,y,2709397,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,2709397,0,0,662,440) or  isfkeydown(4)) ;
      UR;
    repeat
      Popups;
      findcolor(x,y,2709397,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,2709397,0,0,662,440) or  isfkeydown(4)) ;
      U;
     repeat
      Popups;
      findcolor(x,y,2709397,0,0,662,440);
      Cmouse(x,y);
      HandlePause;
     until(not findcolor(x,y,2709397,0,0,662,440) or  isfkeydown(4)) ;
      WriteLn('PROCEDURE Plan(Sender: TObject); STARTED AT '+TheTime);
      WriteDB('Planting finished!');
    end;

    Procedure SetupPlayer;
    var
     x,y:Integer;
    begin
      FindDTM(magnify,x,y,555,427,761,495)
      Cmouse(x,y)
      Cmouse(x,y)
      Cmouse(x,y)
      Cmouse(x,y)
      Cmouse(x,y)
    end;

    Procedure Animals(sender: Tobject);
    var
     x,y,xx,yy:integer;
    begin
      WriteLn('PROCEDURE Animals(Sender: TObject); STARTED AT '+TheTime);
      WriteDB('Collecting animal products!');
     Repeat
      If FindcolorTolerance(x,y,12559825,0,0,662,440,5)  or FindcolorTolerance(x,y,8605387,0,0,662,440,5) then
       Cmouse(x+8,y+8);
       handlepause;
       Getmousepos(xx,yy)
       Cmouse(xx+40,yy+50)
       handlepause;
      Until(IsFkeydown(4) or not FindcolorTolerance(x,y,12559825,0,0,662,440,5) or Findcolortolerance(x,y,8605387,0,0,662,440,5))
       WriteLn('PROCEDURE plow(Sender: TObject); ENDED AT '+TheTime);
       WriteDB('Finished collecting animal products!');
    end;

    procedure InitFormOnClose(Sender : TObject; var Action : TCloseAction);
    begin
     if(not(frmDesign.ModalResult = 1))then
      EndInitForm := True;
    end;

    procedure InitForm;
    begin
      frmDesign := CreateForm;
     with frmDesign do
      begin
       OnClose := @InitFormOnClose;
       BorderStyle := bsSingle;
       BorderIcons := [biMinimize];
       Left := 601;
       Top := 103;
       ClientWidth := 534;
       ClientHeight := 306;
       Caption := 'Farmville Bot PRO';
       Color := clWhite;
       Font.Color := clWindowText;
       Font.Height := -11;
       Font.Name := 'OCR A Extended';
       Font.Style := [];
       PixelsPerInch := 96;
      end;
       Button1 := TButton.Create(frmDesign);
      with Button1 do
       begin
        Parent := frmDesign;
        Left := 0;
        Top := 64;
        Width := 177;
        Height := 57;
        Caption := 'Plow';
        TabOrder := 0;
        OnClick := @plow;
      end;
       Button2 := TButton.Create(frmDesign);
      with Button2 do
       begin
        Parent := frmDesign;
        Left := 352;
        Top := 64;
        Width := 177;
        Height := 57;
        Caption := 'Pick';
        OnClick := @Pick;
      end;
       Button3 := TButton.Create(frmDesign);
      with Button3 do
       begin
        Parent := frmDesign;
        Left := 176;
        Top := 64;
        Width := 177;
        Height := 33;
        Caption := 'Plant';
        OnClick := @plant;
      end;
       Button5 := TButton.Create(frmDesign);
      with Button5 do
       begin
        Parent := frmDesign;
        Left := 0;
        Top := 0;
        Width := 177;
        Height := 57;
        Caption := 'Collect Animal Products';
        OnClick := @animals;
      end;
       ComboBox1 := TComboBox.Create(frmDesign);
      with ComboBox1 do
       begin
        Parent := frmDesign;
        Left := 176;
        Top := 96;
        Width := 89;
        Height := 20;
        ItemHeight := 12;
        TabOrder := 5;
        Text := 'Page';
        with Items do
         begin
          Add('1');
          Add('2');
          Add('3');
          Add('4');
          Add('5');
          Add('6');
        end;
      end;
       Button6 := TButton.Create(frmDesign);
      with Button6 do
       begin
        Parent := frmDesign;
        Left := 176;
        Top := 0;
        Width := 177;
        Height := 57;
        Caption := 'Buy lotsa haybales';
        TabOrder := 6;
        OnClick := @BuyLotsaHayBales;
      end;
       Button7 := TButton.Create(frmDesign);
      with Button7 do
       begin
        Parent := frmDesign;
        Left := 352;
        Top := 0;
        Width := 177;
        Height := 57;
        Caption := 'Sell ALL haybales';
        TabOrder := 7;
        OnClick := @SellAllHaybales;
      end;
       GroupBox1 := TGroupBox.Create(frmDesign);
      with GroupBox1 do
       begin
        Parent := frmDesign;
        Left := 0;
        Top := 129;
        Width := 529;
        Height := 176;
        Caption := 'Debug Box';
        Color := clMedGray;
        ParentColor := False;
        TabOrder := 8;
      end;
       DBbox := TMemo.Create(GroupBox1);
      with DBbox do
       begin
        Parent := GroupBox1;
        Left := 0;
        Top := 16;
        Width := 529;
        Height := 153;
        ReadOnly := True;
        TabOrder := 0;
        ScrollBars := ssnone;
      end;
       Button4 := TButton.Create(frmDesign);
      with Button4 do
       begin
        Parent := frmDesign;
        Left := 448;
        Top := 272;
        Width := 81;
        Height := 33;
        Caption := 'Close Form';
        TabOrder := 3;
        OnClick := @TS;
       end;
        ComboBox2 := TComboBox.Create(frmDesign);
      with ComboBox2 do
       begin
        Parent := frmDesign;
        Left := 264;
        Top := 96;
        Width := 89;
        Height := 20;
        ItemHeight := 12;
        TabOrder := 9;
        Text := 'Slot';
        with Items do
         begin
          Add('1');
          Add('2');
          Add('3');
          Add('4');
          Add('5');
          Add('6');
          Add('7');
          Add('8');
        end;
      end;
       Button8 := TButton.Create(GroupBox1);
      with Button8 do
       begin
        Parent := GroupBox1;
        Left := 200;
        Top := 160;
        Width := 89;
        Height := 17;
        Caption := 'Clear';
        TabOrder := 1;
        OnClick := @CDB;
      end;
       WriteDB('Thank you for using the farmville bot pro by Nickrules.');
       WriteDB('For instructions, Or to post feedback/bugs, visit: ');
       WriteDB('SRL-Forums >scar> Other Scripts> FB-Farmville Bot');
    end;

    procedure SafeInitForm;
    var
      v : TVariantArray;
    begin
      SetArrayLength(v, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowInitFormModal;
    begin
      frmDesign.ShowModal;
    end;

    procedure SafeShowInitFormModal;
    var
      v : TVariantArray;
    begin
      SetArrayLength(v, 0);
      ThreadSafeCall('ShowInitFormModal', v);
    end;

    procedure MainInitForm;
    begin
      try
       SafeInitForm;
       SafeShowInitFormModal;
      finally
       FreeForm(frmDesign);
      except
       WriteLn('An error seems to have occurred in: InitForm');
      end;
    end;


    begin
      setupsrl;
      loadDTMs;
      ClearDebug;
      GetSelf.WindowState := wsMinimized;
      MainInitForm;
      GetSelf.WindowState := wsNormal;
     if(EndInitForm) then
      TerminateScript;
      writeln('ran for '+ timerunning)
      writeln('closed '+Inttostr(closes) +' popups');
    end.

    I properly formatted your code.

    Some suggestions:
    • I would not recommend using x,y as both local and global variables. Change that.
    • Fix the form, it looks horrid
    • Make the hay bales selling procedure handle all colors of hay bales (I assume it only handles standard hay bales currently?)
    • Look for improvments in your code. Do you really need "Cmouse" when you can use a simple "clickmouse".... Why reinvent the wheel?
    • Standardize the names for your procedures, haveing procedures named "L" and "D" is just ugly. Give your procedures/functions short descriptive names(i.e. insteed of "procedure L make that "procedure Search Left", etc.)

    And several other things that I can pick at. But for a newer member this isn't bad work. Good Job.

    *Edit Again*
    I got bored so I rewrote you SellAllHayBails procedure

    Code:
    Procedure SellAllHayBales(Sender :Tobject);
    var
     Color: Array [0..7] of integer;
     i,Bx,By: integer;
    Begin
      Color[0]:=4173295;  //Normal
      Color[1]:=2369966;  //Red
      Color[3]:=14140862; //White
      Color[3]:=14832960; //Blue
      Color[4]:=8289918;  //black
      Color[5]:=5293962;  //pink
      Color[6]:=12040945; //green
      Clickmouse(732,505, true)
     for i:=0 to 6 do
      if(FindColor(Bx,By,Color[i],0,0,761,493))then
       begin
        Clickmouse(Bx, By ,true)
        wait(400)
        clickmouse(Bx + 16,By + 30, true)
       end else
        WriteDB('No Haybales found');
        exit;
    end;
    I haven't tested it so I wouldn't trust those colors, I'd pick them yourself
    Last edited by Bebe; 11-09-2009 at 09:26 AM. Reason: Added suggestions + formatted code

  12. #37
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Unhappy

    Quote Originally Posted by Bebe View Post
    Eww, properly format your code... holy hell it's rough on the eyes

    *edit*
    Enjoy:


    Some suggestions:
    • I would not recommend using x,y as both local and global variables. Change that.
    • Fix the form, it looks horrid
    • Make the hay bales selling procedure handle all colors of hay bales (I assume it only handles standard hay bales currently?)
    • Look for improvments in your code. Do you really need "Cmouse" when you can use a simple "clickmouse".... Why reinvent the wheel?
    • Standardize the names for your procedures, haveing procedures named "L" and "D" is just ugly. Give your procedures/functions short descriptive names(i.e. insteed of "procedure L make that "procedure Search Left", etc.)

    And several other things that I can pick at. But for a newer member this isn't bad work. Good Job.

    *Edit Again*
    I got bored so I rewrote you SellAllHayBails procedure

    Code:
    Procedure SellAllHayBales(Sender :Tobject);
    var
     Color: Array [0..7] of integer;
     i,Bx,By: integer;
    Begin
      Color[0]:=4173295;  //Normal
      Color[1]:=2369966;  //Red
      Color[3]:=14140862; //White
      Color[3]:=14832960; //Blue
      Color[4]:=8289918;  //black
      Color[5]:=5293962;  //pink
      Color[6]:=12040945; //green
      Clickmouse(732,505, true)
     for i:=0 to 6 do
      if(FindColor(Bx,By,Color[i],0,0,761,493))then
       begin
        Clickmouse(Bx, By ,true)
        wait(400)
        clickmouse(Bx + 16,By + 30, true)
       end else
        WriteDB('No Haybales found');
        exit;
    end;
    I haven't tested it so I wouldn't trust those colors, I'd pick them yourself
    *Already fixed standards the day after 1.4 was released....
    * didn't know x,y WAS a global.. thats from the really old versions of the script (as in, no procedures, just one huge loop). I'll get to that
    *I do need Cmouse, because my crapy computer cant handle the speed it clicks at, and therefore, does not click.
    *I think the form looks fine, its not exactly meant to be super 'spify'. and its my second. and i hate forms with separate files.

    Thanks for the advices and such. I added the sellhaybles procedure you made. personally, i dont see a reason to differently colored haybales though.
    thanks again.

    Quote Originally Posted by mrpickle View Post
    THis thread makes me want to create Facebook bots. I'll start wih mafia.
    make it work with cuba and moscow. :P

  13. #38
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Looking fine.

    I tried it to collect animal stuffs :x.. It seems to fail when your animals are on a cluster though :/.

    ~caused

  14. #39
    Join Date
    Nov 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how to use the scirpt..pls help..newbie..........

  15. #40
    Join Date
    Jun 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Heya,

    I love the script. The only issue I've noticed is that it has large issues with animal picking. Perhaps you could look for the bitmap of that pink arrow and click on it?

    Also, when planting it instead plows. I'm not sure why that is.

  16. #41
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Red face

    Quote Originally Posted by bagofelix View Post
    Heya,

    I love the script. The only issue I've noticed is that it has large issues with animal picking. Perhaps you could look for the bitmap of that pink arrow and click on it?

    Also, when planting it instead plows. I'm not sure why that is.
    I found that (plow button plants) like 10 minuets after uploading, so i fixed that. do you have the latest version? I had to re-upload.
    Or change line 450 to this:

    Code:
        OnClick := @Plow;
    I am aware of the animal collecting issues. The little symbol is slightly transparent though. thats why its caused so many issues.

    Quote Originally Posted by jassi32 View Post
    how to use the scirpt..pls help..newbie..........
    As for you, You must have scar and SRL installed. Then drag the aimer looking thing over the game. Then click play, and click the button for the task you wish to do.
    Last edited by nickrules; 11-10-2009 at 09:51 PM.

  17. #42
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Your standards are awful >.<.

  18. #43
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Suggestions:
    - Look for the pink color whilst looking for animarl harvesting (choose the dark pink)
    - When about to harvest plans, make sure its scrolled all the way out
    - A good fail safe would be to check inflate the point by 6px and check if the color white or inflate by 3px if color brown exists. This is to make sure its not trying to plow/plant/harvest anything that cannot be done. (farmville draws a new cursor and hides ur real cursor whilst trying to do the actions, so your basically checking for their drawn cursor)
    - Another way for the failsafe would be to check if the bracket exists when mouse hovers over
    - Toggling display quality to low would help with colors
    - For messages (expecially for buy sell etc...) check for the green/red buttons and wait for them to display/click and set a time outs, i've noticed it gets stuck alot

    Fun Stuff:
    - Before and after experience count

    Edit: I'll post my haybale sell/buy and also the soybeans plant/buy/sell when i get home in a few hours



    ~NS
    Last edited by Nadeem; 11-10-2009 at 09:57 PM.

  19. #44
    Join Date
    Sep 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quick question but do you guys have scar actually highlight only Farmville as of right now? Whenever I try to highlight Farmville the entire facebook gets highlighted. If that's the case for everyone then what size screen is being used? Because the planting procecdure is very messed up whenever I try to use it.
    My chicken killer http://villavu.com/forum/chicken-killer-t39114.html
    Still working on those feathers

  20. #45
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by barbarianl3t View Post
    Quick question but do you guys have scar actually highlight only Farmville as of right now? Whenever I try to highlight Farmville the entire facebook gets highlighted. If that's the case for everyone then what size screen is being used? Because the planting procecdure is very messed up whenever I try to use it.
    That happens to me on linux, windows how ever is fine...



    ~NS

  21. #46
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by barbarianl3t View Post
    Quick question but do you guys have scar actually highlight only Farmville as of right now? Whenever I try to highlight Farmville the entire facebook gets highlighted. If that's the case for everyone then what size screen is being used? Because the planting procecdure is very messed up whenever I try to use it.
    adjust your browser so that the farmville client is in the upper left corner to work around that problem .

    My bot finds the farmville window itself so, it does not matter where on the screen it is, as long as its fully visible.

    ~caused

  22. #47
    Join Date
    Nov 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    my mom prob like this

  23. #48
    Join Date
    Nov 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how do i stop this error when trying to run/compile

    Code:
    Line 51: [Error] (51:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\Math.scar

  24. #49
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by pitx View Post
    how do i stop this error when trying to run/compile

    Code:
    Line 51: [Error] (51:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\Math.scar
    I think 'CreateTPAFromBMP' is something from the wizzyplugin (?). If so you'd need to install that.

    Can someone please verify ? XD

    ~caused

  25. #50
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    Interesting! Are there more people scripting for farmville? And is it fun (and profitable) to do? Because if it is, I am willing to open up a farmville section Lots of possibilities for this....
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •