Detect Auto Accept Invitations Addon?
-
- Posts: 527
- Joined: Fri Aug 31, 2012 1:15 pm
Detect Auto Accept Invitations Addon?
how would I detect if the client has the Auto Accept Invitations addon installed? Thanks.
Re: Detect Auto Accept Invitations Addon?
/aai if no menu appear.. not installednoobbotter wrote:how would I detect if the client has the Auto Accept Invitations addon installed? Thanks.
-
- Posts: 527
- Joined: Fri Aug 31, 2012 1:15 pm
Re: Detect Auto Accept Invitations Addon?
I knew that, lol.
I meant, if writing a script for a dailies quest, I want to detect if the client running the script has the aai addon. If the addon is not installed then it will run a function I have to detect the invite and accept it. If the client has the addon, then it wouldn't need to run my function and instead, it would just do an "/aai on" to ensure it's turned on to auto accept the invite.
I meant, if writing a script for a dailies quest, I want to detect if the client running the script has the aai addon. If the addon is not installed then it will run a function I have to detect the invite and accept it. If the client has the addon, then it wouldn't need to run my function and instead, it would just do an "/aai on" to ensure it's turned on to auto accept the invite.
Re: Detect Auto Accept Invitations Addon?
Just check for the existence of one of it's functions or variables.
Eg.Have a look in the addons lua files and pick something to check. The only limitation is that is has to be something that isn't declared as local.
Eg.
Code: Select all
if RoMScript("functionname ~= nil") then -- The function exists
...
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
-
- Posts: 527
- Joined: Fri Aug 31, 2012 1:15 pm
Re: Detect Auto Accept Invitations Addon?
Exactly what I was looking for. Thanks Rock. I'll try that tonight when I get home.
-
- Posts: 527
- Joined: Fri Aug 31, 2012 1:15 pm
Re: Detect Auto Accept Invitations Addon?
I used if RoMScript("aai ~= nil") then and at first it seemed good. Returned true with it installed, but then I moved the addon out of my addons folder and ran ReloadUI() and it still returns it true. I then tried changing it up and got it working. Here's what I tested with:
I verified it with both the addon installed and not installed and it worked as expected.
Code: Select all
if RoMScript("aai") ~= nil then
local aaiinstalled = true;
print("aai addon detected");
else
local aaiinstalled = false;
print("aai addon not detected");
end
Re: Detect Auto Accept Invitations Addon?
If you intend to use the variable aaiinstalled, you shouldn't declare it local inside the 'if' statement. Should be
Code: Select all
local aaiinstalled
if RoMScript("aai") ~= nil then
aaiinstalled = true;
print("aai addon detected");
else
aaiinstalled = false;
print("aai addon not detected");
end
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest