Page 27 of 39

Re: Rock5's Mail Mods

Posted: Tue Nov 12, 2013 5:07 am
by kuripot
why this not working to me

Code: Select all

      function Clearmail()
	sendMacro("CloseWindows()")
         sendMacro("OpenMail()")
		RoMScript("UMMMailManager:MassTagMails('Empty')"); yrest(5000)
		RoMScript("UMMFrameTab1Tools:ButtonClick('Delete');"); yrest(10000)
 		sendMacro("CloseWindows()") yrest(1000) 
      end
when my bag was full and cannot get the remaining mail, the empty inbox will not delete so my character only open the mail.. example my bag only have 10 space and inbox was 30 so when my character get the mail he can get 10 and there is remaining 20 in the mailbox, so the previous 10 will not deleted then close the mailbox and open again... my character only get the ramaining 20 mails but the previous 10 will remain empty but not deleted..

Re: Rock5's Mail Mods

Posted: Tue Nov 12, 2013 7:58 am
by rock5
Maybe because you don't give enough time for the mail box to open.

Re: Rock5's Mail Mods

Posted: Tue Nov 12, 2013 8:45 pm
by Rickster
just to give some feedback and out of curiosity, i tried this two things from the commandline
kuripot wrote:

Code: Select all

RoMScript("UMMMailManager:MassTagMails('Empty')")
RoMScript("UMMFrameTab1Tools:ButtonClick('Delete');")
but neither works, because the first one does not mark empty mails.

i did never handle windows and clicks on buttons with rom bot, so where do you get windows, methods and button information of the game and addons from?

Re: Rock5's Mail Mods

Posted: Wed Nov 13, 2013 4:37 am
by rock5
Worked for me. The reason you don't see it select the mail is because it requires another function to update the display of the list.

The way he probably got those functions is by rummaging around in the UMM addon folder. First you find the "Empty" button in the xml file. In this addon it's not so easy because there are a lot of files and it's not obvious where you will find it. When you find it you look at the onclick event for it.

Code: Select all

          <OnClick>
            this:GetParent():ButtonClick("tagempty");
          </OnClick>
Then we look for the ButtonClick function.

Code: Select all

  this.ButtonClick = function(self, action)
    if (string.lower(action) == "tagchars") then
      UMMMailManager:MassTagMails("chars");
      getglobal(self:GetParent():GetName().."TOC"):RefreshTOC();
    elseif (string.lower(action) == "tagguildies") then
      UMMMailManager:MassTagMails("guildies");
      getglobal(self:GetParent():GetName().."TOC"):RefreshTOC();
    elseif (string.lower(action) == "tagfriends") then
      UMMMailManager:MassTagMails("friends");
      getglobal(self:GetParent():GetName().."TOC"):RefreshTOC();
    elseif (string.lower(action) == "tagother") then
      UMMMailManager:MassTagMails("other");
      getglobal(self:GetParent():GetName().."TOC"):RefreshTOC();
    elseif (string.lower(action) == "tagempty") then
      UMMMailManager:MassTagMails("empty");
      getglobal(self:GetParent():GetName().."TOC"):RefreshTOC();
    else
      UMMMailManager:StartAutomation(action);
    end
    self:CheckSelection();
  end;
A you can see under "tagempty" there are the commands

Code: Select all

      UMMMailManager:MassTagMails("empty");
      getglobal(self:GetParent():GetName().."TOC"):RefreshTOC();
The first command tags the mails and the second one updates the display of the list.

With the delete command he just executed the function found in the onclick probably because the code there is more complex.

Code: Select all

          <OnClick>
            this:GetParent():ButtonClick("delete");
          </OnClick>
Of course you need to be able to follow the code back to figure out what "this:GetParent()" refers to. In the same way you could use the empty onclick function directly.

Code: Select all

RoMScript("UMMFrameTab1Tools:ButtonClick('tagempty');")
This will do all the code including highlighting the selected messages and enabling the delete button.

Re: Rock5's Mail Mods

Posted: Wed Nov 13, 2013 4:47 pm
by Rickster
Thanx Rock, for the detailed info! :)

Re: Rock5's Mail Mods

Posted: Thu Nov 21, 2013 2:17 am
by trinity1
Just trying to find the function to send to another character if the mailbox is full been looking for it and did a search. if there is a function to send to another character if the mail box is full, is it possible to put that function on the first page so it don't get lost in the 27 pages? if not then please give me a example so I can use that function because it would be very useful for my t5 farmin bots.

Re: Rock5's Mail Mods

Posted: Thu Nov 21, 2013 4:07 am
by rock5
Basically all the send functions return true if it worked and false if it failed. So you can do something like

Code: Select all

if UMMSend...(recipient,args) == false then
    UMMSend...(recipient2,args) 
end
Or if you are in some sort of sending loop you could change the recipient name. How you write it will really depend on what you are doing.

Re: Rock5's Mail Mods

Posted: Fri Nov 22, 2013 1:43 am
by trinity1
thanks rock

and now I need it so I can send to a list of characters if the bags get full so how would I code it for 5 different characters... I have a idea I think would work but not sure... because I would just repeat what you put, change the names and use the same function but I am not sure if there is a better way to do it or not? So if you can give me another example with that Scenario then I can handle it from there.

Re: Rock5's Mail Mods

Posted: Fri Nov 22, 2013 2:02 am
by rock5
Well you could just do

Code: Select all

if UMMSend...(recipient,args) == false then
  if UMMSend...(recipient2,args) == false then
    if UMMSend...(recipient3,args) == false then
      if UMMSend...(recipient4,args) == false then
        UMMSend...(recipient5,args)
      end
    end
  end
end
This is ok if it does it only a few times. But if it repeats it many times then you don't want it to keep trying to mail to the full ones first so you would keep track of the recipients. eg.

In the onload you would put.

Code: Select all

recip = {"recipient1","recipient2","recipient3","recipient4","recipient5"}
recipindex = 1
Then when you are checking your bags you would do

Code: Select all

if UMMSend...(recip[recipIndex],args) == false then
    if recipIndex = #recip then
        error("All recipient bags are full")
    else
        recipIndex = recipIndex+1
        UMMSend...(recip[recipIndex],args)
    end
end
That's one way of doing it.

Re: Rock5's Mail Mods

Posted: Fri Nov 22, 2013 5:05 am
by trinity1

Code: Select all

if UMMSend...(recip[recipIndex],args) == false then
    if recipIndex = #recip then
        error("All recipient bags are full")
    else
        recipIndex = recipIndex+1
        UMMSend...(recip[recipIndex],args)
    end
end
not sure exactly where I should put this, I get the first two examples

Re: Rock5's Mail Mods

Posted: Sat Nov 30, 2013 6:57 am
by kuripot
when my character failed to send he relog but when try to resend again this error appear ingame.. so my character keep relogging

Re: Rock5's Mail Mods

Posted: Sat Nov 30, 2013 7:34 am
by rock5
I think we've encountered this before but I don't remember what was the cause. A search online just says it's a bug that requires a client restart. Hopefully that will fix it and it wont happen very often.

Re: Rock5's Mail Mods

Posted: Sat Nov 30, 2013 7:52 am
by kuripot
yeah i need to re start client.... i know before you working restarting client command..but i cant remember what thread it is

Re: Rock5's Mail Mods

Posted: Sat Nov 30, 2013 8:05 am
by rock5
The userfunction is called "userfunction_login.lua". The relog happens in the UMM send function so I think the userfunction needs to be modified to use the login userfunction.

Re: Rock5's Mail Mods

Posted: Tue Dec 03, 2013 11:41 pm
by kuripot

Code: Select all

UMM_TakeMail()
Takes all mail. Note: if there is more than 30 it will only get the first 30 unless you reopen the mailbox.
will take all mail.. how about taking mail in how many space available in bag example.. my backpack has 5 space left// i want to take 5 mail only.. because when my backpack only 5 space left and my character trying to take all 30 mail..and it will stuck in taking mail until i manually close the mail

Re: Rock5's Mail Mods

Posted: Wed Dec 04, 2013 2:32 am
by rock5
The function just clicks the take all button. To have it take only a certain number of mails would require a lot more code to take the mail one at a time and then it would definitely be a lot slower. The easier solution is to just fix it so it doesn't get stuck. Should be fairly simple to do. I'll update it soon.

Re: Rock5's Mail Mods

Posted: Wed Dec 04, 2013 3:52 am
by kuripot
how can i make short command to close the mail when taking mail and bag was full until you update the function..
the situation is my character has rented bag III-VI =180 slot
my character buy 81pcs of rfs then
take 30 mail then repeat taking mail 30 and re take 30 mail again
so my bag has 171 inventory
and fusing... and 9 belt left
the buy again 81 pcs of rfs
and take 90 mail
my inventory will be 180
and repeat again the sequence..
every fusing 9 belt will left so it will add to my inventory until my bag was full in next taking mail

Re: Rock5's Mail Mods

Posted: Wed Dec 04, 2013 7:55 am
by rock5
The userfunction is already updated. If you need to close the mailbox so you can open it again to collect more mail, you can use what I used.

Code: Select all

RoMScript("HideUIPanel(MailFrame)")

Re: Rock5's Mail Mods

Posted: Mon Dec 30, 2013 2:41 pm
by Eggman1414
Is there a way to stop the bot from advancing to the next waypoint when I use the command?

Code: Select all

UMM_TakeMail()


I have this

Code: Select all

repeat
    local mailcount = RoMScript("UMMMailManager.MailCount")
    UMM_TakeMail();
    yrest(1000);
until 0 >= mailcount or inventory:itemTotalCount(0) == 0
between two waypoints, but it takes like 6 items then closes and goes to the next waypoint. It doesnt even delete the opened mail. I dont know how to fix this.

Re: Rock5's Mail Mods

Posted: Tue Dec 31, 2013 3:22 am
by rock5
What do you mean by "between two waypoints"? The code has to be at a waypoint to be executed.

Try printing your values to see why it leaves the loop.

Code: Select all

repeat
    local mailcount = RoMScript("UMMMailManager.MailCount")
    UMM_TakeMail();
    yrest(1000);
    print(mailcount, inventory:itemTotalCount(0))
until 0 >= mailcount or inventory:itemTotalCount(0) == 0