Can someone write me a simple add-on?
This is something I actually already have in another add-on but I'd like to make it a standalone add-on. I can't figure it out how to steal it from the code so I'm hoping someone here can write it for me. This function needs to target an npc and then interact with them and I'd like to be able to bind the function to any key. Also, whenever the add-on is turned on, I want to be able to override whatever key I designate it to inside the code.
and yes, it is possible, see below. https://streamable.com/pd8rpp |
1. use a macro that contains /target npcname
2. bind "interact with target" ? |
Quote:
|
Quote:
|
Quote:
|
Let others make that determination. Honestly, the fact that you can't write what you believe is "simple" is closely related to the fact that you can't extract this functionality from existing code.
|
Quote:
Just curious, because InteractTarget and RunBinding are protected and I currently can't think of any other method to interact with a NPC, but maybe I'm missing something. |
Quote:
|
Your gif doesn't prove what you think it proves. ;)
And you still haven't linked the addon you are currently using for this purpose. |
Quote:
My gif shows I'm pressing a single keybind to perform each action, what do you mean? |
1 Attachment(s)
There's an "Interact With Mouseover" keybind under "Targeting".
Edit: It's available to all clients, retail, classic, and BCC. |
Quote:
|
Quote:
Anyways, here's the section of the code that handles the one-button target and interact with function. I'm not really sure why you're all saying this is impossible. I removed a few lines as they're irrelevant to the process. Code:
local addonName = ... |
Quote:
Nevertheless, I'm glad you found it though :) Do you still need help with removing everything that's unrelated to targetting and interacting? |
Quote:
|
Ah, yes. That is indeed 2 button presses, not one. So long as they are not protected functions, you can do
Code:
if condition1 then (Oh, and we can't actually see button presses in a gif. ;) ) |
Quote:
Lua Code:
Simple logic: If Unta is the target it interacts with her, otherwise it mounts up (if not mounted) and also tries to target Unta. Seems to work fine on the PTR (can't test on live because my subscription just expired and token prices are ridiculous :p), only issue is that it will try to mount up again if you press the key again exactly before the mount cast finished (propably dependant on spell-queuing settings, you'll have to try it yourself if it's annoying). |
Quote:
Very cool! I tried to install it by saving it as a .lua file, creating a toc with the proper callings, but I couldn't turn it on from my add-ons list. Is there something else I need to do for it to appear on that list? |
Did you make sure you log out of the game before adding the files to the respective folder ?
Does the toc file have all the required entries ? |
Quote:
Yep, that was it, oops. |
I have a Teaching Addon repo that I use for this very purpose. It's a fully stubbed out repo, and all you have to do is fill in the blanks so to speak.
https://github.com/brittyazel/TeachingAddon It may be helpful |
I was looking for this too, and had been trying to get RunBinding("INTERACTTARGET"[, "up"]) to work
At least in Classic, where does it say this is Protected? https://vanilla-wow-archive.fandom.c...ding_Functions says "PROTECTED" before api commands that are protected, and this doesnt have that? https://wowwiki-archive.fandom.com/wiki/API_RunBinding same thing |
You are looking at archived wikis from long ago. The community has consolidated on Wowpedia.
https://wowpedia.fandom.com/wiki/Wor...I#Key_Bindings |
Wierd... it was saying I could not reply? I had to make a new account
Not sure why.. doesnt make any sense and had no notices in mail/here Anyway, reguardless of which of those many sites.. why do none of them (including the one u linked) have the PROTECTED flag? |
The detail page for RunBinding has that info
Quote:
|
So it's because InteractTarget is protected that it wont work?
|
Quote:
|
All times are GMT -6. The time now is 08:47 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI