SWG Macros - Script for emptying inventory while AFK looting
Posted: October 2nd, 2007, 6:09 am
Here is a script I wrote in AutoIt v3 for emptying your inventory while looting junk loot for RE purposes. Get your stacks up high without having to keep checking and emptying your inventory. Here is the script:
The first line closes the examine window that will be opened by the script. More on this later.
The next part selects the item that you want deleted (your inventory window must be left open for this to work). This should be the item in your inventory located right after what you want to keep (your stacks of junk loot for example). The script will select the item, choose delete and then confirm the delete. This works with weapons, clothing, jewelry items, etc. as the delete option will always be in the same location (option #3).
The only hitch is when you loot items like paintings and such. The delete option on these items is located at #2 on your radial menu. That is why I added the second part of the script. It will select the item (same location as above) but this time choose #2 to delete it. If the item is not a painting or similar item, then this will open the examine window, which is why the first line of the script closes it (otherwise you would have tons of examine windows open after a while).
This script will loop over and over again while you run your loot macro and keep your inventory open to stack your junk loot AFK. Of course you will need to enter the proper coordinates (X and Y) into the script based on how you have your window set up. There is a built in tool in AutoIt v. 3 that will help you with that...
After further testing, i discovered that another set of parameters had to be added to deal with looted backpacks as they would break the cycle because their destroy radial command is at position #4. Simply adding another round of commands at the beginning of the script with the appropriate X and Y coordinates solved the problem. This is the section in red above.
Not sure if something like this has been posted before, but if not, i hope to get a premium membership...
Looking forward to feedback.[/b]
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.2.8.1
Author:
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
Global $Paused
HotKeySet("{ESC}", "Terminate")
Opt("MouseClickDragDelay", 100)
Sleep (5000)
While 1
;select item to be deleted:
MouseClick ( "left" , 376, 87, 1 ) ;close examine window - see below for explanation
Sleep (500)
MouseClick ( "right" , 831, 538, 1 ) ;Enter X and Y coordinates of item to be deleted, this section is for looted backpacks
Sleep (500)
MouseClick ( "right" , 957, 541, 1 ) ;delete item
Sleep (500)
MouseClick ( "left" , 631, 461, 1 ) ;confirm delete
Sleep (500)MouseClick ( "right" , 831, 538, 1 ) ;Enter X and Y coordinates of item to be deleted
Sleep (500)
MouseClick ( "right" , 957, 541, 1 ) ;delete item
Sleep (500)
MouseClick ( "left" , 631, 461, 1 ) ;confirm delete
Sleep (500)
MouseClick ( "right" , 831, 538, 1 ) ;Enter X and Y coordinates of item - this line is specifically for looted pictures and such
Sleep (500)
MouseClick ( "right" , 923, 481, 1 ) ;delete item - *if the item is a picture, it will be deleted, if not it will open the examine window
Sleep (500)
MouseClick ( "left" , 631, 461, 1 ) ;confirm delete
Sleep (500)
Sleep (1000)
WEnd
Func Terminate()
Exit 0
EndFunc
The first line closes the examine window that will be opened by the script. More on this later.
The next part selects the item that you want deleted (your inventory window must be left open for this to work). This should be the item in your inventory located right after what you want to keep (your stacks of junk loot for example). The script will select the item, choose delete and then confirm the delete. This works with weapons, clothing, jewelry items, etc. as the delete option will always be in the same location (option #3).
The only hitch is when you loot items like paintings and such. The delete option on these items is located at #2 on your radial menu. That is why I added the second part of the script. It will select the item (same location as above) but this time choose #2 to delete it. If the item is not a painting or similar item, then this will open the examine window, which is why the first line of the script closes it (otherwise you would have tons of examine windows open after a while).
This script will loop over and over again while you run your loot macro and keep your inventory open to stack your junk loot AFK. Of course you will need to enter the proper coordinates (X and Y) into the script based on how you have your window set up. There is a built in tool in AutoIt v. 3 that will help you with that...
After further testing, i discovered that another set of parameters had to be added to deal with looted backpacks as they would break the cycle because their destroy radial command is at position #4. Simply adding another round of commands at the beginning of the script with the appropriate X and Y coordinates solved the problem. This is the section in red above.
Not sure if something like this has been posted before, but if not, i hope to get a premium membership...
Looking forward to feedback.[/b]