nice script
I made a little modification where you dont have to enter the X and Y coordinates before running the script. the script will simply ask you to left click the main spot there the enzyme/map will pop up after foraging and then asks you to click the backpack.
here it is: (can also add a function to ask you to enter amount of forages to left or right you want to do, if anyone needs that)
Code: Select all
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
Opt("MouseClickDragDelay", 100)
#Include <Misc>
;StarWarsGalaxies Forager Version 2 with Auto Delete
;Sleep("5000")
Sleep("5000")
;Created a /forage macro and mapped it to N
$i = 0
$var1 = "5"; How many times you want to forage Left/Right before going forward
SplashTextOn ( "Setup", "Leftclick on the Main Spot (where foraged item will be)", 400, 100, -1, -1, 1, "Ariel", 14 )
While 1
Sleep ( 100 )
If _IsPressed ( "01" ) Then
$pos = MouseGetPos()
ExitLoop
EndIf
WEnd
SplashOff()
$var3 = $pos[0]
$var4 = $pos[1]
Sleep (1000)
SplashTextOn ( "Setup", "Leftclick on the Backpack", 400, 100, -1, -1, 1, "Ariel", 14 )
While 1
Sleep ( 100 )
If _IsPressed ( "01" ) Then
$pos = MouseGetPos()
ExitLoop
EndIf
WEnd
SplashOff()
$var5 = $pos[0]
$var6 = $pos[1]
Sleep (1000)
Do
If WinActive( "Star Wars Galaxies", "" ) Then
For $x = 1 to $var1
Send("{a down}")
Sleep ("1300")
Send("{a up}") ;
Sleep("500")
Send("{n down}")
Send("{n up}")
Sleep("100")
MouseClick ( "right" , $var3, $var4, 1 )
Sleep("200")
send("{2}")
Sleep("200")
MouseClickDrag ( "left" , $var3, $var4, $var5, $var6, 1)
Sleep ("1200")
Next
send("{d down}")
Send("{w down}")
Sleep ("1200")
Send("{w up}")
Send("{d up}")
Sleep ("50")
For $x = 1 to $var1
Send("{d down}")
Sleep ("1300")
Send("{d up}")
Sleep("500")
Send("{n down}")
Send("{n up}")
Sleep("100")
MouseClick ( "right" , $var3, $var4, 1 )
Sleep("200")
send("{2}")
Sleep("200")
MouseClickDrag ( "left" , $var3, $var4, $var5, $var6, 1)
Sleep ("1200")
Next
Send("{a down}")
Send("{w down}")
Sleep ("1200")
Send("{w up}")
Send("{a up}")
Sleep ("50")
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