A few short footnotes:
This script works on the "PixelGetColor" function. It grabs the pixel color of the specific coordinates on the Portrait (the one that shows your class icon, and level), and then in intervals, compares the pixel vs the snapshot. Naturally, if they do not match, you're in combat, and the script attempts to halt further treasuremap searching, and begins a combat routine.
Setup
First, set up a Kill macro - the macro I use below fires off the first three slots in my Toolbar window; two attacks and a heal.
Code: |
/ui action toolbarSlot00; /pause 1; /ui action toolbarSlot01; /pause 1; /ui action toolbarSlot02; /pause 1; |
Second, go into your Options window, under Keymap, and select "Custom" - scroll down till you see your macro, and assign a key to it (I use , ) - while you're here, go ahead and turn off Confirm Item Delete.
Third, because each character class 'icon' is different, you will need to take a screenshot of the game window "shift-Print Screen", open Paint, and Ctrl-V. You should now see a screenshot of your character screen. Zoom into the Character portrait, and select a pixel that's either white, or grey. Note the coordinates in the bottom-right of the Paint window - you'll need to put this in the script, and will continue to work until you change your windows around.
Finally, run the script, as normal, and select the slot and bag for dumping treasure maps into!
While you're running around, the easiest method to make sure you're not targeting innocent NPCs is to angle your camera all the way down, so that you're looking at your character's baldspot. This will help prevent you from targeting mobs that aren't attacking you. Note that this wont help if you get attacked while you're knee deep in a nest, but it will prevent you from trying to target and attack mobs that are out of your Field of Vew.
Onto the script!
Code: |
Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") Opt("MouseClickDragDelay", 100) #Include ;StarWarsGalaxies Forager Version 2 with Auto Delete 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) ;Sets our coords for PixelChecksum to use as a template - also sets us up to check it in the future $portraitx = 600 $portraity = 694 $CombatCheck = PixelGetColor(($portraitx), ($portraity)) ;Start our loop Do For $x = 1 to $var1 CheckCombatState() 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 CheckCombatState() 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") Until $i = 1 ;Pause Script Func CheckCombatState() If PixelGetColor(($portraitx), ($portraity)) = $CombatCheck Then return Else Do ;Combat Routine send("{TAB}") ;Change this to your hotkey to cycle target outward send("~") ;Change this to your hotkey to Autoattack send(",") ;Change this to your Kill macro Sleep ("1000") ;Change this accordingly to make sure your abilities cycle Until PixelGetColor(($portraitx), ($portraity)) = $CombatCheck EndIf return EndFunc ;Pause Script Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script Paused',0,0) WEnd ToolTip("") EndFunc ;Terminate Script Func Terminate() Exit 0 EndFunc |
Last edited by shinobiss on 01 May 2008 16:05; edited 4 times in total
Hiç yorum yok:
Yorum Gönder