+ Reply to Thread
Page 1 of 13 12311 ... LastLast
Results 1 to 10 of 124

Thread: FarmVille Bot Program!

  1. #1
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    FarmVille Bot Program!

    FarmVille Bot
    So I just created my bot. I had it working last night, but when I was thinking of how I could make it more cross compatible between browsers and resolutions I solved the issue and rewrote it!

    Compiling and Running
    To compile the source save it as .au3 and compile using the program available for download here.

    Run the program, hit "Alt + A" to start the program, youll be promompted to input a code, you probably don't have one (you get yours at the end) so just type in 0, then just follow the answer all the other questions 1 for true 0 for false. Press "Esc" to exit the program, it won't exit unless you do this or kill the process in the task manager.

    Known Issues
    This is one of the first programs I made and had a ton of issues with global/local variables in functions and such so don't piss and moan about my procedural code haha.

    The mouseover part confused my test subjects, basically when the alert box is on top, put your mouse where your crop is, and hit the enter key so your mouse is still over your crop when you go to the next one, this will happen for the amount of crops you entered. Do that for all the questions, it will also ask you to hover over all your tools. And two of your tools like the "delete accept" button when you delete something you have to "accept" it. And in the Market, but for right now it only allows first page, I might enable it later to scroll pages to get better crops.

    Possible Uses:
    Basically if you set this to repeat 100 times or so, and "plow, plant, delete" your experience will grow. If you want to make harvesting more automated use the import/export feature. So when your crops are ready, harvest them, plow them again, and plant. Just run the program once a day and you should be good.

    Import/export:
    Basically this allows you to save coordinates, I didn't enable the use of file editing/saving but it'll prompt you at the end and give you the coordinates. If your wanting to use this feature make sure the coordinates of everything do not change. If your in Firefox like me, I had to remove my toolbars, bookmarks and the address bar. Safari and Chrome both showed my entire game without me scrolling. If you scroll there is a chance you might be messing it up by a few pixels.

    Code:
    HotKeySet("{ESC}""Terminate");
    HotKeySet("!a""start")
    ;
    Start Program
    MsgBox
    (0"FarmVille App""Alt+A to start this program. Load FarmVille before this starts. Have you mouse over where it says and hit enter to go to the next cords.");
    WinWaitActive("Does_NOT-Ex1sT");insures the program will keep going
    ;End Program
    Func Terminate
    ()
        
    MsgBox(0,"FarmVille""Goodbye cruel world.")
        Exit 
    0;
    EndFunc
    Func start
    ()
        ;;Declare 
    Variables below
        local $market
    [2]; //x,y of the market
        
    local $multi[2];//x,y of multi tool
        
    local $plow[2];//x,y of multi tool
        
    local $delete[2];//x,y of multi tool
        
    local $deleteacc[2];//x,y of multi tool
        
    local $topplant[2];//x,y of multi tool
        
        
    ;;Input from user
        $previous 
    InputBox("FarmVille""Import previous settings:""")
        
    $result StringInStr($previous"fvbs:"1115) ;//0 = false; 1 = true
        
    If $result == 0 THEN
            $noc 
    InputBox("FarmVille""Emter the amount of crops you have.""9")
            
    $toharvest InputBox("FarmVille""Should I harvest these? 1/0""1"" M1")
            
    $toplow InputBox("FarmVille""Should I plow these? 1/0""1"" M1")
            
    $toplant InputBox("FarmVille""Should I plant these? 1/0""1"" M1")
            
    $todelete InputBox("FarmVille""Should I delete these? 1/0""1"" M1")
            
    $torepeat InputBox("FarmVille""How many times should this occur? 1+""100")
            
    local $plants[$noc*2];//9 plants max?
            
    $nop 0; ;//keeping track of the number of plants
            
    $i 0;
            While 
    $i $noc
            MsgBox
    (0"Set Cords""Please mouseover a plant where you want it to plow. Be exact!"10)
                
    $t MouseGetPos()
                
    $plants[$nop] = $t[0]
                
    $nop $nop 1;
                
    $plants[$nop] = $t[1]
                
    $nop $nop 1;
                
    $i $i 1;
            
    WEnd
            MsgBox
    (0"Set Cords""Please place your mouse over the MultiTool."10)
            
    $multi MouseGetPos()
            
    MsgBox(0"Set Cords""Please place your mouse over the Plow Tool."10)
            
    $plow MouseGetPos()
            
    MsgBox(0"Set Cords""Please place your mouse over the Delete Tool."10)
            
    $delete MouseGetPos()
            
    MsgBox(0"Set Cords""Please place your mouse over the Delete Accept."10)
            
    $deleteacc MouseGetPos()
            
    MsgBox(0"Set Cords""Please place your mouse over the Market."10)
            
    $market MouseGetPos()
            
    MsgBox(0"Set Cords""Click the market, then mouse over the plant you wish to plant. First page only!"10)
            
    $topplant MouseGetPos()
            
    MsgBox(0"Starting""Make sure everything is already deleted"10);
        Else
            
    $res StringRegExp($previous'([0-9]{1,5}),',3)
            
    $market[0] = $res[0]
            
    $market[1] = $res[1]
            
    $multi[0] = $res[2]
            
    $multi[1] = $res[3]
            
    $plow[0] = $res[4]
            
    $plow[1] = $res[5]
            
    $delete[0] = $res[6]
            
    $delete[1] = $res[7]
            
    $deleteacc[0] = $res[8]
            
    $deleteacc[1] = $res[9]
            
    $topplant[0] = $res[10]
            
    $topplant[1] = $res[11]
            
    $noc $res[12]
            global 
    $plants[$noc*2]
            
    $i 0;
            While 
    $i < ($noc*2)
                
    $plants[$i] = $res[13+$i]
                
    $plants[$i+1] = $res[14+$i]
                
    $i $i 2
            WEnd
            $toharvest 
    InputBox("FarmVille""Should I harvest these? 1/0""1"" M1")
            
    $toplow InputBox("FarmVille""Should I plow these? 1/0""1"" M1")
            
    $toplant InputBox("FarmVille""Should I plant these? 1/0""1"" M1")
            
    $todelete InputBox("FarmVille""Should I delete these? 1/0""1"" M1")
            
    $torepeat InputBox("FarmVille""How many times should this occur? 1+""100")
        EndIf
        
    $bs 1;
        While 
    $bs <= $torepeat
            $bs 
    $bs 1;
            if 
    $toharvest == 1 Then
                
    ;;only happens if you want to harvest the land first
                MouseClick
    ("left"$multi[0], $multi[1], 1); click mutli tool
                $i 
    0need to plow
                
    While $i < ($noc*2)
                    
    MouseClick("left"$plants[$i]-10$plants[$i+1]-101);click each plant to harvest
                    $i 
    $i 2;
                
    Wend
            
    EndIf
            if 
    $toplow == 1 Then
                
    ;;only happens if you want to plow the land first
                MouseClick
    ("left"$plow[0], $plow[1], 1); click plow tool
                $i 
    0need to plow
                
    While $i < ($noc*2)
                    
    MouseClick("left"$plants[$i], $plants[$i+1], 1);click each plant to plow them
                    $i 
    $i 2;
                
    Wend
            
    EndIf
            If 
    $toplant == 1 THEN
                
    ;;only happens if you want to plant something
                MouseClick
    ("left"$market[0], $market[1], 1); click market
                MouseClick
    ("left"$topplant[0], $topplant[1], 1); click the plant
                $i 
    0need to plow
                
    While $i < ($noc*2)
                    
    MouseClick("left"$plants[$i]-10$plants[$i+1]-101);click each plant to plant them
                    $i 
    $i 2;
                
    Wend
            
    EndIf
            If 
    $todelete == 1 THEN
                
    ;;wanna delete when your done?
                
    MouseClick("left"$delete[0], $delete[1], 1); delete tool
                $i 
    0need to plow
                
    While $i < ($noc*2)
                    
    MouseClick("left"$plants[$i]-10$plants[$i+1]-101);click each plant to delete them
                    MouseClick
    ("left"$deleteacc[0], $deleteacc[1], 1);delete accept
                    $i 
    $i 2;
                
    Wend
            
    EndIf
        
    Wend
        $i 
    0need to plow
        local $cords 
    ""
        
    While $i < ($noc*2)
            
    $cords $cords&$plants[$i]&","&$plants[$i+1]&",";
            
    $i $i 2;
        
    Wend
        $export 
    InputBox("FarmVille""Export Settings. Hit Alt+A to restart this process.""fvbs:"&$market[0]&","&$market[1]&","&$multi[0]&","&$multi[1]&","&$plow[0]&","&$plow[1]&","&$delete[0]&","&$delete[1]&","&$deleteacc[0]&","&$deleteacc[1]&","&$topplant[0]&","&$topplant[1]&","&$noc&","&$cords)
    EndFunc 
    Attached Files Attached Files

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: FarmVille Bot Program!

    This is so funny. Isn't it taking the fun away from the game?

  4. #3
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: FarmVille Bot Program!

    Fun? Games are made to win, not for this "fun" you speak of

  5. #4
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: FarmVille Bot Program!

    You're wrong. Games are made for programemrs to try to get advantages by using some logics and help from the computer so all non-programmers will feel stupid for actually playing the game.

    Personally I think creating bots for web browser game is really funny, however when they're done I don't even use them, since who wants to have the highest level(or something similar) on the game, not me, I want the challenge

  6. #5
    nicolost is offline Newbie
    Join Date
    Oct 2009
    Posts
    1
    Rep Power
    0

    Re: FarmVille Bot Program!

    thanks

  7. #6
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: FarmVille Bot Program!

    Quote Originally Posted by Vswe View Post
    You're wrong. Games are made for programemrs to try to get advantages by using some logics and help from the computer so all non-programmers will feel stupid for actually playing the game.

    Personally I think creating bots for web browser game is really funny, however when they're done I don't even use them, since who wants to have the highest level(or something similar) on the game, not me, I want the challenge
    I created the logic, so in a sense all it's doing is automating what I would/could be doing. The challenge is to figure out the best/fastest way to win, and I did. In a sense this is just a different approach I took to beating the game. Right?

  8. #7
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: FarmVille Bot Program!

    Yes

  9. #8
    slaters is offline Newbie
    Join Date
    Oct 2009
    Posts
    1
    Rep Power
    0

    Re: FarmVille Bot Program!

    nice

  10. #9
    lolipearl is offline Newbie
    Join Date
    Oct 2009
    Posts
    1
    Rep Power
    0

    Re: FarmVille Bot Program!

    thx

  11. #10
    Jordan Guest

    Re: FarmVille Bot Program!

    Wow, I guess your thread/bot is bringing in the Farmville crowd. lol
    Last edited by Jordan; 10-16-2009 at 07:48 AM.

+ Reply to Thread
Page 1 of 13 12311 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Program for search terms within a program
    By 817moose in forum General Programming
    Replies: 4
    Last Post: 11-03-2010, 01:07 PM
  2. Why do you program/Why are you learning to program?
    By taylerhughes in forum The Lounge
    Replies: 34
    Last Post: 08-11-2010, 12:26 AM
  3. Replies: 9
    Last Post: 03-14-2010, 08:44 PM
  4. Vb.net farmville open source
    By Ray Tawil in forum Classes and Code Snippets
    Replies: 0
    Last Post: 02-09-2010, 04:39 AM
  5. Replies: 8
    Last Post: 05-11-2009, 01:41 AM

Tags for this Thread

Bookmarks

Posting Permissions

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