Skip to content

Callback and How to use them

Leontopodium Nivale edited this page Jul 18, 2024 · 2 revisions

Alright, this is a lot to explain in itself so bear with me as I try to explain this.

Disclaimer. These can crash your game if you try and fire/activate it while that addon isn't active. No

Callback -> /callback is a way to directly interact with certain elements of the game. The values of these can range -a lot-
Simpletweaks is also virtually required to be able to tell what you're looking for. Once installed, type in tweaks Debug (yes, it's case sensitive)

This will pop up the following window, you want to go Addon Logging, make sure you're on the Callbacks tab, and Enable Logging

image

From here, it's just clicking on the ui element that you're trying to click on. In the example below. Lets say you wanted to make it to where it would click on Recommended Gear for you. With the logging enabled, you would get the following:

image

and the command would look like: /callback Character true 12

-> Character is the addon in this case
-> true is the Update Visibility
-> 12 is the value(s) that are necessary for this to go off properly.

There is A lot of different ones that can be used. Some that honestly I'm still trying to figure out how to make work.

Another good example for people who want to really dwelve/see how strong this is.

Lets say you're buying an item from a vendor (Sabina in Idyllshire is going to be my dummy for this)

If you click on a shop item from here (using the top of the list as an example here) image

You'll get the following
image

-> ShopExchangeItem is the addon name
-> true for the visibility
-> 0 is a value that doesn't really matter to us here/doesn't effect the rest of them
-> the 2nd 0 pertains to which item you're selecting. Top of the list usually starts at 0, and works it's way up
-> the 3rd number (1 in this case`) pertains to How many of those items you're buying. And this can in fact bypass how many items a vendor is normally locked to

image image

Here, I just interacted w/ the vendor like normal, just turning in 1 items worth of materials to get gear from them

Now if I were to change that 1 to a 5 now on an item that I can actually buy and run the following: /callback ShopExchangeItem true 0 3 5

image image

Now I have 5 unique pieces of armor
image

(Yes, you can have multiple unique items, no, you can't equip them as far as I can tell)

But these are the 2 kinds of extreme's. It's mainly a lot of poking around and seeing how certain addon's fire off and how they interact, and a lot of trial and error. But congrats, you're one step closer to learning how plugin makers interact with menu's!