Detect Auto Accept Invitations Addon?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Detect Auto Accept Invitations Addon?

#1 Post by noobbotter » Thu Mar 14, 2013 7:08 am

how would I detect if the client has the Auto Accept Invitations addon installed? Thanks.

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Detect Auto Accept Invitations Addon?

#2 Post by kuripot » Thu Mar 14, 2013 8:09 am

noobbotter wrote:how would I detect if the client has the Auto Accept Invitations addon installed? Thanks.
/aai if no menu appear.. not installed

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Detect Auto Accept Invitations Addon?

#3 Post by noobbotter » Thu Mar 14, 2013 8:16 am

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.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Detect Auto Accept Invitations Addon?

#4 Post by rock5 » Thu Mar 14, 2013 11:57 am

Just check for the existence of one of it's functions or variables.

Eg.

Code: Select all

if RoMScript("functionname ~= nil") then -- The function exists
   ...
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.
  • 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Detect Auto Accept Invitations Addon?

#5 Post by noobbotter » Thu Mar 14, 2013 12:22 pm

Exactly what I was looking for. Thanks Rock. I'll try that tonight when I get home.

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Detect Auto Accept Invitations Addon?

#6 Post by noobbotter » Thu Mar 14, 2013 5:26 pm

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:

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	 
I verified it with both the addon installed and not installed and it worked as expected.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Detect Auto Accept Invitations Addon?

#7 Post by rock5 » Thu Mar 14, 2013 11:29 pm

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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest