Hi all,
First post, but I think is a pretty good one. I've lurked this thread for a while and compiled some of the scripts that people use. I also just added a couple of mine today.
Currently, here's what my script does:
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Key Legend ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; CTRL+SHIFT+TAB displays key legend ;
; CTRL+SHIFT+ESCAPE suspends script ;
; CTRL+SHIFT+` pauses script (key to the left of the '1' key) ;
; CTRL+SHIFT+X halt/reload script ;
; CTRL+SHIFT+0 soybean delete method (zero key) ;
; CTRL+SHIFT+P auto-harvest, auto-plow, auto-seed ;
; CTRL+SHIFT+I auto-harvest 1x1 elements in a nxm grid ;
; CTRL+SHIFT+U auto-sell 1x1 elements in a nxm grid ;
; CTRL+SHIFT+Y semi-auto-plant cherry trees ;
; CTRL+SHIFT+T auto-plant cherry trees in rows going NW to SE ;
; CTRL+SHIFT+R auto-plant cherry trees in rows going SW to NE ;
; Mouse Middle Click does multiple things; comment out what you don't want to do ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Key Legend ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; CTRL+SHIFT+TAB displays key legend ;
; CTRL+SHIFT+ESCAPE suspends script ;
; CTRL+SHIFT+` pauses script (key to the left of the '1' key) ;
; CTRL+SHIFT+X halt/reload script ;
; CTRL+SHIFT+0 soybean delete method (zero key) ;
; CTRL+SHIFT+P auto-harvest, auto-plow, auto-seed ;
; CTRL+SHIFT+I auto-harvest 1x1 elements in a nxm grid ;
; CTRL+SHIFT+U auto-sell 1x1 elements in a nxm grid ;
; CTRL+SHIFT+Y semi-auto-plant cherry trees ;
; CTRL+SHIFT+T auto-plant cherry trees in rows going NW to SE ;
; CTRL+SHIFT+R auto-plant cherry trees in rows going SW to NE ;
; Mouse Middle Click does multiple things; comment out what you don't want to do ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;
; Suspend code ;
;;;;;;;;;;;;;;;;
^+Esc::Suspend
;;;;;;;;;;;;;;
; Pause code ;
;;;;;;;;;;;;;;
^+`::Pause
;;;;;;;;;;;;;
; Stop code ;
;;;;;;;;;;;;;
^+x:: reload
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Code to display a list of commands ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^+Tab::
Msgbox,,FarmVille Script Key Legend,
( Join`r`n
Ctrl + Shift + Tab`t`tDisplays Key Legend
Ctrl + Shift + Esc`t`tSuspends script
Ctrl + Shift + ```t`tPauses script (key to the left of the '1' key)
Ctrl + Shift + X`t`tHalts/reloads script
Ctrl + Shift + 0`t`tSoybean delete method (zero key)
Ctrl + Shift + P`t`tAuto-harvest, auto-plow, auto-seed
Ctrl + Shift + I`t`tAuto-harvest 1x1 elements in a nxm grid
Ctrl + Shift + U`t`tAuto-sell 1x1 elements in a nxm grid
Ctrl + Shift + Y`t`tSemi-auto-plant cherry trees
Ctrl + Shift + T`t`tAuto-plant cherry trees in rows going NW to SE
Ctrl + Shift + R`t`tAuto-plant cherry trees in rows going SW to NE
Mouse Middle Click`t`tDoes multiple things based on script comments
)
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Farmville Single-click Animal and Tree Harvester ;
; Click the middle mouse button to harvest an animal or tree. ;
; Script by freeforlife. ;
; Mouse code follows, uncomment for what you'd like ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;
; Middle-click harvest ;
;;;;;;;;;;;;;;;;;;;;;;;;
MButton::
Click
MouseGetPos, xposi, yposi
yposi+=45
xposi+=10
Click %xposi%, %yposi%
xposi-=10
yposi-=45
MouseMove, %xposi%, %yposi%
return
;;;;;;;;;;;;;;;;;;;;;;;
; Middle-click delete ;
;;;;;;;;;;;;;;;;;;;;;;;
/*
MButton::
Click
MouseGetPos, xposi, yposi
yposi+=30
xposi+=10
Click %xposi%, %yposi%
xposi-=10
yposi-=30
MouseMove, %xposi%, %yposi%
return
*/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Middle-click buy cherry tree ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/*
MButton::
MouseGetPos, xposi, yposi
Click xposi, yposi
yposi-=440
xposi-=537
sleep 1200
Click %xposi%, %yposi%
xposi+=28
yposi+=432
sleep 800
Click %xposi%, %yposi%
xposi+=509
yposi+=8
sleep 4000
MouseMove, %xposi%, %yposi%
return
*/
;;;;;;;;;;;;;;;;;;;;;;;
; Soybean Delete code ;
;;;;;;;;;;;;;;;;;;;;;;;
^+0::
msgbox, FARMER MUST BE OUT OF THE WAY!!!
gosub Market
gosub Buysoybean
gosub getlocationplot
sleep 1000
click %asoX%, %asoY%
sleep 1000
click %mezoX%, %mezoY%
sleep 1000
gosub accept
msgbox, The script will run until you stop it with control+x. The script written by Szilveszter
inputbox,xp,xp,xp,,100,150
gosub mainLOOP
msgbox, %xp%*3 xp-t termelt a script
return
Market:
msgbox, click on the Market icon on your farm screen (midle of the icon)
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, shopX, ShopY
sleep 100
powlX:=shopX
powlY:=shopY-55
powltoolY:=powlY-70
multiX:=powlX-46
multiY:=powlY
asoX:=powlX+45
asoY:=powlY
return
Buysoybean:
msgbox,click on Middle of the soybeans buy icon.
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, soybeX, soybeY
sleep 200
return
getlocationplot:
msgbox, click on the bottom corner of the farm plot you want to use and wait.
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, mezoX, mezoY
sleep 100
return
accept:
msgbox click on the big ACCEPT button.
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, asoOKX, AsoOKY
sleep 200
return
mainLoop:
Loop %xp%
{
click %powlX%, %PowlY%
sleep 500
click %powlx%, %powltoolY%
sleep 500
click %mezoX%, %mezoY%
sleep 500
click %shopX%, %shopY%
sleep 1500
click %soybeX%, %soyBEY%
sleep 200
click %mezoX%, %mezoY%
sleep 500
click %asoX%, %asoY%
sleep 500
click %mezoX% , %mezoY%
sleep 750
click %asoOKX%, %asoOKY%
}
return
;;;;;;;;;;;;;;;;;;
; Auto-plow code ;
;;;;;;;;;;;;;;;;;;
^+p::
msgbox, FARMER MUST BE OUT OF THE WAY!!!
GoSub GetFarmSq
GoSub Getfirstsq
i=1
Loop, %farmy%
{
Click %startx%,%starty%
newx=%startx%
newy=%starty%
Loop, %farmx%
{
newx+=25
newy-=12
Click %newx%,%newy%
Random, rand, 200, 400
sleep rand
i++
}
startx+=25
starty+=12
Random, rand, 200, 300
sleep rand
}
return
GoSub Getfirstsq
GetFarmsq:
Inputbox, farmx, Farm Length, Enter Farm Length e.g. 20, ,100,150
Inputbox, farmy, Farm Width, Enter Farm Width e.g. 20, ,100,150
msgbox, Farm size is as follows: %farmx% x %farmy%
farmx--
return
Getfirstsq:
Msgbox, Click the middle of the top left square of Farm.
KeyWait, LButton, D
KeyWait, LButton, D
MouseGetPos, startx, starty
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Auto-harvest 1x1 elements in a 1x1 grid ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^+I::
msgbox, FARMER MUST BE OUT OF THE WAY!!!`r`nFARM MUST BE ZOOMED OUT!!!`r`nIt is recommended to only do a row or column of width 1. If you follow this recommendation,
one of the following prompts should be set to '1'.
GoSub GetFarmSq2
GoSub Getfirstsq2
i=1
Loop, %farmy%
{
Click %startx%,%starty%
MouseGetPos, xposi, yposi
yposi+=45
xposi+=10
Click %xposi%, %yposi%
xposi-=10
yposi-=45
MouseMove, %xposi%, %yposi%
newx=%startx%
newy=%starty%
Loop, %farmx%
{
newx+=6.25
newy-=3
Click %newx%,%newy%
MouseGetPos, xposi, yposi
yposi+=45
xposi+=10
Click %xposi%, %yposi%
xposi-=10
yposi-=45
MouseMove, %xposi%, %yposi%
Random, rand, 200, 400
sleep rand
i++
}
startx+=6.25
starty+=3
Random, rand, 200, 300
sleep rand
}
return
GoSub Getfirstsq2
GetFarmsq2:
Inputbox, farmx, Grid Length, Enter Grid Length (number of elements going SW to NE)
Inputbox, farmy, Grid Width, Enter Grid Width (number of elements going NW to SE)
msgbox, Farm size is as follows: %farmx% x %farmy%
farmx--
return
Getfirstsq2:
Msgbox, Click the cherry of the top left tree.
KeyWait, LButton, D
KeyWait, LButton, D
MouseGetPos, startx, starty
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Auto-sell 1x1 elements in a nxm grid ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This script auto-sells a nxm grid. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^+U::
msgbox, FARMER MUST BE OUT OF THE WAY!!!`r`nFARM MUST BE ZOOMED OUT!!!`r`nIt is recommended to only do a row or column of width 1. If you follow this recommendation,
one of the following prompts should be set to '1'.
GoSub GetFarmSqAutosell1
GoSub GetfirstsqAutosell1
i=1
Loop, %farmy%
{
Click %startx%,%starty%
MouseGetPos, xposi, yposi
yposi+=30
xposi+=10
Click %xposi%, %yposi%
xposi-=10
yposi-=30
sleep 600
Click %acceptX%, %acceptY%
sleep 600
MouseMove, %xposi%, %yposi%
newx=%startx%
newy=%starty%
Loop, %farmx%
{
newx+=6.25
newy-=3
Click %newx%,%newy%
MouseGetPos, xposi, yposi
yposi+=30
xposi+=10
Click %xposi%, %yposi%
xposi-=10
yposi-=30
sleep 600
Click %acceptX%, %acceptY%
sleep 600
MouseMove, %xposi%, %yposi%
i++
}
startx+=6.25
starty+=3
;sleep 200
}
return
GoSub GetfirstsqAutosell1
GetFarmsqAutosell1:
Inputbox, farmx, Grid Length, Enter Grid Length (number of elements going SW to NE)
Inputbox, farmy, Grid Width, Enter Grid Width (number of elements going NW to SE)
Msgbox, Farm size is as follows: %farmx% x %farmy%
farmx--
return
GetfirstsqAutosell1:
Msgbox, Click the cherry of the top left tree.
KeyWait, LButton, D
KeyWait, LButton, D
MouseGetPos, startx, starty
xposi:=startx
yposi:=starty
Click %xposi%, %yposi%
yposi+=30
xposi+=10
Click %xposi%, %yposi%
xposi-=10
yposi-=30
MouseMove, %xposi%, %yposi%
msgbox, click on the 'Cancel' icon. We are not selling the tree; the script auto-calculates where the 'Accept' icon is.
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, acceptX, acceptY
acceptX-=130
sleep 800
;startx+=6.25
;starty+=3
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Semi-auto-plant cherry tree ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; With this method, the script ;
; will auto-click for you, but ;
; you will need to plant the ;
; tree once it's been selected ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^+Y::
Msgbox, This script will run for the number of trees you ask for. It is important to remain alert. The script will automatically select the tree, but YOU have to
plant it. You have a few seconds to do it while the script sleeps.
Msgbox, Click the center of the Market Icon.
KeyWait, LButton, D
KeyWait, LButton, D
MouseGetPos, xposi, yposi
Msgbox, Close the market.
KeyWait, LButton, D
KeyWait, LButton, D
Inputbox, looplength, Loop Length, Enter number of trees you want to plant in this loop.
i=1
Loop, %looplength%
{
Click xposi, yposi
yposi-=440
xposi-=537
sleep 1200
Click %xposi%, %yposi%
xposi+=28
yposi+=432
sleep 800
Click %xposi%, %yposi%
xposi+=509
yposi+=8
MouseMove, %plantposx%, %plantposY%
KeyWait, LButton, D
MousegetPos, plantposX, plantposY
sleep 200
MouseMove, %xposi%, %yposi%
i++
}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Auto-plant cherry tree NW to SE ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; With this method, the script will auto ;
; click for you, but you will need to ;
; plant the first tree only ;
; THIS METHOD ONLY WORKS FOR ONE ROW!!!! ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^+T::
Msgbox, Farm must be zoomed out. This script will run for the number of trees you ask for, but will only do one row. This row is for the top right of your farm, or
for rows going from NW to SE. You MUST plant the first tree. When planting it, click the lower corner of it when possible.
Msgbox, Click the center of the Market Icon.
KeyWait, LButton, D
KeyWait, LButton, D
MouseGetPos, xposi, yposi
Msgbox, Close the market.
KeyWait, LButton, D
KeyWait, LButton, D
Inputbox, looplength, Loop Length, Enter number of trees you want to plant in this row.
;KeyWait, LButton, D
Click %xposi%, %yposi%
yposi-=440
xposi-=537
sleep 1200
Click %xposi%, %yposi%
xposi+=28
yposi+=432
sleep 800
Click %xposi%, %yposi%
xposi+=509
yposi+=8
Msgbox, Plant your tree now.
KeyWait, LButton, D
KeyWait, LButton, D
MousegetPos, plantposX, plantposY
sleep 200
MouseMove, %xposi%, %yposi%
i=2
Loop, %looplength%
{
Click xposi, yposi
yposi-=440
xposi-=537
sleep 1200
Click %xposi%, %yposi%
xposi+=28
yposi+=432
sleep 800
Click %xposi%, %yposi%
xposi+=509
yposi+=8
plantposX+=6.25
plantposY+=3
sleep 600
Click %plantposX%, %plantposY%
sleep 100
MouseMove, %xposi%, %yposi%
i++
}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Auto-plant cherry tree SW to NE ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; With this method, the script will auto ;
; click for you, but you will need to ;
; plant the first tree only ;
; THIS METHOD ONLY WORKS FOR ONE ROW!!!! ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^+R::
Msgbox, Farm must be zoomed out. This script will run for the number of trees you ask for, but will only do one row. This row is for the top left of your farm, or for
rows going from SW to NE. You MUST plant the first tree. When planting it, click the lower corner of it when possible.
Msgbox, Click the center of the Market Icon.
KeyWait, LButton, D
KeyWait, LButton, D
MouseGetPos, xposi, yposi
Msgbox, Close the market.
KeyWait, LButton, D
KeyWait, LButton, D
Inputbox, looplength, Loop Length, Enter number of trees you want to plant in this row.
;KeyWait, LButton, D
Click %xposi%, %yposi%
yposi-=440
xposi-=537
sleep 1200
Click %xposi%, %yposi%
xposi+=28
yposi+=432
sleep 800
Click %xposi%, %yposi%
xposi+=509
yposi+=8
Msgbox, Plant your tree now.
KeyWait, LButton, D
KeyWait, LButton, D
MousegetPos, plantposX, plantposY
sleep 200
MouseMove, %xposi%, %yposi%
i=2
Loop, %looplength%
{
Click xposi, yposi
yposi-=440
xposi-=537
sleep 1200
Click %xposi%, %yposi%
xposi+=28
yposi+=432
sleep 800
Click %xposi%, %yposi%
xposi+=509
yposi+=8
plantposX+=6.25
plantposY-=3
sleep 600
Click %plantposX%, %plantposY%
sleep 100
MouseMove, %xposi%, %yposi%
i++
}
return