First, thanks for all this code ! Everything works great for me...
Here is a stiched together version of 3 scripts :
- Auto Harvest-Plow-Seed : CTRL-ALT-P
- One Clic Harvest on Animals and Trees : Mouse Middle Clic
- Soybean method : CTRL-ALT-0
- CANCEL : CTRL-ALT-X
Code:
;CTRL-ALT 0 to start
;CTRL-ALT X to stop
;CTRL-ALT P to auto-plow auto-seed
;Mouse Middle clic to do a one-clic harvest on trees/animals
!^0::
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
!^x:: reload
!^p::
GoSub GetFarmSq
GoSub Getfirstsq
looptimes := farmy // 2
checkmod := mod(farmy,2)
newx := startx + 25
newy := starty - 12
oldx := startx - 25
oldy := starty + 12
nextx := startx + 25
nexty := starty + 12
if (farmy = 1)
goto singleLine
else if (farmy > 1)
goto multiLine
multiLine:
Loop, %looptimes%
{
Click %startx%,%starty%
Loop, %farmx%
{
Click %newx%,%newy%
MouseClickDrag, L, newx, newy, startx, starty
Sleep 50
}
Click %nextx%,%nexty%
MouseClickDrag, L, nextx, nexty, startx, starty
Sleep 50
Loop, %farmx%
{
Click %oldx%,%oldy%
MouseClickDrag, L, oldx, oldy, startx, starty
Sleep 50
}
Click %nextx% %nexty%
MouseClickDrag, L, nextx, nexty, startx, starty
Sleep 50
}
;if (checkmod = 0)
;msgbox, Done
if (checkmod = 1)
{
Loop, %farmx%
{
Click %newx%,%newy%
MouseClickDrag, L, newx, newy, startx, starty
Sleep 50
}
;msgbox, Done
}
return
singleLine:
Click %startx%,%starty%
Loop, %farmx%
{
Click %newx%,%newy%
MouseClickDrag, L, newx, newy, startx, starty
Sleep 50
}
;msgbox, Done
return
GoSub Getfirstsq
GetFarmsq:
Inputbox, farmx, Hey There, Number of squares in your top row, ,100,150
Inputbox, farmy, Hey There, Number of squares in long, ,100,150
;msgbox, you said your farm was %farmx% x %farmy%
farmx--
return
Getfirstsq:
Msgbox, Click the middle of the top left square
KeyWait, LButton, D
KeyWait, LButton, D
MouseGetPos, startx, starty
return
;Farmville Single-click Animal and Tree Harvester
;Click the middle mouse button to harvest an animal or tree.
;Script by freeforlife.
MButton::
Click
MouseGetPos, xposi, yposi
yposi+=45
xposi+=10
Click %xposi%, %yposi%
xposi-=10
yposi-=45
MouseMove, %xposi%, %yposi%