Xian55 / WowClassicGrindBot

Highly configurable and responsive World of Warcraft Classic pixel Grind Bot - No DLL injection or memory tampering, just screen capture and input simulation.
161 stars 114 forks source link

Mailing to a banker #531

Open tidusete opened 11 months ago

tidusete commented 11 months ago

Is your feature request related to a problem? Please describe. I always get frustrated when I'm afk leveling and I see my bag full of BoEs (green,blue, purple) items, although I sold all the grey items to the vendor + i have repaired my armor

Describe the solution you'd like Could we implement some kind of functionality that basically every time that you are full, your toon basically would go to the vendor in order to sell grey items + repair amor + send a mail to a banker toon (you will define his name on the configuration/profile).

Describe alternatives you've considered A more deep configuration related to which items sent (Filters on colors)

Xian55 commented 11 months ago

Hey,

not so long ago - i can't recall during which expansion got introduced maybe Legion or BFA - the in-game Mailbox lua API got restricted due of massive amount of malicious 3rd party Addons and WeakAura Profiles. Which means only very basic info can be extracted by the DataToColor addon.

To locate the Mailbox GameObject on the screen, with a naive approach, scanning the whole screen area until the cursor changes should be no problem. Unless the view is obstructed.

/fstack command can be used to find the desired UI element name.

While the InboxFrame is open, with the following command, pasted into the chat /click MailFrameTab2 which equivalent of clicking the Send Mail button at the bottom, the SendMailFrame tab can be activated.

Filling the To: / Recipient section should be no problem as the the input already selected, the caret already blinking there. Even Non-ASCII names should work as well.

Then, I was unable to open up the chat input by pressing Enter. Which means, i was unable to Copy & Paste -> Execute lua commands. That means, it brings a lot of complexity to select which item should be attached in the mail.

After thinking about it, one solution would be to select the item via the mouse which right click. This step requires to detect a given item on the screen while the inventory is open. However in case using 3rd party addon for bags, the layout can change.

The other way is to create a predefined macro in prior. Editing macro from the bot has not yet been done before, so that's a new thing as well. Default macro's have limited 255 characters to use. With this macro you can select Common/White items.

/run c=C_Container for bag=0,4 do for slot=1,c.GetContainerNumSlots(bag) do i=c.GetContainerItemInfo(bag,slot) if i and i.quality==1 then c.UseContainerItem(bag,slot) end end end

It would be super nice edit this script from the c# code side. Even convenient would be, to open up the chat window while the SendMailFrame is active.

Maybe other 3rd party addons have auto mailing feature, out of the blue, i can't recall any addon what i used in the past which had such feature in it.

Xian55 commented 11 months ago

With the Dragonflight release, a new Soft Targeting system has been added to the game. Which allows to make interaction with GameObject's such as mailbox, herb and veins without using mouse.

To enable this function be sure to Options > Gameplay > Controls > Enable Interact Key [x]

Then to make it easier to interact with the mailbox type the following command to extend the angle where the player can interact. /console SoftTargetInteractArc 1

Then if everything goes well, standing nearby at mailbox proximity, it should be highlighted. image

You can either use the

Xian55 commented 4 months ago

With #573 the backend is capable of detecting and interactable GameObject is in range such as Vein, Herb. Also it knows exactly what kind of GameObject is, thanks to the Id.

Mailbox can be detected, however i have not yet found a comprehensive list of all available mailbox id(s).