AutoIt Forums: MY FarmVille Program - AutoIt Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

MY FarmVille Program 2250 lines long! Rate Topic: -----

#1 User is offline   BitByteBit 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 55
  • Joined: 20-May 09

Posted 04 November 2009 - 08:22 AM

I've set up a site for this program now, so for all future updates check out
FarmVille Cheats


This program doesn't rely on knowing the mouse co-ords (eg the size of your field). Instead it looks for the pixel colour and clicks it. You can teach it to harvest new crops, also you can record mouse clicks to an .ini file and play them back allowing you to buy and sell hay bales super fast.

Enjoy guys, any comments will be greatly appreciated!!!

I went the long way round a few times, it was the only way I knew.

Enjoy.
http://i34.tinypic.com/w1prav.jpg

[autoit] #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=..\FarnShark 32x\FarmShark.exe #AutoIt3Wrapper_Compression=4 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ProcessSetPriority(@AutoItPID,4) #Region Options/Includes Opt("WinWaitDelay", 100) Opt("WinTitleMatchMode", 2) Opt("WinDetectHiddenText", 1) Opt("MouseCoordMode", 1) Opt("TrayIconDebug", 1) Opt("PixelCoordMode", 1) #include <Misc.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EzSkin.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> #EndRegion #Region Hotkeys HotKeySet("^!s", "Plant") HotKeySet("!r", "Restart") HotKeySet("!e", "Edit") HotKeySet("^!o", "Login") HotKeySet("^!i", "Instructions") ;HotKeySet("^!c", "CheckX") HotKeySet("^!h", "Harvest") HotKeySet("^!p", "Plow") HotKeySet("^!{Space}", "Play") HotKeySet("^!c", "CheckSquares") HotKeySet("^!b", "HayBaleHack") HotKeySet("!2", "ImSoSick") HotKeySet("^{F1}", "StopTheBoat") HotKeySet("!{Esc}", "Exit1") HotKeySet("!z", "FindHB") #EndRegion #Region Declarations Global $CoOrd4[2] Global $CoOrd2[2] Global $CoOrd3[2] $CoOrd3 [0] = 0 $CoOrd3 [0] = 0 $Num = 0 $Searching = False $CoOrd4[0] = 0 $CoOrd4[1] = 0 $PID = @AutoItPID $Looking = True Global $Location = 'C:\Program Files\FarmShark\FV.ini' $Maybe = GUICreate('Fruit', 120, 200, 5, 5) GUISetState(@SW_MINIMIZE,$Maybe) $Sections = IniReadSectionNames($Location) Local $hWnd = WinGetHandle("FarmVille Calculator") Local $sHWND = String($hWnd) ; Convert to a string Local $hWnd2 = WinGetHandle("Fruit") Local $sHWND2 = String($hWnd2) ; Convert to a string Local $hWnd1 = WinGetHandle("FVck It Up") Local $sHWND1 = String($hWnd1) ; Convert to a string $font = "Times New Roman" $Hidden = 1 $ClickSize = 0 $X = 1 $XP = 0 Dim $P, $S Global $ACCEPTDELAY Global $DELAY Global $DELAYSET Global $Done Global $HBNUM Global $MARKETDELAY Global $Name Global $NotDone Global $Posi[2] Global $POS[2] Global $POS1[2] Global $POS2[2] Global $POS3[2] Global $POS4[2] Global $POS5[2] Global $POS6[2] Global $POS7[2] Global $POS8[2] Global $POS9[2] Global $POS10[2] Global $POS11[2] Global $POS12[2] Global $POS13[2] Global $POS14[2] Global $POS15[2] Global $POS16[2] Global $POS17[2] Global $POS18[2] Global $POS19[2] Global $POS20[2] Global $POS21[2] Global $POS22[2] Global $POS23[2] Global $POS24[2] Global $POS25[2] Global $POS26[2] Global $POS27[2] Global $POS28[2] Global $POS29[2] Global $POS30[2] Global $POS30[2] Global $DUMMYPOS[1] Global $Search Global $CropColour Global $Name $Code = -1 $DELAYSET = False $DLL = DllOpen("user32.dll") $Done = False $NotDone = False $SELECTED = False $Found = False $COUNT = 1 $WaitForIt = 0 $DUMMYPOS[0] = 1 $POS1[0] = 0 $POS1[0] = 0 $POS2[0] = 0 $POS3[0] = 0 $POS4[0] = 0 $POS5[0] = 0 $POS6[0] = 0 $POS7[0] = 0 $POS8[0] = 0 $POS9[0] = 0 $POS10[0] = 0 $POS11[0] = 0 $POS12[0] = 0 $POS13[0] = 0 $POS14[0] = 0 $POS15[0] = 0 $POS16[0] = 0 $POS17[0] = 0 $POS18[0] = 0 $POS19[0] = 0 $POS20[0] = 0 $POS21[0] = 0 $POS22[0] = 0 $POS23[0] = 0 $POS24[0] = 0 $POS25[0] = 0 $POS26[0] = 0 $POS27[0] = 0 $POS28[0] = 0 $POS29[0] = 0 $POS30[0] = 0 $POS1[1] = 0 $POS2[1] = 0 $POS3[1] = 0 $POS4[1] = 0 $POS5[1] = 0 $POS6[1] = 0 $POS7[1] = 0 $POS8[1] = 0 $POS9[1] = 0 $POS10[1] = 0 $POS11[1] = 0 $POS12[1] = 0 $POS13[1] = 0 $POS14[1] = 0 $POS15[1] = 0 $POS16[1] = 0 $POS17[1] = 0 $POS18[1] = 0 $POS19[1] = 0 $POS20[1] = 0 $POS21[1] = 0 $POS22[1] = 0 $POS23[1] = 0 $POS24[1] = 0 $POS25[1] = 0 $POS26[1] = 0 $POS27[1] = 0 $POS28[1] = 0 $POS29[1] = 0 $POS30[1] = 0 $P0 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 0", "Not Found") $P1 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 1", "Not Found") $P2 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 2", "Not Found") $P3 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 3", "Not Found") $P4 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 4", "Not Found") $P5 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 5", "Not Found") $P6 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 6", "Not Found") $P7 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 7", "Not Found") $P8 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 8", "Not Found") $P9 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 9", "Not Found") $P10 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 10", "Not Found") $P11 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 11", "Not Found") $P12 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 12", "Not Found") $P13 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 13", "Not Found") $P14 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 14", "Not Found") $P15 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 15", "Not Found") $P16 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 16", "Not Found") $P17 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 17", "Not Found") $P18 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 18", "Not Found") $P19 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 19", "Not Found") $P20 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 20", "Not Found") $P21 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 21", "Not Found") $P22 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 22", "Not Found") $P23 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 23", "Not Found") $P24 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 24", "Not Found") $P25 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 25", "Not Found") $P26 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 26", "Not Found") $P27 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 27", "Not Found") $P28 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 28", "Not Found") $P29 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 29", "Not Found") $P30 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 30", "Not Found") $P31 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 31", "Not Found") $P32 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 32", "Not Found") $P33 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 33", "Not Found") $P34 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 34", "Not Found") $P35 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 35", "Not Found") $P36 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 36", "Not Found") $P37 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 37", "Not Found") $P38 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 38", "Not Found") $P39 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 39", "Not Found") $P40 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 40", "Not Found") $P41 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 41", "Not Found") $P42 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 42", "Not Found") $P43 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 43", "Not Found") $P44 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 44", "Not Found") $P45 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 45", "Not Found") $P46 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 46", "Not Found") $P47 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 47", "Not Found") $P48 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 48", "Not Found") $P49 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 49", "Not Found") $P50 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 50", "Not Found") $P51 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 51", "Not Found") $P52 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 52", "Not Found") $P53 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 53", "Not Found") $P54 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 54", "Not Found") $P55 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 55", "Not Found") $P56 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 56", "Not Found") $P57 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 57", "Not Found") $P58 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 58", "Not Found") $P59 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 59", "Not Found") $P60 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 60", "Not Found") $P61 = IniRead("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 61", "Not Found") #EndRegion #Region FCV GUI $Form1_1 = EzSkinGUICreate("FarmVille Calculator", 280, 225, 42, 42) $EzIcon1 = EzSkinIcon($Form1_1) $Spent = GUICtrlCreateLabel("Total Cost", 168, 33, 55, 15) GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetBkColor(-1, 0x1C1D28) $XPLabel = GUICtrlCreateLabel("XP Gained", 104, 120, 58, 15) GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetBkColor(-1, 0x1C1D28) $SpentX = GUICtrlCreateInput("", 24, 50, 89, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $Label2 = GUICtrlCreateLabel("Cost of seeding", 32, 33, 80, 16) GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetBkColor(-1, 0x1C1D28) $SpentBox = GUICtrlCreateInput("", 145, 50, 89, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $Profit2 = GUICtrlCreateInput("", 144, 92, 89, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $Profit2Label = GUICtrlCreateLabel("Profit", 176, 74, 36, 17) GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetBkColor(-1, 0x1C1D28) $SizeInput = GUICtrlCreateInput("Size", 24, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) ;MsgBox(0,"",$SizeInput) $Label1 = GUICtrlCreateLabel("Farm Size", 24, 120, 50, 15) GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetBkColor(-1, 0x1C1D28) $XpAndPlowing = GUICtrlCreateInput("", 184, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $XandPLabel = GUICtrlCreateLabel("XP+Plowing XP", 165, 120, 75, 15) ;GUICtrlCreateLabel(text,left,top,widt,hiehgh GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetBkColor(-1, 0x1C1D28) $SalesLabel = GUICtrlCreateLabel("Total Sales", 40, 72, 57, 17) GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetBkColor(-1, 0x1C1D28) $Sales = GUICtrlCreateInput("", 24, 92, 89, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $XpGained = GUICtrlCreateInput("", 104, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $Calculate = EzSkinButton("Calculate", 40, 165, 83, 25, $WS_GROUP) GUICtrlSetFont(-1,11.5,16,18,$font) $Input1 = EzSkinButton("Input", 138, 165, 83, 25, $WS_GROUP) GUICtrlSetFont(-1,11.5,16,18,$font) Local $hWnd = WinGetHandle("FarmVille Calculator") Local $sHWND = String($hWnd) ; Convert to a string $Doh = GUICtrlRead($SizeInput) guisetstate(@SW_Hide,$sHWND) #EndRegion ### END Koda GUI section ### #Region Instructions GUI $InstructionsGUI = EzSkinGUICreate("Instructions", 248, 188) $EzIcon2 = EzSkinIcon($InstructionsGUI) $OpenI = EzSkinButton("Open FarmVille", 16, 40, 91, 25, $WS_GROUP) $PlantI = EzSkinButton("Plant/Sew", 136, 40, 91, 25, $WS_GROUP) $HarvestI = EzSkinButton("Harvest", 16, 88, 91, 25, $WS_GROUP) $PlowI = EzSkinButton("Plow", 136, 88, 91, 25, $WS_GROUP) $HBHI= EzSkinButton("Hay Bale Hack", 16, 136, 91, 25, $WS_GROUP) $CalcI= EzSkinButton("Profit Calculator", 136, 136, 91, 25, $WS_GROUP) $InstructionsLabel = GUICtrlCreateLabel("Instructions", 88, 8, 58, 12, $SS_CENTER) ;GUICtrlSetColor(-1, 0x9D9FA5) GUICtrlSetBkColor($InstructionsLabel, 0xC3C6CC) GUISetState(@SW_Hide,$InstructionsGUI) $Hidden1 = 1 $InstructionsBox = EzSkinGUICreate("The Gory Details", 248, 188) $Edit1 = GUICtrlCreateEdit("", 11, 33, 225, 145, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL)) $EzIcon3 = EzSkinIcon($InstructionsBox) $Show1 = False GUISetState(@SW_Hide) #Region Fruit GUI $Maybe = GUICreate('Fruit', 120, 200, 5, 5) ;GUICreate(Ttitle, Width,Height,Left,Top Local $hWnd2 = WinGetHandle("Fruit and Veg") Local $sHWND2 = String($hWnd2) ; Convert to a string $mylist = GUICtrlCreateList('', 0, 0, 120, 210) $Sections = IniReadSectionNames($Location) For $x = 1 To $Sections[0] GUICtrlSetData($mylist, $Sections[$x]) Next GUISetState(@SW_Hide, $Maybe) ;GUISetState(@SW_Show, $EzGUI) #EndRegion #EndRegion #Region Priority GUI $PriorityGui = GUICreate(" Priority","",49,890,666,"",$WS_MINIMIZEBOX) ; will create a dialog box that when displayed is centered $PriorityList = GUICtrlCreateCombo("Low", 0, 1,125) ; create first item GUICtrlSetData(-1, "Below Normal|Normal|Above Normal|High", "High") ; add other item snd set a new default GUISetState(@SW_Show,$PriorityGui ) Func Set() $Priority = GUICtrlRead($PriorityList) Select Case $Priority = "Low" ProcessSetPriority($PID,0) ;MsgBox(0,"","Priority set to Low") Case $Priority = "Below Normal" ProcessSetPriority($PID,1) ;MsgBox(0,"","Priority set to Below Normal") Case $Priority = "Normal" ProcessSetPriority($PID,2) ;MsgBox(0,"","Priority set to Normal") Case $Priority = "Above Normal" ProcessSetPriority($PID,3) ;MsgBox(0,"","Priority set to Above Normal") Case $Priority = "High" ProcessSetPriority($PID,4) ;MsgBox(0,"","Priority set to High") EndSelect EndFunc #EndRegion #Region Main Gui $EzGUI = EzskinGUICreate("FVck It Up", 298, 262, 42, 42) $EzIcon = EzSkinIcon($EzGUI) GUISetFont(12,"",18,$font) ;GUISetFont(8, 400, 2, "font") $LOGIN = EzSkinButton("&Open FarmVille", 15, 105, 265, 30, $WS_GROUP) $PLANT = EzSkinButton("Plant/&Sew", 15, 35, 85, 30, $WS_GROUP) $HARVEST = EzSkinButton("&Harvest", 105, 35, 85, 30, $WS_GROUP) $Plow = EzSkinButton("&Plow", 195, 35, 85, 30, $WS_GROUP) $HAYBALE = EzSkinButton("Hay &Bale Hack", 15, 175, 265, 30, $WS_GROUP) $Animals= EzSkinButton("&Animals", 15, 140, 265, 30, $WS_GROUP) $Instructions = EzSkinButton("&Instructions", 15, 210, 265, 30, $WS_GROUP) $Cancel = EzSkinButton("Cancel", 15, 70, 130, 30, $WS_GROUP) $Restart = EzSkinButton("&Restart", 150, 70, 130, 30, $WS_GROUP) WinMove("FVck It Up", "", 700, 21) GUISetState(@SW_SHOW) Sleep(1000) Send("{AltDown}{AltUp}") Func FVCClosed() GUISetState(@SW_Hide,$HWND) WinSetOnTop("FarmVille Calculator", "", 0) GUISetState(@SW_Show,$HWND1) $Hidden = 1 EndFunc Func FVCMini() GUISetState(@SW_MINIMIZE,$HWND) WinSetOnTop("FarmVille Calculator", "", 0) GUISetState(@SW_Show,$HWND1) $Hidden = 1 EndFunc #EndRegion ;ToolTip("Ctrl+F1 to cancel current action",512,368,"!",2,0) ;Sleep(1000) ;ToolTip("Alt+Esc to force exit",512,368,"!",2,0) ;Sleep(1000) ;ToolTip("Alt+R to restart the program",512,368,"!",2,0) ;Sleep(1000) ;ToolTip("") While 1 EzSkinOver() $msg = GUIGetMsg() If $msg = $PriorityList then Set() If $msg = - 3 Then ExitColours() If $msg = $EzIcon[1] Then Exit1() If $msg = $EzIcon[2] Then GuiSetstate(@SW_MINIMIZE, $EzGUI) If $msg = $EzIcon1[1] Then FVCClosed() If $msg = $EzIcon1[2] Then FVCMini() If $msg = $EzIcon2[1] Then HideInstrucGui() If $msg = $EzIcon2[2] Then GuiSetstate(@SW_MINIMIZE, $InstructionsGUI) If $msg = $EzIcon3[1] Then HideInstrucBox() If $msg = $EzIcon3[2] Then GuiSetstate(@SW_MINIMIZE, $InstructionsBox) If $MSG = $LOGIN Then LOGIN() If $MSG = $PLANT Then Plant1() If $MSG = $HARVEST Then HARVEST() If $MSG = $PLOW Then PLOW() If $MSG = $HAYBALE Then HAYBALEHACK() If $MSG = $Animals Then Animals() If $MSG = $Calculate Then Calculate() If $MSG = $Input1 Then Input1() If $MSG = $Instructions Then Instructions() If $MSG = $Cancel Then StopTheBoat() If $MSG = $Restart Then Restart() If $msg = $OpenI then OpenI() If $msg = $PlantI then PlantI() If $msg = $HarvestI then HarvestI() If $msg = $PlowI then PlowI() If $msg = $HBHI then HBHI() If $msg = $CalcI then CalcI() If $msg = $mylist Then FruitPicked() ;If $MSG = $MyList Then () WEnd #Region Animals Func Animals() $Searching = True while $Searching = True $CoOrd = PixelSearch(0,0,1024,768,0xD02875,20) ; 0xCF0867 0XFF409D Sorta works with shade variation of 10-20 ;$CoOrd = PixelSearch(0,0,1024,768,0xD02875,21) ;Deff working!!! ;$CoOrd3 = PixelSearch(0,0,1024,768,0XFF409D,15) ; Perhaps have several colous? if not @error then IF $CoOrd[0] <> $CoOrd3[0] OR $CoOrd[1] <> $CoOrd3[1] then MouseClick("Left",$CoOrd[0]+1,$CoOrd[1]+1,1,0) ;MsgBox(0,"?","Click diamond?") $CoOrd3[0] = $Coord[0] $CoOrd3[1] = $Coord[1] $CoOrd2 [0] = $CoOrd[0] + 17 $CoOrd2 [1] = $CoOrd[1] + 47 Sleep(750) MouseClick("Left",$CoOrd2[0],$CoOrd2[1],1,0) ToolTip($Num, 0, 0, "!", 1, 2) Sleep(750) ToolTip("") $Num = $Num + 1 Else Sleep(10) EndIf Else MsgBox(0,"","No animals") $Searching = False EndIf WEnd EndFunc #EndRegion #Region Instructions Func Instructions() If $Hidden = 1 then GuiSetstate(@SW_Show, $EzGUI) GUISetState(@SW_show,$InstructionsGUI) WinMove($InstructionsGUI,"",700,285) ezskinover() ;WinMove("FVck It Up", "", 700, 70) $Hidden = 0 else GUISetState(@SW_HIDE,$InstructionsGUI) GuiSetstate(@SW_Show, $EzGUI) $Hidden = 1 EndIf while $Hidden = 0 $msg = GUIGetMsg() ezskinover() If $msg = $PriorityList then Set() If $msg = $EzIcon[1] Then Exit ;1() If $msg = $EzIcon[2] Then GuiSetstate(@SW_MINIMIZE, $EzGUI) If $msg = $EzIcon1[1] Then FVCClosed() If $msg = $EzIcon1[2] Then FVCMini() If $msg = $EzIcon2[1] Then HideInstrucGui() If $msg = $EzIcon2[2] Then GuiSetstate(@SW_MINIMIZE, $InstructionsGUI) If $msg = $EzIcon3[1] Then HideInstrucBox() If $msg = $EzIcon3[2] Then GuiSetstate(@SW_MINIMIZE, $InstructionsBox) If $msg = $Instructions Then Instructions() If $msg = $OpenI then OpenI() If $msg = $PlantI then PlantI() If $msg = $HarvestI then HarvestI() If $msg = $PlowI then PlowI() If $msg = $HBHI then HBHI() If $msg = $CalcI then CalcI() If $MSG = $LOGIN Then LOGIN() If $MSG = $PLANT Then Plant1() If $MSG = $HARVEST Then HARVEST() If $MSG = $PLOW Then PLOW() If $MSG = $HAYBALE Then HAYBALEHACK() If $MSG = $Animals Then Animals() If $MSG = $Calculate Then Calculate() If $MSG = $Input1 Then Input1() If $MSG = $Cancel Then StopTheBoat() If $MSG = $Restart Then Restart() If $msg = $mylist Then FruitPicked() ;If $MSG = $Instructions Then Instructions() WEnd EndFunc Func OpenI() ;$Show1 = False If $Show1 = True Then GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+O"&@CRLF&@CRLF& "This will open FarmVille in your default"&@CRLF& "browser") Else InstructionsBox() GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+O"&@CRLF&@CRLF& "This will open FarmVille in your default"&@CRLF& "browser") EndIf ;If $msg = $EzIcon3[1] Then GUISetState(@SW_HIDE,$InstructionsBox) ;If $msg = $EzIcon3[2] Then GUISetState(@SW_HIDE,$InstructionsBox) EndFunc Func PlantI() If $Show1 = True Then GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+S"&@CRLF&@CRLF& "When you click this it will ask you if you"&@CRLF& "want to:"&@CRLF& """Calculate how profit you will make""" &@CRLF &@CRLF& "If you press No then:" &@CRLF&@CRLF& "Select the crop you want to plant " &@CRLF& "and press ok"&@CRLF&"It will now plant your selected crop"&@CRLF&"in every available square" &@CRLF&@CRLF&"If you press Yes then type in:"&@CRLF&@CRLF&"1. How much it costs to plant " &@CRLF& "2. How much it sells for" &@CRLF& "3. How much XP you get per square" &@CRLF&@CRLF& "Once you have done this" &@CRLF& "Select the crop you want to plant" &@CRLF& "and press ok" &@CRLF& "It will now plant your selected crop" &@CRLF& "in all available sqaures"&@CRLF& "Whilst doing this it will show you "&@CRLF& "how much profit you will make including"&@CRLF& "plowing") Else InstructionsBox() GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+S"&@CRLF&@CRLF& "When you click this it will ask you if you"&@CRLF& "want to:"&@CRLF& """Calculate how profit you will make""" &@CRLF &@CRLF& "If you press No then:" &@CRLF&@CRLF& "Select the crop you want to plant " &@CRLF& "and press ok"&@CRLF&"It will now plant your selected crop"&@CRLF&"in every available square" &@CRLF&@CRLF&"If you press Yes then type in:"&@CRLF&@CRLF&"1. How much it costs to plant " &@CRLF& "2. How much it sells for" &@CRLF& "3. How much XP you get per square" &@CRLF&@CRLF& "Once you have done this" &@CRLF& "Select the crop you want to plant" &@CRLF& "and press ok" &@CRLF& "It will now plant your selected crop" &@CRLF& "in all available sqaures"&@CRLF& "Whilst doing this it will show you "&@CRLF& "how much profit you will make including"&@CRLF& "plowing") EndIf EndFunc Func PlowI() If $Show1 = True Then GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+P"&@CRLF&@CRLF& "Make sure FarmVille is open and that "&@CRLF& "you have zoomed all the way out"&@CRLF& "Then Click Plow or press the hotkey") Else InstructionsBox() GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+P"&@CRLF&@CRLF& "Make sure FarmVille is open and that "&@CRLF& "you have zoomed all the way out"&@CRLF& "Then Click Plow or press the hotkey") EndIf EndFunc Func HarvestI() If $Show1 = True Then GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+H"&@CRLF&@CRLF&"This will harvest crops") else GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+H"&@CRLF&@CRLF&"This will harvest crops") InstructionsBox() EndIf EndFunc Func HBHI() If $Show1 = True Then GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+B"&@CRLF&@CRLF&"Use this to buy & sell Hay Bales "&@CRLF&"very fast"&@CRLF&@CRLF&"To record a mouse click hold ""Ctrl"""&@CRLF&"then click; it will remember where you"&@CRLF&"clicked"&@CRLF&@CRLF&"For instance:"&@CRLF&"1.Ctrl+Click Market"&@CRLF&"2.Ctrl+Click Decorations"&@CRLF&"3.Ctrl+Click Hay Bales"&@CRLF&"4.Ctrl+Click where you want to place"&@CRLF&"the Hay Bale"&@CRLF&"5.Ctrl+Click the Hay Bale"&@CRLF&"6.Ctrl+Click Sell"&@CRLF&"7.Ctrl+Click Accept"&@CRLF&"8.Press Alt+B to stop recording"&@CRLF&@CRLF&"You now have the option to save this"&@CRLF&"recording for later use"&@CRLF&@CRLF&"If you do not want to save click no"&@CRLF&@CRLF&"If you want to re-record click cancel"&@CRLF&@CRLF& "Note:"&@CRLF&"If you do save the recording"&@CRLF&"Make sure when you load the"&@CRLF&"recording next time"&@CRLF&"That the screen is lined up in the same "&@CRLF&"way"&@CRLF&"(Line up the top of FV with your"&@CRLF&"browser ^_^ )") Else GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+B"&@CRLF&@CRLF&"Use this to buy & sell Hay Bales "&@CRLF&"very fast"&@CRLF&@CRLF&"To record a mouse click hold ""Ctrl"""&@CRLF&"then click; it will remember where you"&@CRLF&"clicked"&@CRLF&@CRLF&"For instance:"&@CRLF&"1.Ctrl+Click Market"&@CRLF&"2.Ctrl+Click Decorations"&@CRLF&"3.Ctrl+Click Hay Bales"&@CRLF&"4.Ctrl+Click where you want to place"&@CRLF&"the Hay Bale"&@CRLF&"5.Ctrl+Click the Hay Bale"&@CRLF&"6.Ctrl+Click Sell"&@CRLF&"7.Ctrl+Click Accept"&@CRLF&"8.Press Alt+B to stop recording"&@CRLF&@CRLF&"You now have the option to save this"&@CRLF&"recording for later use"&@CRLF&@CRLF&"If you do not want to save click no"&@CRLF&@CRLF&"If you want to re-record click cancel"&@CRLF&@CRLF& "Note:"&@CRLF&"If you do save the recording"&@CRLF&"Make sure when you load the"&@CRLF&"recording next time"&@CRLF&"That the screen is lined up in the same "&@CRLF&"way"&@CRLF&"(Line up the top of FV with your"&@CRLF&"browser ^_^ )") InstructionsBox() EndIf EndFunc Func CalcI() If $Show1 =True then GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+C"&@CRLF&@CRLF&"This will calculate the profit after plowing"&@CRLF&@CRLF&"To use click the ""Profit Calculator Button"""&@CRLF&"Type in:"&@CRLF&"1. How much it costs to plant " &@CRLF& "2. How much it sells for" &@CRLF& "3. How much XP you get per square" &@CRLF&"4. How many squares you have"&@CRLF&@CRLF&"Note:"&@CRLF&"If you change the farm size and click calculate"&@CRLF&"It will change to give you the new total profit etc"&@CRLF&@CRLF&"To do another calculation"&@CRLF&"Click ""Input""") else GUICtrlSetData($Edit1, "Hotkey: Ctrl+Alt+C"&@CRLF&@CRLF&"This will calculate the profit after plowing"&@CRLF&@CRLF&"To use click the ""Profit Calculator Button"""&@CRLF&"Type in:"&@CRLF&"1. How much it costs to plant " &@CRLF& "2. How much it sells for" &@CRLF& "3. How much XP you get per square" &@CRLF&"4. How many squares you have"&@CRLF&@CRLF&"Note:"&@CRLF&"If you change the farm size and click calculate"&@CRLF&"It will change to give you the new total profit etc"&@CRLF&@CRLF&"To do another calculation"&@CRLF&"Click ""Input""") InstructionsBox() EndIf EndFunc Func InstructionsBox() If $Show1 = False then GUISetState(@SW_SHOW,$InstructionsBox) WinSetOnTop($InstructionsBox, "", 1) GUISetState(@SW_show,$InstructionsGUI) ezskinover() WinMove($InstructionsBox,"",700,480) $Show1 = True else WinSetOnTop($InstructionsBox, "", 0) GUISetState(@SW_Hide,$InstructionsBox) GUISetState(@SW_show,$InstructionsGUI) $Show1 = False EndIf EndFunc Func HideInstrucGui() GUISetState(@SW_HIDE,$InstructionsGUI) ;Sleep(50) ;GUISetState(@SW_Show,$HWnd1) $Hidden = 1 ;ezskinover() EndFunc Func HideInstrucBox() GUISetState(@SW_HIDE,$InstructionsBox) $Show1 = False If $Hidden = 0 then GUISetState(@Sw_Show,$InstructionsGUI) EndIf ezskinover() EndFunc #EndRegion #Region Calculations for FVC $SizeInput = "Size" Func Input1() ezskinover() guisetstate(@SW_SHOW,$HWND) $P = InputBox("Cost", "How much it costs to plant") $S = InputBox("Sale", "How much it sells for") $XP = InputBox("XP", "How much XP gained") $X = InputBox("Sqaures", "How many squares") GUICtrlSetData($SizeInput, $X) $Doh = GUICtrlRead($SizeInput) Answer() ;Else ;EndIf EndFunc Func CheckSquares() if $Hidden = 1 then guisetstate(@SW_SHOW,$HWND) Sleep(50) GUISetState(@SW_SHow,$HWND1) ;GUISetState(@SW_SHow,$HWND1) WinMove("FarmVille Calculator", "", 21, 21) ;Calculate() ;Input1() $Hidden = 0 ;WinSetOnTop("FarmVille Calculator", "", 1) else GUISetState(@SW_Hide,$HWND) GUISetState(@SW_SHow,$HWND1) $Hidden = 1 EndIf EndFunc ;==>CheckSquares Func Calculate() ;$P = InputBox("Cost", "How much it costs to plant") ;$S = InputBox("Sale", "How much it sells for") ;$XP = InputBox("XP", "How much XP gained") $Doh = GUICtrlRead($SizeInput) If $Doh <> "Size" Then $X = $Doh GUICtrlSetData($SizeInput, $X) Answer() Else $X = InputBox("Sqaures", "How many squares") GUICtrlSetData($SizeInput, $X) Answer() EndIf EndFunc Func Answer() If $ClickSize <> "0" Then $X = $ClickSize GUICtrlSetData($SizeInput, $ClickSize) Else ;$X = $Doh EndIf $A = $P + 15 ;Cost for one square including plowing $B = $S - $A ;Overall Profit on one square including plowing $E = $S - $P ;Overall Profit on one square excluding plwing $C = $A * $X ;Overall cost including plowing $D = $P * $X ;Overall cost excluding plowing $M = $X * 1 ;Xp from plowing $T = $E * $X $XPZ = $XP * $X $XPP = $X * $XP + $M $Almaas = $S * $X $Answer = $B * $X ;Profit margin including plowing GUICtrlSetData($SpentBox, $C) GUICtrlSetData($SpentX, $D) GUICtrlSetData($Profit2, $Answer) GUICtrlSetData($XPGained, $XPZ) GUICtrlSetData($XpAndPlowing, $XPP) GUICtrlSetData($Sales, $Almaas) EndFunc ;==>Answer #EndRegion #Region Harvest/Plow/Plant Func HARVEST() If $Found = True Then $Search = True If Not WinActive("FarmVille", "") Then WinActivate("FarmVille", "") WinWaitActive("FarmVille", "") Sleep(2000) While $Search = True $Coord2 = PixelSearch(30, 30,1024, 768, $CropColour) If Not @error Then IF $CoOrd2[0] <> $CoOrd4[0] OR $CoOrd2[1] <> $CoOrd4[1] then MouseClick("Left", $Coord2[0], $Coord2[1], 1, 0) $CoOrd4[0] = $Coord2[0] $CoOrd4[1] = $Coord2[1] Else Sleep(5) EndIf else $Search = False $Found = False $Question = MsgBox(4, "?", "Do you want to plow?") If $Question = 6 Then PLOW() If $Question = 7 Then Sleep(10) EndIf WEnd ;CHECKSYNC2() Else TheQuestion() EndIf EndFunc Func Plant1() $Calc = MsgBox(4, "?", "Do you want to calculate how much profit you'll make?") If $Calc = 6 Then guisetstate(@SW_SHOW,$HWND) $hidden = 0 WinMove("FarmVille Calculator", "", 15, 15) WinSetOnTop("FarmVille Calculator", "", 1) $P = InputBox("Cost", "How much it costs to plant") $S = InputBox("Sale", "How much it sells for") $XP = InputBox("XP", "How much XP gained") MsgBox(0, "!", "Select Crop, then press OK") If Not WinExists("Adobe Flash Player","") Then If Not WinActive("FarmVille", "") Then WinActivate("FarmVille", "") WinWaitActive("FarmVille", "") EndIf Sleep(1000) $Search = True While $Search = True $Coord2 = PixelSearch(30, 30, 1024, 768, 8337165) If Not @error Then IF $CoOrd2[0] <> $CoOrd4[0] then MouseClick("Left", $Coord2[0], $Coord2[1], 1, 0) $ClickSize = $ClickSize + 1 $CoOrd4[0] = $Coord2[0] Answer() Else Sleep(5) EndIf else $Search = False EndIf ;CHECKSYNC2() ;Sleep(175) WEnd ;$Search = $Search = False Else Plant() EndIf EndFunc ;==>Plant Func Plant() MsgBox(0, "!", "Select Crop, then press OK") If Not WinActive("FarmVille", "") Then WinActivate("FarmVille", "") WinWaitActive("FarmVille", "") Sleep(1000) $Search = True While $Search = True $Coord2 = PixelSearch(30, 30, 1024, 768, 8337165) If Not @error Then IF $CoOrd2[0] <> $CoOrd4[0] or $CoOrd2[1] <> $CoOrd4[1] then MouseClick("Left", $Coord2[0], $Coord2[1], 1, 0) $ClickSize = $ClickSize + 1 $CoOrd4[0] = $Coord2[0] $CoOrd4[1] = $Coord2[1] Else Sleep(20) EndIf else $Search = False EndIf WEnd $Search = $Search = False EndFunc ;==>Plant Func PLOW() If Not WinExists("Adobe Flash Player","") Then If Not WinActive("FarmVille", "") Then WinActivate("FarmVille", "") WinWaitActive("FarmVille", "") else $fullscreen = true EndIf Sleep(1000) $Search = True While $Search = True ;$Coord2 = PixelSearch(30, 30, 1024, 768, 9731111) Old $Coord2 = PixelSearch(30, 30, 1024, 768, 0x68540E) If Not @error Then IF $CoOrd2[0] <> $CoOrd4[0] then MouseClick("Left", $Coord2[0], $Coord2[1], 1, 0) ; $ClickSize = $ClickSize + 1 $CoOrd4[0] = $Coord2[0] Else Sleep(1) EndIf Else Sleep(1700) Test() $Search = False EndIf ; CHECKSYNC2() WEnd EndFunc ;==>PLOW Func Test() $Coord2 = PixelSearch(30, 30, 1024, 768, 9731111) If Not @error Then MouseClick("Left", $Coord2[0], $Coord2[1], 1, 0) $Search = True Plow() Else Sleep(50) $Search = False EndIf EndFunc ;==>Test #EndRegion #Region Harvest Startup Func TheQuestion() if $Sections <> 1 then $Q1 = MsgBox(4, "?", "Do you want to load a previous crop code?") If $Q1 = 6 Then RecallColor() If $Q1 = 7 Then SaveColor() ; if $L2 <> "Not Found" then Crop2() Else DoYouKnow() EndIf EndFunc ;==>TheQuestion Func DoYouKnow() $Q10 = MsgBox(4, "?", "Do you have a Crop Code?") If $Q10 = 6 Then Input() If $Q10 = 7 Then SaveColor() EndFunc ;==>DoYouKnow Func Input() $Name = InputBox("Name", "What is the name of the crop?") $CropColour = InputBox("Input Code", "Please write in your Crop Code:") ;Hex($CropColour, 6) ;WriteIni() IniWrite($Location, $Name, 'Colors', $CropColour) MsgBox(0, "!", $Name & " has has been saved to C:\FV.ini") $Found = True RecallColor() HARVEST() EndFunc ;==>Input #EndRegion #Region Save/Load $CropColour Func FruitPicked() $HexC = IniReadSection($Location, GUICtrlRead($mylist)) $Picked = GUICtrlRead($mylist) ;MsgBox(0,"",""""& $Picked &"""") If $Picked <> "Positions" then If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else $Found = True $CropColour = $HexC[1][1] MsgBox(0,"","Harvesting "&$Picked& " now",3) Harvest() EndIf Else MsgBox(0,"!?","You can't choose that one. . ."&@CRLF&"(It's the mouse co-ordinates you saved for the Hay Bale Hack!)") EndIf EndFunc Func GetColour() MsgBox(0, "", "Hover over the crop you want to harvest and press F1" & @LF & "To get your crop code") While $Found = False If _IsPressed("70", $DLL) Then $POS = MouseGetPos() $CropColour = PixelGetColor($POS[0], $POS[1]) $Found = True EndIf WEnd EndFunc Func SaveColor() GetColour() $Hexed = Hex($CropColour,6) MsgBox(0,"","Testing: 0x" & $Hexed) $Coord2 = PixelSearch(0, 0, 1024, 768, $CropColour) if not @error then MouseClick("Left",$Coord2[0],$Coord2[1],1,0) EndIf $Question = MsgBox(4, "?", "Was that the right one?") If $Question = 6 Then SaveIt() $Found = True HARVEST() Else $Found = False SaveColor() EndIf EndFunc ;==>SaveColor Func SaveIt() $Name = InputBox('Crop Namer', 'Name of this crop?') If @error = 1 then $Oops = MsgBox(4,"?","Do you want to save this crop?"& @CRLF & "Recommended!") Select Case $Oops = 6 $Name = InputBox('Color Namer', 'Name of this crop?') Case $Oops = 7 $Found = False SaveColor() EndSelect Else ;$Name = InputBox('Color Namer', 'Name of this crop?') IniWrite($Location, $Name, 'Colors', "0x" & Hex($CropColour,6)) $Hexed = Hex($CropColour,6) MsgBox(0,"","Saved: " & $Name & ", Code: 0x" & $Hexed & @CRLF & "to C:\FV.ini") EndIf EndFunc Func RecallColor() $Sections = IniReadSectionNames($Location) If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else GUISetState(@SW_SHOW, $Maybe) $Show = True While $Show = True $msg = GUIGetMsg() If $msg = $mylist Then $HexC = IniReadSection($Location, GUICtrlRead($mylist)) $Picked = GUICtrlRead($mylist) ;MsgBox(0,"",""""& $Picked &"""") If $Picked <> "Positions" then If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else $Found = True $CropColour = $HexC[1][1] MsgBox(0,"","Harvesting "&$Picked& " now",3) Harvest() EndIf Else MsgBox(0,"!?","You can't choose that one. . ."&@CRLF&" (It's the mouse co-ordinates you saved for the Hay Bale Hack!)") EndIf EndIf If $msg = -3 Then HideColours() $Show = False EndIf WEnd EndIf EndFunc ;==>RecallColor Func HideColours() GUISetState(@SW_Hide,$HWND2) GUISetState(@SW_Show,$HWND1) $Show = False EndFunc #EndRegion #Region Login Shit Func LOGIN() ShellExecute("http://apps.facebook.com/onthefarm/index.php?ref=ts") WinWait("FarmVille on Facebook", "") If Not WinActive("FarmVille on Facebook", "") Then WinActivate("FarmVille on Facebook", "") WinWaitActive("FarmVille on Facebook", "") WinSetState("FarmVille on Facebook", "", @SW_MAXIMIZE) ;Sleep(15000) ;PLAY() ;MouseClickDrag("left", 1015, 250, 1015, 320) ;Sleep(15000) ;CHECKX() ;Sleep(500) ;MouseClick("left", 726, 598, 1, 0) ;WinWait("Adobe Flash Player", "") ;If Not WinActive("Adobe Flash Player", "") Then WinActivate("Adobe Flash Player", "") ;WinWaitActive("Adobe Flash Player", "") ;MouseClick("Left", 797, 632, 1, 0) ;Sleep(600) ;MouseClick("Left", 797, 632, 1, 0) ;Sleep(600) ;MouseClick("Left", 797, 632, 1, 0) ;Sleep(600) ;ProcessSetPriority("FireFox.exe", 1) $ZOOMEDOUT = True EndFunc ;==>LOGIN Func PLAY() $Coord = PixelSearch(60, 230, 75, 230, 7177396) If Not @error Then Sleep(1000) MouseClick("left", 130, 230, 1, 0) Sleep(16000) CHECKX() Else EndIf EndFunc ;==>PLAY Func CHECKX() ;$SearchING = 0 ;While $SearchING <= 5 $Coord = PixelSearch(30, 30, 900, 740, 12797498) If Not @error Then MouseClick("Left", $Coord[0], $Coord[1], 1, 0) ;Accept Else EndIf $Coord2 = PixelSearch(30, 30, 900, 740, 9747521) ;X If Not @error Then MouseClick("Left", $Coord2[0], $Coord2[1], 1, 0) EndIf $Coord3 = PixelSearch(30, 30, 900, 740, 10991832) ; Publish If Not @error Then MouseClick("Left", $Coord3[0], $Coord3[1], 1, 0) EndIf ;$SearchING = $SearchING + 1 ;WEnd ;$SearchING = 0 EndFunc ;==>CHECKX #EndRegion #Region HayBaleHack Func FindHB() $Searching = True while $Searching = True $CoOrd = PixelSearch(0,0,1024,768,0xB27623) if not @error then MouseClick("Left",$CoOrd[0],$CoOrd[1],1,0) ;MsgBox(0,"?","Click diamond?") Sleep(250) $CoOrd2=MouseGetPos() $CoOrd2 [0] = $CoOrd[0] + 17 $CoOrd2 [1] = $CoOrd[1] + 37 MouseClick("Left",$CoOrd2[0],$CoOrd2[1],1,0) MouseMove(0,0,0) AcceptSale() Else ;FindHB() $Searching = False EndIf WEnd EndFunc Func AcceptSale() Sleep(750) $Looking = True While $Looking = True $CoOrd1 = PixelSearch(0,0,1024,768,0x94BC41) if not @error then MouseClick("Left",$CoOrd1[0],$CoOrd1[1],1,0) Sleep(750) ;MouseMove(0,0,0) Else $Looking = False Sleep(105) EndIf WEnd EndFunc Func HAYBALEHACK() If $P1 = "Not Found" Then If $Done = False Then MsgBox(0, "!", "Hold Ctrl then Click for each action" & @LF & "Press Alt + 2 to stop recording", 7) ;MsgBox(0, "!", "Press Ctrl + 2 to stop recording", 5) While $NotDone = False Sleep(50) DllOpen($DLL) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then $POS = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(300) ToolTip("") HB1() EndIf EndIf WEnd Else DOIT() EndIf Else Load() ;MsgBox(0, "?", "Can be done nao?") EndIf EndFunc ;==>HAYBALEHACK Func Load() $Load = MsgBox(4, "?", "Do you want to load a previous recording?") If $Load = 6 Then LoadItUp() ;EndIf If $Load = 7 Then Oops() EndFunc ;==>Load Func Oops() $P1 = "Not Found" HAYBALEHACK() EndFunc ;==>Oops Func IMSOSICK() $NotDone = True $Done = True MsgBox(0, "!", "Recorded all steps", 5) Save() ;SETDELAY() EndFunc ;==>IMSOSICK Func Save() $AWYEAH = MsgBox(3, "Save?", "Do you want to save this recording to file for later use?"&@LF&"Or do you want to cancel?") Select Case $AWYEAH = 6 MsgBox(0,"!!!","Make sure FarmVille is in the same place next time!!!"&@LF&"(Line up the top of it with the top of your browser)") WritePIni() ;MsgBox(4, "Save?", "OBBBEEYY MMEE, please??!!??") $AWYEAH1 = MsgBox(4, "Saved", "Do you want run it now?") Select Case $AWYEAH1 = 6 HayBaleHack() Case $AWYEAH1 = 7 MsgBox(0, "!", "Activate the hack by pressing Ctrl+Alt+B") Sleep(20) EndSelect Case $AWYEAH = 7 MsgBox(0, "!", "Activate the hack by pressing Ctrl+Alt+B") Case $AWYEAH = 2 Hm() EndSelect EndFunc ;==>Save Func Hm() $WhatWuzThat = MsgBox(4, "?", "Do you want to Re-Record") If $WhatWuzThat = 6 Then Reset() If $WhatWuzThat = 7 Then Sleep(10) EndFunc ;==>Hm Func LoadItUp() If $P0 <> "Not Found" Then $POS[0] = $P0 If $P1 <> "Not Found" Then $POS[1] = $P1 If $P2 <> "Not Found" Then $POS1[0] = $P2 If $P3 <> "Not Found" Then $POS1[1] = $P3 If $P4 <> "Not Found" Then $POS2[0] = $P4 If $P5 <> "Not Found" Then $POS2[1] = $P5 If $P6 <> "Not Found" Then $POS3[0] = $P6 If $P7 <> "Not Found" Then $POS3[1] = $P7 If $P8 <> "Not Found" Then $POS4[0] = $P8 If $P9 <> "Not Found" Then $POS4[1] = $P9 If $P10 <> "Not Found" Then $POS5[0] = $P10 If $P11 <> "Not Found" Then $POS5[1] = $P11 If $P12 <> "Not Found" Then $POS6[0] = $P12 If $P13 <> "Not Found" Then $POS6[1] = $P13 If $P14 <> "Not Found" Then $POS7[0] = $P14 If $P15 <> "Not Found" Then $POS7[1] = $P15 If $P16 <> "Not Found" Then $POS8[0] = $P16 If $P17 <> "Not Found" Then $POS8[1] = $P17 If $P18 <> "Not Found" Then $POS9[0] = $P18 If $P19 <> "Not Found" Then $POS9[1] = $P19 If $P20 <> "Not Found" Then $POS10[0] = $P20 If $P21 <> "Not Found" Then $POS10[1] = $P21 If $P22 <> "Not Found" Then $POS11[0] = $P22 If $P23 <> "Not Found" Then $POS11[1] = $P23 If $P24 <> "Not Found" Then $POS12[0] = $P24 If $P25 <> "Not Found" Then $POS12[1] = $P25 If $P26 <> "Not Found" Then $POS13[0] = $P26 If $P27 <> "Not Found" Then $POS13[1] = $P27 If $P28 <> "Not Found" Then $POS14[0] = $P28 If $P29 <> "Not Found" Then $POS14[1] = $P29 If $P30 <> "Not Found" Then $POS15[0] = $P30 If $P31 <> "Not Found" Then $POS15[1] = $P31 If $P32 <> "Not Found" Then $POS16[0] = $P32 If $P33 <> "Not Found" Then $POS16[1] = $P33 If $P34 <> "Not Found" Then $POS17[0] = $P34 If $P35 <> "Not Found" Then $POS17[1] = $P35 If $P36 <> "Not Found" Then $POS18[0] = $P36 If $P37 <> "Not Found" Then $POS18[1] = $P37 If $P38 <> "Not Found" Then $POS19[0] = $P38 If $P39 <> "Not Found" Then $POS19[1] = $P39 If $P40 <> "Not Found" Then $POS20[0] = $P40 If $P41 <> "Not Found" Then $POS20[1] = $P41 If $P42 <> "Not Found" Then $POS21[0] = $P42 If $P43 <> "Not Found" Then $POS21[1] = $P43 If $P44 <> "Not Found" Then $POS22[0] = $P44 If $P45 <> "Not Found" Then $POS22[1] = $P45 If $P46 <> "Not Found" Then $POS23[0] = $P46 If $P47 <> "Not Found" Then $POS23[1] = $P47 If $P48 <> "Not Found" Then $POS24[0] = $P48 If $P49 <> "Not Found" Then $POS24[1] = $P49 If $P50 <> "Not Found" Then $POS25[0] = $P50 If $P51 <> "Not Found" Then $POS25[1] = $P51 If $P52 <> "Not Found" Then $POS26[0] = $P52 If $P53 <> "Not Found" Then $POS26[1] = $P53 If $P54 <> "Not Found" Then $POS27[0] = $P54 If $P55 <> "Not Found" Then $POS27[1] = $P55 If $P56 <> "Not Found" Then $POS28[0] = $P56 If $P57 <> "Not Found" Then $POS28[1] = $P57 If $P58 <> "Not Found" Then $POS29[0] = $P58 If $P59 <> "Not Found" Then $POS29[1] = $P59 If $P60 <> "Not Found" Then $POS30[0] = $P60 If $P61 <> "Not Found" Then $POS30[1] = $P61 MsgBox(0, "!", "Loaded, hope your ready. . .") SETDELAY() DOIT() EndFunc ;==>LoadItUp Func SETDELAY() $MARKETDELAY = InputBox("Input", "Please for the market") $DELAY = InputBox("Input", "Please input delay between each click(1)") $DELAY = $DELAY * 1000 $MARKETDELAY = $MARKETDELAY * 1000 $DELAYSET = True $HBNUM = InputBox("Input", "How many times do you want to do it?") MsgBox(0, "!", "Activate the hack by pressing Ctrl+Alt+B") EndFunc ;==>SETDELAY Func DOIT() If $DELAYSET = True Then While $HBNUM >= $COUNT If $POS[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS[0], $POS[1], 1, 0) Sleep($MARKETDELAY) EndIf If $POS1[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS1[0], $POS1[1], 1, 0) Sleep($MARKETDELAY) EndIf If $POS2[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS2[0], $POS2[1], 1, 0) Sleep($MARKETDELAY) EndIf If $POS3[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS3[0], $POS3[1], 1, 0) Sleep($DELAY) EndIf If $POS4[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS4[0], $POS4[1], 1, 0) Sleep($DELAY) EndIf If $POS5[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS5[0], $POS5[1], 1, 0) Sleep($DELAY) EndIf If $POS6[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS6[0], $POS6[1], 1, 0) Sleep($DELAY) EndIf If $POS7[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS7[0], $POS7[1], 1, 0) Sleep($DELAY) EndIf If $POS8[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS8[0], $POS8[1], 1, 0) Sleep($DELAY) EndIf If $POS9[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS9[0], $POS9[1], 1, 0) Sleep($DELAY) EndIf If $POS10[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS10[0], $POS10[1], 1, 0) Sleep($DELAY) EndIf If $POS11[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS11[0], $POS11[1], 1, 0) Sleep($DELAY) EndIf If $POS12[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS12[0], $POS12[1], 1, 0) Sleep($DELAY) EndIf If $POS13[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS13[0], $POS13[1], 1, 0) Sleep($DELAY) EndIf If $POS14[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS14[0], $POS14[1], 1, 0) Sleep($DELAY) EndIf If $POS15[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS15[0], $POS15[1], 1, 0) Sleep($DELAY) EndIf If $POS16[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS16[0], $POS16[1], 1, 0) Sleep($DELAY) EndIf If $POS17[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS17[0], $POS17[1], 1, 0) Sleep($DELAY) EndIf If $POS18[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS18[0], $POS18[1], 1, 0) Sleep($DELAY) EndIf If $POS19[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS19[0], $POS19[1], 1, 0) Sleep($DELAY) EndIf If $POS20[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS20[0], $POS20[1], 1, 0) Sleep($DELAY) EndIf If $POS21[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS21[0], $POS21[1], 1, 0) Sleep($DELAY) EndIf If $POS22[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS22[0], $POS22[1], 1, 0) Sleep($DELAY) EndIf If $POS23[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS23[0], $POS23[1], 1, 0) Sleep($DELAY) EndIf If $POS24[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS24[0], $POS24[1], 1, 0) Sleep($DELAY) EndIf If $POS25[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS25[0], $POS25[1], 1, 0) Sleep($DELAY) EndIf If $POS26[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS26[0], $POS26[1], 1, 0) Sleep($DELAY) EndIf If $POS27[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS27[0], $POS27[1], 1, 0) Sleep($DELAY) EndIf If $POS28[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS28[0], $POS28[1], 1, 0) Sleep($DELAY) EndIf If $POS29[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS29[0], $POS29[1], 1, 0) Sleep($DELAY) EndIf If $POS30[0] >= $DUMMYPOS[0] Then MouseClick("Left", $POS30[0], $POS30[1], 1, 0) Sleep($DELAY) EndIf $COUNT = $COUNT + 1 FindHB() WEnd $COUNT = 0 Else SETDELAY() EndIf EndFunc ;==>DOIT #EndRegion #Region HayBale CoOrds/WritePosition Ini Func HB1() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS1 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB2() EndIf EndIf WEnd EndFunc ;==>HB1 Func HB2() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS2 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB3() EndIf EndIf WEnd EndFunc ;==>HB2 Func HB3() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS3 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB4() EndIf EndIf WEnd EndFunc ;==>HB3 Func HB4() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS4 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB5() EndIf EndIf WEnd EndFunc ;==>HB4 Func HB5() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS5 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB6() EndIf EndIf WEnd EndFunc ;==>HB5 Func HB6() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS6 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB7() EndIf EndIf WEnd EndFunc ;==>HB6 Func HB7() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS7 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB8() EndIf EndIf WEnd EndFunc ;==>HB7 Func HB8() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS8 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB9() EndIf EndIf WEnd EndFunc ;==>HB8 Func HB9() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS9 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB10() EndIf EndIf WEnd EndFunc ;==>HB9 Func HB10() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS10 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB11() EndIf EndIf WEnd EndFunc ;==>HB10 Func HB11() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS11 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB12() EndIf EndIf WEnd EndFunc ;==>HB11 Func HB12() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS12 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB13() EndIf EndIf WEnd EndFunc ;==>HB12 Func HB13() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS13 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB14() EndIf EndIf WEnd EndFunc ;==>HB13 Func HB14() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS14 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB15() EndIf EndIf WEnd EndFunc ;==>HB14 Func HB15() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS15 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB16() EndIf EndIf WEnd EndFunc ;==>HB15 Func HB16() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then $POS16 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") $WaitForIt1 = True HB17() EndIf EndIf WEnd EndFunc ;==>HB16 Func HB17() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS17 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB18() EndIf EndIf WEnd EndFunc ;==>HB17 Func HB18() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS18 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB19() EndIf EndIf WEnd EndFunc ;==>HB18 Func HB19() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS19 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB20() EndIf EndIf WEnd EndFunc ;==>HB19 Func HB20() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS20 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB21() EndIf EndIf WEnd EndFunc ;==>HB20 Func HB21() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS21 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB22() EndIf EndIf WEnd EndFunc ;==>HB21 Func HB22() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS22 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB23() EndIf EndIf WEnd EndFunc ;==>HB22 Func HB23() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS23 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB24() EndIf EndIf WEnd EndFunc ;==>HB23 Func HB24() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS24 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB25() EndIf EndIf WEnd EndFunc ;==>HB24 Func HB25() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS25 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB26() EndIf EndIf WEnd EndFunc ;==>HB25 Func HB26() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS26 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB27() EndIf EndIf WEnd EndFunc ;==>HB26 Func HB27() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS27 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB28() EndIf EndIf WEnd EndFunc ;==>HB27 Func HB28() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS28 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB29() EndIf EndIf WEnd EndFunc ;==>HB28 Func HB29() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS29 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") HB30() EndIf EndIf WEnd EndFunc ;==>HB29 Func HB30() While $NotDone = False Sleep(50) If _IsPressed("11", $DLL) Then If _IsPressed("1", $DLL) Then ;MouseDown("left") ;MouseUp("left") $POS30 = MouseGetPos() ToolTip("Recorded", 512, 384, "!", 1, 2) Sleep(250) ToolTip("") MsgBox(0, "!", "Maximum number of steps recorded!") DllClose($DLL) $NotDone = True $Done = True ImSoSick() EndIf EndIf WEnd EndFunc ;==>HB30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func WritePIni() If $POS[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 0", $POS[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 1", $POS[1]) WriteP1() EndIf EndFunc ;==>WritePIni Func WriteP1() If $POS1[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 2", $POS1[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 3", $POS1[1]) WriteP2() EndIf EndFunc ;==>WriteP1 Func WriteP2() If $POS2[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 4", $POS2[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 5", $POS2[1]) WriteP3() EndIf EndFunc ;==>WriteP2 Func WriteP3() If $POS3[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 6", $POS3[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 7", $POS3[1]) WriteP4() EndIf EndFunc ;==>WriteP3 Func WriteP4() If $POS4[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 8", $POS4[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 9", $POS4[1]) WriteP5() EndIf EndFunc ;==>WriteP4 Func WriteP5() If $POS5[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 10", $POS5[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 11", $POS5[1]) WriteP6() EndIf EndFunc ;==>WriteP5 Func WriteP6() If $POS6[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 12", $POS6[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 13", $POS6[1]) WriteP7() EndIf EndFunc ;==>WriteP6 Func WriteP7() If $POS7[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 14", $POS7[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 15", $POS7[1]) WriteP8() EndIf EndFunc ;==>WriteP7 Func WriteP8() If $POS8[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 16", $POS8[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 17", $POS8[1]) WriteP9() EndIf EndFunc ;==>WriteP8 Func WriteP9() If $POS9[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 18", $POS9[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 19", $POS9[1]) WriteP10() EndIf EndFunc ;==>WriteP9 Func WriteP10() If $P10 >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 20", $POS10[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 21", $POS10[1]) WriteP11() EndIf EndFunc ;==>WriteP10 Func WriteP11() If $POS11[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 22", $POS11[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 23", $POS11[1]) WriteP12() EndIf EndFunc ;==>WriteP11 Func WriteP12() If $POS12[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 24", $POS12[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 25", $POS12[1]) WriteP13() EndIf EndFunc ;==>WriteP12 Func WriteP13() If $POS13[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 26", $POS13[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 27", $POS13[1]) WriteP14() EndIf EndFunc ;==>WriteP13 Func WriteP14() If $POS14[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 28", $POS14[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 29", $POS14[1]) WriteP15() EndIf EndFunc ;==>WriteP14 Func WriteP15() If $POS15[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 30", $POS15[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 31", $POS15[1]) WriteP16() EndIf EndFunc ;==>WriteP15 Func WriteP16() If $POS16[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 32", $POS16[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 33", $POS16[1]) WriteP17() EndIf EndFunc ;==>WriteP16 Func WriteP17() If $POS17[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 34", $POS17[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 35", $POS17[1]) WriteP18() EndIf EndFunc ;==>WriteP17 Func WriteP18() If $POS18[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 36", $POS18[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 37", $POS18[1]) WriteP19() EndIf EndFunc ;==>WriteP18 Func WriteP19() If $POS19[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 38", $POS19[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 39", $POS19[1]) WriteP20() EndIf EndFunc ;==>WriteP19 Func WriteP20() If $POS20[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 40", $POS20[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 41", $POS20[1]) WriteP21() EndIf EndFunc ;==>WriteP20 Func WriteP21() If $POS21[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 42", $POS22[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 43", $POS22[1]) WriteP22() EndIf EndFunc ;==>WriteP21 Func WriteP22() If $POS22[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 44", $POS23[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 45", $POS23[1]) WriteP23() EndIf EndFunc ;==>WriteP22 Func WriteP23() If $POS23[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 46", $POS24[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 47", $POS24[1]) WriteP24() EndIf EndFunc ;==>WriteP23 Func WriteP24() If $POS24[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 48", $POS25[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 49", $POS25[1]) WriteP25() EndIf EndFunc ;==>WriteP24 Func WriteP25() If $POS25[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 50", $POS26[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 51", $POS26[1]) WriteP26() EndIf EndFunc ;==>WriteP25 Func WriteP26() If $POS26[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 52", $POS27[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 53", $POS27[1]) WriteP27() EndIf EndFunc ;==>WriteP26 Func WriteP27() If $POS27[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 54", $POS28[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 55", $POS28[1]) WriteP28() EndIf EndFunc ;==>WriteP27 Func WriteP28() If $POS28[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 56", $POS29[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 57", $POS29[1]) WriteP29() EndIf EndFunc ;==>WriteP28 Func WriteP29() If $POS29[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 58", $POS29[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 59", $POS29[1]) WriteP30() EndIf EndFunc ;==>WriteP29 Func WriteP30() If $POS30[0] >= $DUMMYPOS[0] Then IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 60", $POS30[0]) IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 61", $POS30[1]) EndIf EndFunc ;==>WriteP30 Func Reset() $POS1[0] = 0 $POS2[0] = 0 $POS3[0] = 0 $POS4[0] = 0 $POS5[0] = 0 $POS6[0] = 0 $POS7[0] = 0 $POS8[0] = 0 $POS9[0] = 0 $POS10[0] = 0 $POS11[0] = 0 $POS12[0] = 0 $POS13[0] = 0 $POS14[0] = 0 $POS15[0] = 0 $POS16[0] = 0 $POS17[0] = 0 $POS18[0] = 0 $POS19[0] = 0 $POS20[0] = 0 $POS21[0] = 0 $POS22[0] = 0 $POS23[0] = 0 $POS24[0] = 0 $POS25[0] = 0 $POS26[0] = 0 $POS27[0] = 0 $POS28[0] = 0 $POS29[0] = 0 $POS30[0] = 0 $POS1[1] = 0 $POS2[1] = 0 $POS3[1] = 0 $POS4[1] = 0 $POS5[1] = 0 $POS6[1] = 0 $POS7[1] = 0 $POS8[1] = 0 $POS9[1] = 0 $POS10[1] = 0 $POS11[1] = 0 $POS12[1] = 0 $POS13[1] = 0 $POS14[1] = 0 $POS15[1] = 0 $POS16[1] = 0 $POS17[1] = 0 $POS18[1] = 0 $POS19[1] = 0 $POS20[1] = 0 $POS21[1] = 0 $POS22[1] = 0 $POS23[1] = 0 $POS24[1] = 0 $POS25[1] = 0 $POS26[1] = 0 $POS27[1] = 0 $POS28[1] = 0 $POS29[1] = 0 $POS30[1] = 0 IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 0", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 1", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 2", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 3", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 4", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 5", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 6", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 7", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 8", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 9", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 10", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 11", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 12", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 13", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 14", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 15", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 16", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 17", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 18", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 19", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 20", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 21", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 22", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 23", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 24", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 25", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 26", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 27", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 28", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 29", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 30", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 31", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 32", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 33", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 34", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 35", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 36", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 37", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 38", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 39", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 40", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 41", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 42", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 43", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 44", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 45", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 46", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 47", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 48", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 49", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 50", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 51", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 52", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 53", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 54", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 55", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 56", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 57", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 58", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 59", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 60", "Not Found") IniWrite("C:\Program Files\FarmShark\FV.ini", "Positions", "Position 61", "Not Found") $NotDone = False $Done = False HAYBALEHACK() EndFunc ;==>Reset #EndRegion #Region Exit Techs Func Edit() if not @error Then ShellExecute("C:\Users\Tristan\Desktop\FVA\FVA v425.au3") Else MsgBox(0,"","No sauce for you!") EndIf EndFunc Func Restart() ShellExecute(@AutoItExe) ;$Pid = @AutoItPID ;$ScriptPath = @ScriptFullPath ;ProcessClose($Pid) Exit EndFunc Func EXIT1() GUIDelete() GUIDelete($PriorityGui) ; $Lulz = MsgBox(6, "", "Without me your nothing"); ;If $Lulz = 10 Then EXIT1() ;If $Lulz = 2 Then GoBack() ;If $Lulz = 11 Then MsgBox(0, "", "I'm glad you accept this fact") DllClose($DLL) ToolTip("Created, Coded and Desinged by: TriBe " & @LF & "Alpha Tester & Executive Farmer: Almoose_B", 512, 384, "", 0, 1) Sleep(5000) ToolTip("") Exit EndFunc ;==>EXIT1 Func GoBack() MsgBox(0, "", "Why, Mr. Anderson, why? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something, for more than your survival? Can you tell me what it is, do you even know? Is it freedom or truth, perhaps peace; could it be for love? Illusions, Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself. Although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson, you must know it by now! You can't win, it's pointless to keep fighting!"&@CRLF&@CRLF&"Why, Mr. Anderson, why? Why do you persist?") EXIT1() EndFunc ;==>GoBack Func StopTheBoat() $Search = False $Found = False While 1 EzSkinOver() $msg = GUIGetMsg() If $msg = $PriorityList then Set() If $msg = $EzIcon[1] Then Exit ;1() If $msg = $EzIcon[2] Then GuiSetstate(@SW_MINIMIZE, $EzGUI) If $msg = $EzIcon2[1] Then HideInstrucGui() If $msg = $EzIcon2[2] Then GuiSetstate(@SW_MINIMIZE, $InstructionsGUI) If $msg = $EzIcon3[1] Then HideInstrucBox() If $msg = $EzIcon3[2] Then GuiSetstate(@SW_MINIMIZE, $InstructionsBox) If $msg = $Instructions Then Instructions() If $msg = $OpenI then OpenI() If $msg = $PlantI then PlantI() If $msg = $HarvestI then HarvestI() If $msg = $PlowI then PlowI() If $msg = $HBHI then HBHI() If $msg = $CalcI then CalcI() If $MSG = $LOGIN Then LOGIN() If $MSG = $PLANT Then Plant1() If $MSG = $HARVEST Then HARVEST() If $MSG = $PLOW Then PLOW() If $MSG = $HAYBALE Then HAYBALEHACK() If $MSG = $Animals Then Animals() If $MSG = $Calculate Then Calculate() If $MSG = $Input1 Then Input1() If $MSG = $Instructions Then Instructions() If $msg = $mylist Then FruitPicked() ;If $Maybe = - 3 Then ;ExitColours() ;EndIf If $msg = - 3 Then ExitColours() If $MSG = $Cancel Then StopTheBoat() If $MSG = $Restart Then Restart() WEnd EndFunc ;==>StopTheBoat Func ExitColours() $Show = False GUISetState(@SW_Hide,$Maybe) GUISetState(@SW_SHOW,$EzGUI) EndFunc #EndRegion [/autoit]

This post has been edited by BitByteBit: 19 November 2009 - 09:26 AM

0

#2 User is offline   BitByteBit 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 55
  • Joined: 20-May 09

Posted 04 November 2009 - 09:04 AM

Open the file FV.ini and paste this in.
Sorry I forgot to mention that FV.ini should be in the root of C:\

[BlueBerries]
Colours=0x573734

[Pumpkins]
Colours=0xF58F20

[Green Tea]
Colors=0x3D651B

[Coffee]
Colors=0xA03118

[Raspberries]
Colors=0x9B1725

[Rice]
Colors=0x4A661F

[Tomatoes]
Colors=0xEF7B5F

[Unseeded Land]
Colors=0x602806

[Plowable Land]
Colors=0x474806

[Withered Crop]
Colors=0x463715

[Strawberries]
Colors=0x663117

[Ghost Chilli]
Colors=0x62270B

[BlackBerries]
Colors=0x325125

[Sunflower]
Colors=0xD48212

[Sugar Cane]
Colors=0x4D1C02

This post has been edited by BitByteBit: 04 November 2009 - 09:05 AM

0

#3 User is online   storme 

  • Advanced Member
  • PipPip
  • Group: Full Members
  • Posts: 172
  • Joined: 30-October 08
  • Gender:Male
  • Location:Australia

Posted 04 November 2009 - 02:05 PM

Looks good.
I definately like your method! It's not forcing the farm to so what you want it's doing what is needed on the farm.
Do you ever have any misses with the searches and it clicks on the wrong thing?

2 suggestions if I may.

1. Work out a method of automatically fullscreening the farm. So when a chore chosen it does the whole farm.
2. Set it to always on top so you don't have to alt-tab back and forth to your program and farmville. (Minimize it when you are doing something so it doesn't hide anything.)

Oh one thing I just found....... I did a plow and it missed a line that had "red wheat" planted in front of it. Not a big problem but thought you should know.

Well done
0

#4 User is offline   BitByteBit 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 55
  • Joined: 20-May 09

Posted 04 November 2009 - 07:16 PM

Thanks for taking the time to reply.

No I don't have problems with it clicking the wrong thing. I've tried to be careful as to what pixel colour I program in.

1. I know how I would make it fullscreen, I would search for the plow tool colour, get the co-ords and minus a certain amount from them, thus moving the mouse a certain amount up and right, this would bring me to the fullscreen button I believe. However for some reason the functions run much slower if FV is fullscreen. I'm not sure why to be honest. Try it for yourself, make FV fullscreen and press Ctrl+Alt+P to plow, look at the speed, then press esc, it goes much faster when not fullscreened, I have no idea why, perhaps Adobe Flash Player when fullscreen is taking up more cpu cycles.

2. I'm aware of this problem, I need to change the pixel colour it searches for to one closer to the top of the top.

Thank you for your input, its people like you that help improve my program. :lol:


As for making it always on top, I'll think about it ;)
0

#5 User is offline   KeithDawn 

  • Newbie
  • Group: Full Members
  • Posts: 7
  • Joined: 06-November 09

Posted 06 November 2009 - 08:11 PM

This script is wonderful, I must say, but I have found a small issue with it.

It seems unable to work on any fertilized crops, plus the above mentioning of spaces being blocked by other crops.

Two quick questions though.
1 - Have you thought about doing an animal harvester with this code? Given they all have the pink diamond above their head, and the harvest option is always 3rd down on the list, would it be possible? (I as because I suck at coding, it's been to long for me.)
2 - Is there any way to pause the script / end it manually mid-run? I had an issue where it accidentally picked up a kitten twice, and just twitched back and forth across the screen for a minute until I closed firefox.

Just wondering, but awesome script and good job!
0

#6 User is offline   BitByteBit 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 55
  • Joined: 20-May 09

Posted 06 November 2009 - 11:33 PM

View PostKeithDawn, on 06 November 2009 - 09:11 PM, said:

This script is wonderful, I must say, but I have found a small issue with it.

It seems unable to work on any fertilized crops, plus the above mentioning of spaces being blocked by other crops.

Two quick questions though.
1 - Have you thought about doing an animal harvester with this code? Given they all have the pink diamond above their head, and the harvest option is always 3rd down on the list, would it be possible? (I as because I suck at coding, it's been to long for me.)
2 - Is there any way to pause the script / end it manually mid-run? I had an issue where it accidentally picked up a kitten twice, and just twitched back and forth across the screen for a minute until I closed firefox.

Just wondering, but awesome script and good job!


Ctrl+F1: Cancels the current action
Alt+Escape: Exits the script
Alt+R restarts the program

[ autoIt ]    ( ExpandCollapse - Popup )
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=C:\Users\Tristan\Desktop\Animals.exe #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Opt("WinWaitDelay", 100) Opt("WinTitleMatchMode", 2) Opt("WinDetectHiddenText", 1) Opt("MouseCoordMode", 1) Opt("TrayIconDebug", 1) Opt("PixelCoordMode",1) HotKeySet("^{F1}", "Animals") HotKeySet("^{F2}", "Stop") Global $CoOrd[2] Global $CoOrd2[2] $Num = 0 $Searching = False     ToolTip("Ctrl+F1 to start", "", "", "!", 1, 2)     Sleep(2000)     ToolTip("")         ToolTip("Ctrl+F2 to stop","","", "!", 1, 2)     Sleep(2000)     ToolTip("") While 1     Sleep(10) wend Func Stop() While 1     Sleep(500) wend     EndFunc Func Animals() $Searching = True while $Searching = True $CoOrd = PixelSearch(0,0,1024,768,0xD02875,20)  ;  0xCF0867   0XFF409D Sorta works with shade variation of 10-20 ;$CoOrd = PixelSearch(0,0,1024,768,0xD02875,21) ;Deff working!!! ;$CoOrd3 = PixelSearch(0,0,1024,768,0XFF409D,15)  ;  Perhaps have several colous? if not @error then     MouseClick("Left",$CoOrd[0],$CoOrd[1],1,0)     ;MsgBox(0,"?","Click diamond?")     $CoOrd2=MouseGetPos()     $CoOrd2 [0] = $CoOrd[0] + 17     $CoOrd2 [1] = $CoOrd[1] + 47     Sleep(210)     MouseClick("Left",$CoOrd2[0],$CoOrd2[1],1,0)     ToolTip($Num, 0, 0, "!", 1, 2)     Sleep(75)     ToolTip("")     $Num = $Num + 1         ;MsgBox(0,"?","Click probs??")     Else         MsgBox(0,"1","No animals??")         $Searching = False     EndIf     WEnd     EndFunc  


That is the code for animals. I've yet to build it into the main GUI cos I hate redesigning GUI's!!!
That and the program is already pretty chunky!
0

#7 User is offline   KeithDawn 

  • Newbie
  • Group: Full Members
  • Posts: 7
  • Joined: 06-November 09

Posted 07 November 2009 - 01:38 AM

Did I mention how much a love you and your scripts?!?! Cause I do, very much so. Thanks you for pointing out how to pause the script, just had the same issue with the kitten and it fixed things quite nicely. As for the animal script, love it, works great.

Just my opinion, but if you were looking for something to cut from the main program to add in the animals, I say cut the profit calculator. I think people could survive without it.

That's just my opinion though, but yeah, love your work!
0

#8 User is online   storme 

  • Advanced Member
  • PipPip
  • Group: Full Members
  • Posts: 172
  • Joined: 30-October 08
  • Gender:Male
  • Location:Australia

Posted 07 November 2009 - 03:30 AM

View PostBitByteBit, on 07 November 2009 - 08:33 AM, said:

Ctrl+F1: Cancels the current action
Alt+Escape: Exits the script
Alt+R restarts the program

[ autoIt ]    ( Popup )
HotKeySet("^{F1}", "Animals") HotKeySet("^{F2}", "Stop")  


That is the code for animals. I've yet to build it into the main GUI cos I hate redesigning GUI's!!!
That and the program is already pretty chunky!


Works well except it's picking up animals that have already been clicked and clicking them again. This brings up an "Animal is busy" message. I added a 2 second delay and it's working slow but no more messages. May be you coudl tighten up the tollerence so it ignores the clicked animals but I'm not sure if this will miss some.

Also it would be worth doing a check to see that what is being clicked on is "harvest/collect". The dairy menu is different and I think the "SELL" item is where the "harvest" is on animals. Wouldn't be good to sell things that you don't want to. :-)

Thanks again
John Morrison
aka
Storm-E
0

#9 User is offline   JohnOne 

  • Spammer!
  • PipPipPip
  • Group: Full Members
  • Posts: 204
  • Joined: 20-August 09

Posted 08 November 2009 - 01:11 AM

I would not mind trying a automation script like this, I will get a facebook account to try it.

Quick question, Do I need to know the game farmville, before trying this, or will it go from the start ?

The last computer game I played was pac man.
0

#10 User is offline   KeithDawn 

  • Newbie
  • Group: Full Members
  • Posts: 7
  • Joined: 06-November 09

Posted 09 November 2009 - 12:59 AM

With the dairy farms, it's the move which is third down, not sell, so no risk of selling there. I just harvest them first manually to prevent any errors.

View Poststorme, on 06 November 2009 - 10:30 PM, said:

Works well except it's picking up animals that have already been clicked and clicking them again. This brings up an "Animal is busy" message. I added a 2 second delay and it's working slow but no more messages. May be you coudl tighten up the tollerence so it ignores the clicked animals but I'm not sure if this will miss some.


Just wondering how to added the 2 second delay. FYI I suck at coding so I dare not try myself, but perhaps you could point me in the right direction.

View PostJohnOne, on 07 November 2009 - 08:11 PM, said:

I would not mind trying a automation script like this, I will get a facebook account to try it.

Quick question, Do I need to know the game farmville, before trying this, or will it go from the start ?

The last computer game I played was pac man.


Yes, you will need to know the game farmville before using this. In fact, this code would only become really useful once you get a few levels under your belt. But by that time, you'll understand the game. I like to think of it as a lite version of Harvest Moon.

EDIT: Also just realized, with the animal script it may be possible to harvest cherry trees. I have a bunch and just realized when I run the script with them on the screen, it clicks on them as if they are a pink triangle. Only problem I see is it's trying to do this when they are not ready, and as such would probably create a loop within the program of just clicking on the same tree over and over.

This post has been edited by KeithDawn: 09 November 2009 - 01:14 AM

0

#11 User is offline   BitByteBit 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 55
  • Joined: 20-May 09

Posted 09 November 2009 - 02:48 AM

John, Keith, thank you very much for your input so far.

I will cut out the profit calculator and change it to Animals soon, I will post the new code when I do.

This is the new Animals code. I haven't got round to fixing the Harvest/Move issue, maybe this week if I get time. So for now just harvest your dairy farms manually, sorry guys!

This should resolve the issue of click an animal multiple times. Let me know how it works out!

If you want to fiddle with the tolerance change the number 20 to a lower number here:
$CoOrd = PixelSearch(0,0,1024,768,0xD02875,20)


EDIT: Animal Code Fixed

[ autoIt ]    ( ExpandCollapse - Popup )
Opt("WinWaitDelay", 100) Opt("WinTitleMatchMode", 2) Opt("WinDetectHiddenText", 1) Opt("MouseCoordMode", 1) Opt("TrayIconDebug", 1) Opt("PixelCoordMode",1) HotKeySet("^{F1}", "Animals") HotKeySet("^{F2}", "Stop") Global $CoOrd[2] Global $CoOrd2[2] Global $CoOrd3[2] $CoOrd3 [0] = 0 $CoOrd3 [0] = 0 $Num = 0 $Searching = False     ToolTip("Ctrl+F1 to start", "", "", "!", 1, 2)     Sleep(2000)     ToolTip("")         ToolTip("Ctrl+F2 to stop","","", "!", 1, 2)     Sleep(2000)     ToolTip("") While 1     Sleep(10) wend Func Stop() While 1     Sleep(500) wend     EndFunc Func Animals() $Searching = True while $Searching = True $CoOrd = PixelSearch(0,0,1024,768,0xD02875,20) if not @error then     IF $CoOrd[0] <> $CoOrd3[0] OR $CoOrd[1] <> $CoOrd3[1] then     MouseClick("Left",$CoOrd[0],$CoOrd[1],1,0)     ;MsgBox(0,"?","Click diamond?")     $CoOrd2=MouseGetPos()     $CoOrd3[0] = $Coord2[0]     $CoOrd3[1] = $Coord2[1]     $CoOrd2 [0] = $CoOrd[0] + 17     $CoOrd2 [1] = $CoOrd[1] + 47     Sleep(210)     MouseClick("Left",$CoOrd2[0],$CoOrd2[1],1,0)     ToolTip($Num, 0, 0, "!", 1, 2)     Sleep(75)     ToolTip("")     $Num = $Num + 1     Else     Sleep(1)     EndIf     Else         ToolTip("Animals Done/No Animals")         Sleep(1250)         ToolTip("")         $Searching = False     EndIf     WEnd EndFunc  



Tree's is a whole other project, however it does use the same technique used for Animals and so shouldn't be hard at all.

The only catch is I basically need to get a colour for each fully matured tree, a colour that only appears when they are done and not when they are growing. On top of this I have to find a colour which is viewable regardless of what(and where said item) is front of the tree, however I do not think this is a major issue.

Once I have the colours; using the same method I can create a script to harvest Trees.

Balls in your court guys. If you want to try to create your own script for trees with the animal code then save a copy of the animals file and:


1. Open FarmVille.
2. Take a print screen by pressing the PrtScn button.
3. Open Paint.
4. Press Ctrl+V
5. Open AutoIt Window Info and click on the mouse tab (Installed with AutoIt)
6. Back in paint, hover over the fully matured tree and press Ctrl+Alt+F
7. In AutoIt Window Info double click "Color" , that colour code is now saved into your clipboard.
8. Replace the 0xD02875 part of "$CoOrd = PixelSearch(0,0,1024,768,0xD02875) with
$CoOrd = PixelSearch(0,0,1024,768,YOURCOLOURHERE)" with the colour you just got.
9. Test.
10. Report back.

If done correctly you will make a code to harvest one particular tree type ^__^, at which point you can call yourself a hobbyist programmer :huggles:

Send me a PM if you have issues/questions :D

I don't have any the trees so I can't do this, if I get a few Tree colour codes I will happily make a script to harvest trees.

. . .

One more thing, I'm fully aware of the Plowing issue, in my next update it will be fixed. However for now, open the source code and find and replace(Ctrl+H):

Find:
$Coord2 = PixelSearch(30, 30, 1024, 768, 9731111)

Replace with:
$Coord2 = PixelSearch(30, 30, 1024, 768, 0x68540E)

That will resolve the problem!!!

This post has been edited by BitByteBit: 09 November 2009 - 04:48 AM

0

#12 User is offline   KeithDawn 

  • Newbie
  • Group: Full Members
  • Posts: 7
  • Joined: 06-November 09

Posted 10 November 2009 - 02:11 PM

Thanks for the updates, things seem to be working well.

I've been busy so I've not had much time to try creating the trees program, however seeing how nicely you laid out everything above I did give it a few tries. I think it's going to be harder than I thought, the few times I've tried I keep running into the same problem. Often the color of the fruit (which is what I use to tell it harvest-able tree from non-harvest-able) is either used elsewhere within the game screen or, even more annoying, within the Firefox logo.

When I get some time I'll give it a few more gos and let you know what happens.
0

#13 User is offline   KeithDawn 

  • Newbie
  • Group: Full Members
  • Posts: 7
  • Joined: 06-November 09

Posted Yesterday, 07:02 PM

Three comments Bit:

1 - the source code you posted is out of format. I'm not sure if it's the new code or just the old code messed up.

2 - I like where you put the animals into the program, this new code removed the repeated clicking on the same animal problem. However it has introduced a new problem. About 50% of the time, after clicking animals, I get an array error and the entire program crashes. I'll post more info the next time I get it (I forgot to write it down earlier).

3 - On your website, you should add a comment section or point back to this forum in someway. That way, others can contribute their modification / comments.

Also, I've had no luck with the trees. The colors are used too often within the browser I'm finding. That being said, I've found another program that utilized another pixel color identification method and am trying to test it on trees. If it works, perhaps the two could be combined.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users