 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
lavier Guest
|
Posted: Mon Sep 07, 2009 11:22 am Post subject: |
|
|
Script work perfectly. Thanks you qwerty  |
|
| Back to top |
|
 |
qwerty
Joined: 05 Sep 2009 Posts: 12 Location: Houston
|
Posted: Mon Sep 07, 2009 3:57 pm Post subject: |
|
|
| lavier wrote: | Script work perfectly. Thanks you qwerty  |
NP thanks for the reply! |
|
| Back to top |
|
 |
Szilveszter Guest
|
Posted: Mon Sep 07, 2009 6:47 pm Post subject: Translated Soybean |
|
|
Hi all!
I have translated soybean script:
control+0 start
control+b reload
control+n pause
I modified wait times to connection error with fb, you can modify if you have no problem with it, but i tried the fastest version no wait time on shop etc, but in 5 minutes got connection error btw if you use the total zoom and the center field script will continue, after reconnection. Next step level up, because script do nothoing after a level up (new okay button on down nd wall post, so i need to know the xps at level ups 10 11, 12 etc levels,) can you help me?
| Code: |
^0::
msgbox, This script alchemy transmute money to xp 10/1 ration, only you can need a powled field before you click on ok, please make a field which only powled and follow the instructions, initalization take 1 minute all the time when you want to run the script.
gosub getlocationshop
msgbox, shopinit completed go to soybean init
gosub getzoldbabloc
msgbox, zoldbab (zoldbab=soybean) init completed next step field init
gosub getlocationMezo
msgbox, field init completed go through destroying sub, (wait until next popup box!)
sleep 10000
click %asoX%, %asoY%
sleep 1000
click %mezoX%, %mezoY%
sleep 1200
gosub getasook
msgbox, If you want you can stop script with control+x if u won't script will run count of your input number
inputbox,xp,xp,xp,,100,150
msgbox, evrything fine?
gosub mainLOOP
msgbox, %xp%*3 xp-t termelt a script
return
;initalizásciós subok:
;a kezdomezo meghatározására szolgál
getlocationMezo:
msgbox, click on the field which should be the base of the xp generation! (xp ratio 10gold/1xp) Pleaseclick on the bottom corner of the field
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, mezoX, mezoY
sleep 100
return
;a shop helyének meghatározására szolgál a farmképernyon
getlocationShop:
msgbox, clikk on the shop icon at your farm screen (midle of the icon)
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, shopX, ShopY
sleep 100
;az aso es a plow icon meghatarozasa a shop kodrdinataibol 843,595 shop 845,540 powl 891,540 aso
powlX:=shopX
powlY:=shopY-55
powltoolY:=powlY-70
;eszközválasztás az -70 Y
multiX:=powlX-46
multiY:=powlY
asoX:=powlX+45
asoY:=powlY
return
getzoldbabloc:
msgbox,click on soybeans icon (midle of the icon, twice if not affect the menu to close)
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, soybeX, soybeY
sleep 100
return
getasook:
msgbox click on green accept button when appears!
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, asoOKX, AsoOKY
return
mainLoop:
Loop %xp%
{
click %powlX%, %PowlY%
sleep 100
click %powlx%, %powltoolY%
sleep 100
click %mezoX%, %mezoY%
sleep 500
click %shopX%, %shopY%
sleep 5500
click %soybeX%, %soyBEY%
sleep 1000
click %mezoX%, %mezoY%
sleep 500
click %asoX%, %asoY%
sleep 500
click %mezoX% , %mezoY%
sleep 3000
click %asoOKX%, %asoOKY%
}
return
^b:: reload
^n:: pause
|
|
|
| Back to top |
|
 |
qwerty
Joined: 05 Sep 2009 Posts: 12 Location: Houston
|
Posted: Mon Sep 07, 2009 7:12 pm Post subject: Re: Translated Soybean |
|
|
| Szilveszter wrote: | Hi all!
I have translated soybean script:
control+0 start
control+b reload
control+n pause
I modified wait times to connection error with fb, you can modify if you have no problem with it, but i tried the fastest version no wait time on shop etc, but in 5 minutes got connection error btw if you use the total zoom and the center field script will continue, after reconnection. Next step level up, because script do nothoing after a level up (new okay button on down nd wall post, so i need to know the xps at level ups 10 11, 12 etc levels,) can you help me?
| Code: |
^0::
msgbox, This script alchemy transmute money to xp 10/1 ration, only you can need a powled field before you click on ok, please make a field which only powled and follow the instructions, initalization take 1 minute all the time when you want to run the script.
gosub getlocationshop
msgbox, shopinit completed go to soybean init
gosub getzoldbabloc
msgbox, zoldbab (zoldbab=soybean) init completed next step field init
gosub getlocationMezo
msgbox, field init completed go through destroying sub, (wait until next popup box!)
sleep 10000
click %asoX%, %asoY%
sleep 1000
click %mezoX%, %mezoY%
sleep 1200
gosub getasook
msgbox, If you want you can stop script with control+x if u won't script will run count of your input number
inputbox,xp,xp,xp,,100,150
msgbox, evrything fine?
gosub mainLOOP
msgbox, %xp%*3 xp-t termelt a script
return
;initalizásciós subok:
;a kezdomezo meghatározására szolgál
getlocationMezo:
msgbox, click on the field which should be the base of the xp generation! (xp ratio 10gold/1xp) Pleaseclick on the bottom corner of the field
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, mezoX, mezoY
sleep 100
return
;a shop helyének meghatározására szolgál a farmképernyon
getlocationShop:
msgbox, clikk on the shop icon at your farm screen (midle of the icon)
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, shopX, ShopY
sleep 100
;az aso es a plow icon meghatarozasa a shop kodrdinataibol 843,595 shop 845,540 powl 891,540 aso
powlX:=shopX
powlY:=shopY-55
powltoolY:=powlY-70
;eszközválasztás az -70 Y
multiX:=powlX-46
multiY:=powlY
asoX:=powlX+45
asoY:=powlY
return
getzoldbabloc:
msgbox,click on soybeans icon (midle of the icon, twice if not affect the menu to close)
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, soybeX, soybeY
sleep 100
return
getasook:
msgbox click on green accept button when appears!
KeyWait, LButton, D
KeyWait, LButton, D
mousegetpos, asoOKX, AsoOKY
return
mainLoop:
Loop %xp%
{
click %powlX%, %PowlY%
sleep 100
click %powlx%, %powltoolY%
sleep 100
click %mezoX%, %mezoY%
sleep 500
click %shopX%, %shopY%
sleep 5500
click %soybeX%, %soyBEY%
sleep 1000
click %mezoX%, %mezoY%
sleep 500
click %asoX%, %asoY%
sleep 500
click %mezoX% , %mezoY%
sleep 3000
click %asoOKX%, %asoOKY%
}
return
^b:: reload
^n:: pause
|
|
I think this link will give you what you need:
http://spreadsheets.google.com/pub?key=rrFQP5AOGa4yUZCL-1VLUyg&gid=7 |
|
| Back to top |
|
 |
Szilveszter Guest
|
Posted: Mon Sep 07, 2009 7:39 pm Post subject: thx qwuerty |
|
|
Next version on next sinday, so I think I dont want to use facebook settings, so if you want to use script long, simple turn off, the application can post to the profile setting, and i will write the script to click on the ok at the new level op, and ifu disable posting thats theonly one thing what is needed:). The page is good qwerty that's what I wanted:D
THX |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Sep 12, 2009 7:04 pm Post subject: FireFox on Linux ?? |
|
|
Hi there
What about FireFox, and on Linux, how can i do the trick there ?
Best regards
Carsten, Denmark |
|
| Back to top |
|
 |
qwerty
Joined: 05 Sep 2009 Posts: 12 Location: Houston
|
Posted: Sun Sep 13, 2009 12:16 am Post subject: Re: FireFox on Linux ?? |
|
|
| Anonymous wrote: | Hi there
What about FireFox, and on Linux, how can i do the trick there ?
Best regards
Carsten, Denmark |
I use this stuff with firefox with no problems. I do not know how it would work with linux. |
|
| Back to top |
|
 |
Antony Guest
|
Posted: Sun Sep 13, 2009 10:07 am Post subject: |
|
|
| What about running soybean method in the background? So you can do other things with your computer. |
|
| Back to top |
|
 |
Tuxhedoh
Joined: 20 Apr 2006 Posts: 25 Location: Baltimore, MD
|
Posted: Sun Sep 13, 2009 8:38 pm Post subject: |
|
|
| Antony wrote: | | What about running soybean method in the background? So you can do other things with your computer. |
I'm not sure that can be done, as it's a flash game, and afaik, the only way to send commands to nonactive windows is through controlsend, and the flash windows aren't controllable this way.
And then again, I could be wrong. |
|
| Back to top |
|
 |
Fred Guest
|
Posted: Wed Sep 16, 2009 3:00 pm Post subject: |
|
|
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% |
|
|
| Back to top |
|
 |
DeadBambi Guest
|
Posted: Thu Sep 17, 2009 6:14 am Post subject: |
|
|
first of all, I got my farmer dude trapped in the default starting position so I dont have to trap him every time I log into FV
and what I am looking for is a script that will skip the middle square where the dude is trapped and automatically plow, plant strawberries, sleep 4 hours, harvest then repeat the process over and over again till I stop it
I figure I can let that run while Im sleeping and at work and maybe I will be able to catch up to my wife LOL one of my computers is on 24/7 anyways so I figured let it run for a few days and see what happens
can anyone help with this please? |
|
| Back to top |
|
 |
Foxtrot
Joined: 05 Aug 2008 Posts: 17
|
Posted: Thu Sep 17, 2009 12:58 pm Post subject: |
|
|
Guys, how the last script works please.
When I have to harvest for example, and than to plow.
When I do CTRL-ALT-P I got a box that I have to fill (I understand that) but next what I have to do?
It says press the midle of your top left square ? (the middle buton or the middle of my square) ?
Thanks. |
|
| Back to top |
|
 |
snagswolf
Joined: 17 Sep 2009 Posts: 5
|
Posted: Thu Sep 17, 2009 2:18 pm Post subject: |
|
|
These scripts are working great. Thanks to everyone for posting them.
One question though. My farm is currently 18x18, so it doesn't entirely fit on the visible window. If I enter 18x18 at the input prompt, it tries to click off the side of the window, and screws things up.
To get around this, I do the grid in two sections, the first one 18x13, and then move the field, and then do a grid that is 18x5.
Is this the only way around this, or am I missing something obvious?
Thanks. |
|
| Back to top |
|
 |
snagswolf
Joined: 17 Sep 2009 Posts: 5
|
Posted: Thu Sep 17, 2009 2:28 pm Post subject: |
|
|
| Foxtrot wrote: | It says press the midle of your top left square ? (the middle buton or the middle of my square) ?
Thanks. |
I found it a little confusing the first time also.
First of all, your field has to be already laid out in a grid. If it's just green grass, these scripts won't work. Lay out the grid by hand the first time, and use the scripts after the grid is set.
"The middle of the top left square" means the leftmost square in your grid. Think of your grid as a diamond shape, with points at the top and bottom and left and right. The 'top left square' would be the square sitting in the left point of the diamond.
And the instructions tell you to click in the middle of that square because it calculates the rest of the squares off of that position, and if the calculations are off by a little bit, by the time it gets to the furthest square away, it could be enough pixels off to miss the square entirely. So clicking on the middle (exact center) of the first square gives you the best chance of hitting that last square correctly. |
|
| Back to top |
|
 |
snagswolf
Joined: 17 Sep 2009 Posts: 5
|
Posted: Thu Sep 17, 2009 2:37 pm Post subject: |
|
|
I'm having another minor problem that someone might know the answer to. I'm new to AutoHotKey, so I'm not sure if this is common or not.
Most of the time, when AutoHotKey pops up a message box, it's shown above the current window, so it's visible. But some of the time (about 20%) it gets placed below the current window, so it can't be seen. I have to drag the current window to the side in order to see it.
It seems to be randomly happening, and not always with the same popup. (I'm using the grid script posted here.) Could it have something to do with the fact that Farmville is a Flash app?
One more question:
Sometimes I run the grid script, and after confirming the last message, I realize I forgot to zoom Farmville out to the maximum. So I'm kinda stuck, with my next mouseclick set to fire off a multitude of mouseclicks. I usually just click on the farm grid anyway, and it does some of the squares. But is there any way to stop the script from executing at that point?
Thanks again. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|