I really liked the AutoIt programs for auto fishing and auto foraging by Collin8579 but I was having some problems with the auto foraging program so I modified it a bit. I also included in the modified version something I liked from the auto fishing version... the ability to click on the spaces to set the points needed for moving things around in the inventory.
You set it up exactly like Collin8579 describes in his post. But there are a couple of things that are different in the setup.
Under "keymap" in options you need to disable strafing (make sure there is a check in the box). This will allow your character to change directions instead of just strafing to the left or right.
You need to make sure that you are not zoomed out. You need to be in first person view. If you can see your character then when it comes time to turn (part of the pattern I have made in the program) your charcter will just spin really fast instead.
Some other notes:
Make sure you have a forage macro that is not looped and is put in the number 2 slot of your toolbar. If your forage program is looped then you will end up running thousands of forage macros. You will forage 2 times per loop since a "2" will be hit once at the start of the macro and will be hit again when the macro attempts to delete the enzymes. (This is a change I made from the original)Make sure that the 3 kinds of fish bait are up in your inventory somewhere. It doesn't matter where your bait is in the inventory as long as you have an empty bag in your last slot. This setup will allow you to collect the baits and not have them destroyed like the enzymes.
Make sure you "examine" something in your inventory and move that screen to a corner away from your inventory window. Do not close that window. This will prevent the examine window from popping up over the inventory window which would disrupt the program.
How is this different from the other versions?
First, it will prompt you for 2 inventory positions. So make sure you have your inventory window open when you start the program. It will ask you first to click on the bag where the items will go and then it will ask you to click on the space where foraged materials pop up (the first empty space in your inventory). It will run once you have clicked on those two locations. You do not have to set coordinates in the program since this portion does it for you. (This is something that collin8579 has in the fishing macro that I just simply moved to the forage program).
Second, this macro causes the toon to move in a straight line but causes you to turn slightly ever so often so essentially you are running in big circles. I found this to be a better pattern since the pattern in the other version was causing me to go over ground I had recently foraged making it so that I was losing foraging time. You can set within the program how many times you want the character to go forward before you turn.
NOTE: For some reason the 5th line in the code only says <Misc> when it should have an ".au3" at the end of "Misc" so add the ".au3" to the end of that before you compile because it will show an error otherwise.
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
Opt("MouseClickDragDelay", 100)
#include <Misc>
;Modified from StarWarsGalaxies Fishing Macro With Auto Filet written by collin
Sleep(5000)
SplashTextOn("Auto Foraging Setup", "Please Click on the backpack you want to put items in", 400, 100, -1, -1, 1, "Ariel", 15)
While 1
Sleep ( 100 )
If _IsPressed("01") Then
$pos = MouseGetPos()
ExitLoop
EndIf
WEnd
SplashOff()
$bag1x = $pos[0]
$bag1y = $pos[1]
Sleep ( 1000 )
SplashTextOn("Auto Foraging Setup", "Please Click on the CENTER of the Empty Space where the Item will show up", 400, 100, -1, -1, 1, "Ariel", 15)
While 1
Sleep ( 100 )
If _IsPressed("01") Then
$pos = MouseGetPos()
ExitLoop
EndIf
WEnd
SplashOff()
$empty1x = $pos[0]
$empty1y = $pos[1]
Sleep ( 1000 )
$i = 0
$var1 = "20"; How many times you want to forage forward before turning to the left slightly
Do
If WinActive( "Star Wars Galaxies", "" ) Then
For $x = 1 to $var1
Send("{2}")
Send("{w down}")
Sleep (2000)
Send("{w up}")
Sleep(3000)
MouseClick ( "right" , $empty1x, $empty1y, 1 )
Sleep(500)
send("{2}")
Sleep(400)
MouseClickDrag ( "left" , $empty1x, $empty1y, $bag1x, $bag1y, 1)
Sleep (1000)
Next
send("{a down}")
Sleep (500)
Send("{a up}")
Sleep (500)
EndIf
Until $i = 1
Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc
Func Terminate()
Exit 0
EndFunc
Enjoy!
Edit Note: I changed the program since i originally posted it. I have taken out the 'n' key for foraging. All you need to do is put your forage macro in your #2 slot of the toolbar and it will be fired off when the program attempts to delete the enzyme.