UMM auto mass mail

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

UMM auto mass mail

#1 Post by rock5 »

I'm trying automate sending mass mail using Ultimate Mail Mod.

I've marked items to send and entered a recipient now I need to click send.
I'm pretty sure

Code: Select all

UMMFrameTab3Status.StartSending(UMMFrameTab3Status);
is called when clicking send but it doesn't work. I get an error AutoDisableTabs is a nil value. Any idea why?

Can anyone figure out if this is the correct command?

If not can you figure out what it is?
  • 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
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: UMM auto mass mail

#2 Post by Administrator »

Probably a class? Try using ':' instead of '.' for that.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: UMM auto mass mail

#3 Post by rock5 »

Administrator wrote:Probably a class? Try using ':' instead of '.' for that.
Nah that's not it, but I did try it.

UMMFrameTab3Status.StartSending definately fires.

The send button has this in onclick

Code: Select all

this:GetParent():StartSending();
I'm pretty sure the butons name is "UMMFrameTab3StatusSend"

The start of the function looks like this

Code: Select all

this.StartSending = function(self)
It's inside another function

Code: Select all

function UMMMassSendItemsStatusTemplate_OnLoad(this)
This is called when UMMFrameTab3Status loads. so 'this' = 'UMMFrameTab3Status'

So;
this:GetParent():StartSending();
=
UMMFrameTab3StatusSend:GetParent():StartSending();

Didn't work. I've also tried
UMMFrameTab3Status:StartSending();
UMMFrameTab3Status.StartSending();


None of these caused errors. The following did.
UMMFrameTab3Status.StartSending(UMMFrameTab3Status);
UMMFrameTab3Status:StartSending(UMMFrameTab3Status);


And lots of other variations.

I'm not sure what effect a function being in another function has, is it possible that is a problem?
  • 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
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: UMM auto mass mail

#4 Post by Administrator »

this.StartSending = function(self)
You'll definitely need the ':', then. A function that accepts 'self' does so because ':' automatically inserts the 'self'. That is, this:

Code: Select all

object:func();
Is equivalent to:

Code: Select all

object.func(object);
I'm guessing you are just using the wrong frame. Check by doing something like this:

Code: Select all

if( this:GetParent() == UMMFrameTab3Status ) then
 -- correct
else
  -- incorrect
end
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: UMM auto mass mail

#5 Post by rock5 »

Administrator wrote:

Code: Select all

object:func();
Is equivalent to:

Code: Select all

object.func(object);
I knew "object" is taken to be the first argument of the function but I didn't know it also meant to prefix the function. That clarifies this a bit.

But I did try, as stated in my original post;

Code: Select all

UMMFrameTab3Status.StartSending(UMMFrameTab3Status);
which, if the object is correct, should have worked.
Administrator wrote:I'm guessing you are just using the wrong frame. Check by doing something like this:

Code: Select all

if( this:GetParent() == UMMFrameTab3Status ) then
 -- correct
else
  -- incorrect
end
I decided to display the objects name instead. I put this in the buttons onclick event;

Code: Select all

DEFAULT_CHAT_FRAME:AddMessage(this:GetParent():GetName())
It printed nothing when I clicked send.

Then I tried the following in the StartSending function

Code: Select all

if this:GetName() then DEFAULT_CHAT_FRAME:AddMessage("this = ".. this:GetName()) else
	DEFAULT_CHAT_FRAME:AddMessage("this = nil") end
if self:GetName() then DEFAULT_CHAT_FRAME:AddMessage("self = ".. self:GetName()) else
	DEFAULT_CHAT_FRAME:AddMessage("self = nil") end
Output was "self = UMMFrameTab3Status".

I think I understand that "this" has no value in the function but I can't understand how it could print nothing for "this".

Anyway, it looks like the frame is correct, right? So why doesn't it work?
  • 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
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: UMM auto mass mail

#6 Post by Administrator »

I'm not really sure. The whole addon structure is very confusing. I'm guessing that you are getting the wrong object because of inheritance. It does not error when calling it because all of the objects created are inheriting that function (although not using it).

I think it should be something like:

Code: Select all

UMMFrameTab3:StartSending();
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: UMM auto mass mail

#7 Post by rock5 »

I've nailed it!

There was no doubt in my mind that StartSending() was being calling and that 'self' = 'UMMFrameTab3Status' because of the printed messages but I was confused that print statements from the send button onclick event weren't firing and no value was being printed for 'this'.

So, on a whim, I commented out the StartSending command and, what do you know, it still sent the mail. That's when I realized I had the wrong button. The only other place StartSending is called is in the Send function which is called by another send button. Then it was just a matter of backtracking the inheritences and viola! the correct function.

Code: Select all

UMMFrameTab3Action:Send()
And I was just about to give up too.

I may not be too good at coding but my deductive reasoning amazes even me sometimes. :D

Now to get back to work on my Uber waypoint scripts.

Thanks for your help.
  • 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