Rock5's Mail Mods

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Rock5's Mail Mods

#521 Post by kuripot » Tue Nov 12, 2013 5:07 am

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..

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

Re: Rock5's Mail Mods

#522 Post by rock5 » Tue Nov 12, 2013 7:58 am

Maybe because you don't give enough time for the mail box to open.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#523 Post by Rickster » Tue Nov 12, 2013 8:45 pm

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?

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

Re: Rock5's Mail Mods

#524 Post by rock5 » Wed Nov 13, 2013 4:37 am

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.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#525 Post by Rickster » Wed Nov 13, 2013 4:47 pm

Thanx Rock, for the detailed info! :)

trinity1
Posts: 17
Joined: Thu Oct 10, 2013 12:07 pm

Re: Rock5's Mail Mods

#526 Post by trinity1 » Thu Nov 21, 2013 2:17 am

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.

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

Re: Rock5's Mail Mods

#527 Post by rock5 » Thu Nov 21, 2013 4:07 am

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.
  • 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

trinity1
Posts: 17
Joined: Thu Oct 10, 2013 12:07 pm

Re: Rock5's Mail Mods

#528 Post by trinity1 » Fri Nov 22, 2013 1:43 am

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.

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

Re: Rock5's Mail Mods

#529 Post by rock5 » Fri Nov 22, 2013 2:02 am

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.
  • 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

trinity1
Posts: 17
Joined: Thu Oct 10, 2013 12:07 pm

Re: Rock5's Mail Mods

#530 Post by trinity1 » Fri Nov 22, 2013 5:05 am

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

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

Re: Rock5's Mail Mods

#531 Post by kuripot » Sat Nov 30, 2013 6:57 am

when my character failed to send he relog but when try to resend again this error appear ingame.. so my character keep relogging
Attachments
cant.jpg

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

Re: Rock5's Mail Mods

#532 Post by rock5 » Sat Nov 30, 2013 7:34 am

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.
  • 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

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

Re: Rock5's Mail Mods

#533 Post by kuripot » Sat Nov 30, 2013 7:52 am

yeah i need to re start client.... i know before you working restarting client command..but i cant remember what thread it is

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

Re: Rock5's Mail Mods

#534 Post by rock5 » Sat Nov 30, 2013 8:05 am

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.
  • 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

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

Re: Rock5's Mail Mods

#535 Post by kuripot » Tue Dec 03, 2013 11:41 pm

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

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

Re: Rock5's Mail Mods

#536 Post by rock5 » Wed Dec 04, 2013 2:32 am

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.
  • 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

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

Re: Rock5's Mail Mods

#537 Post by kuripot » Wed Dec 04, 2013 3:52 am

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

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

Re: Rock5's Mail Mods

#538 Post by rock5 » Wed Dec 04, 2013 7:55 am

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)")
  • 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
Eggman1414
Posts: 111
Joined: Sun Jun 17, 2012 2:27 pm

Re: Rock5's Mail Mods

#539 Post by Eggman1414 » Mon Dec 30, 2013 2:41 pm

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.

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

Re: Rock5's Mail Mods

#540 Post by rock5 » Tue Dec 31, 2013 3:22 am

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
  • 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] and 10 guests