Question about portable mailbox

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
AngelDrago
Posts: 133
Joined: Fri May 06, 2011 10:39 am

Question about portable mailbox

#1 Post by AngelDrago » Fri Jan 03, 2014 11:01 pm

I have a question on a portable mailbox not the envelope one but the you buy for diamonds i would like to check the backpack and it if sees it full it should than open up the portable mailbox to send out some of the loot that is not bound. any ideas that could help me. thx everyone

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

Re: Question about portable mailbox

#2 Post by kuripot » Sat Jan 04, 2014 2:51 am

not sure but you can try

Code: Select all

	function bagcheck()
		if inventory:itemTotalCount(0) == 0 then
      		 	sendMacro("OpenMail()");
			yrest(1000);
			UMM_SendByNameOrId("Recievername",{ItemID},180)
			yrest(1000)
			sendMacro("CloseWindows()")
		end
	end

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

Re: Question about portable mailbox

#3 Post by rock5 » Sat Jan 04, 2014 6:01 am

Firstly, the mailbox opens automatically these days so you only have to use the actual send command. The function you use will depend on what sort of loot you want to send. Most likely you would use the "SendByType" function and send weapons and armor and any other types of loot you want to send. Note: all the UMM functions exclude items that are bound so you don't have to do anything specific for that.

Wait, there is no SendByType function. I should probably add one at some stage. At least the SendAdvanced function supports types, eg.

Code: Select all

UMM_SendAdvanced("recipient",nil,nil,nil,nil,{"Weapons","Armor"})
  • 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

AngelDrago
Posts: 133
Joined: Fri May 06, 2011 10:39 am

Re: Question about portable mailbox

#4 Post by AngelDrago » Mon Jan 06, 2014 12:43 am

Thank you for the reply, so i would add it to my onload or should i add it in the waypoint? please advice

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

Re: Question about portable mailbox

#5 Post by rock5 » Mon Jan 06, 2014 1:46 am

Do you want it to do it when you load the waypoint file or when you are at a particular way point? Normally you could just put all your code in a way point but if you want to check your mail numerous times you might want to create a function in the onload then call the function at the waypoints.

So it depends.
  • 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

AngelDrago
Posts: 133
Joined: Fri May 06, 2011 10:39 am

Re: Question about portable mailbox

#6 Post by AngelDrago » Mon Jan 06, 2014 9:46 am

yes, i would like it to be checked every time so when the backpack is full it needs to be sending out the specific items and than continue what it was doing

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Question about portable mailbox

#7 Post by Ego95 » Mon Jan 06, 2014 9:02 pm

Then probably add it to the onLeaveCombat? =)

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

Re: Question about portable mailbox

#8 Post by kuripot » Tue Jan 07, 2014 3:47 am

AngelDrago wrote:yes, i would like it to be checked every time so when the backpack is full it needs to be sending out the specific items and than continue what it was doing
in your onload waypoint

Code: Select all

   function bagcheck()
      if inventory:itemTotalCount(0) == 0 then
                sendMacro("OpenMail()");
         yrest(1000);
         UMM_SendAdvanced("recipient",nil,nil,nil,nil,{"Weapons","Armor"})
         yrest(1000)
         sendMacro("CloseWindows()")
      end
   end

in your profile

Code: Select all

	<onLoad><![CDATA[

	]]></onLoad>

	<onDeath><![CDATA[

	]]></onDeath>

	<onLeaveCombat><![CDATA[
          bagcheck()
	]]></onLeaveCombat>

	<onLevelup><![CDATA[

	]]></onLevelup>

	<onSkillCast><![CDATA[

	]]></onSkillCast>

	<onHarvest><![CDATA[

	]]></onHarvest>

	<onUnstickFailure><![CDATA[

	]]></onUnstickFailure>

im right??

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

Re: Question about portable mailbox

#9 Post by rock5 » Tue Jan 07, 2014 7:42 am

Don't forget, you shouldn't need to open the mailbox in recent versions of the UMM functions. It does it automatically.

Put the "bagcheck()" in the profile if you want it to always do that check regardless of which waypoint file you use. If you do that then it's not a good idea to put the function in the waypoint onload because if you load another waypoint file you will get an error when it tries to run bagcheck() from the profile.

So either put it all in the profile:

Code: Select all

   <onLeaveCombat><![CDATA[
       function bagcheck()
          if inventory:itemTotalCount(0) == 0 then
             UMM_SendAdvanced("recipient",nil,nil,nil,nil,{"Weapons","Armor"})
             yrest(1000)
             sendMacro("CloseWindows()")
          end
       end
       bagcheck()
   ]]></onLeaveCombat>
Although, you don't need to create a function, you could just have the contents of the function,eg.

Code: Select all

   <onLeaveCombat><![CDATA[
          if inventory:itemTotalCount(0) == 0 then
             UMM_SendAdvanced("recipient",nil,nil,nil,nil,{"Weapons","Armor"})
             yrest(1000)
             sendMacro("CloseWindows()")
          end
   ]]></onLeaveCombat>
Or, if you want it to only apply for a particular waypoint file you can change the profile onleavcombat from the waypoint onload, eg.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onload>
		if oldOnLeaveCombat == nil and settings.profile.events.onLeaveCombat then
			oldOnLeaveCombat = settings.profile.events.onLeaveCombat
		end
		function settings.profile.events.onLeaveCombat()
			if oldOnLeaveCombat then
				oldOnLeaveCombat()
			end
			if inventory:itemTotalCount(0) == 0 then
				UMM_SendAdvanced("recipient",nil,nil,nil,nil,{"Weapons","Armor"})
				yrest(1000)
				sendMacro("CloseWindows()")
			end
		end
	</onload>
  • 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

AngelDrago
Posts: 133
Joined: Fri May 06, 2011 10:39 am

Re: Question about portable mailbox

#10 Post by AngelDrago » Sun Jan 12, 2014 1:30 pm

thank you for all the input i will try that... i will give update later

AngelDrago
Posts: 133
Joined: Fri May 06, 2011 10:39 am

Re: Question about portable mailbox

#11 Post by AngelDrago » Thu Sep 04, 2014 2:34 pm

OK tried this one out and I'm getting this

Code: Select all

Sending items to xxxxx...  Nothing to send.
Use MACRO: Executing RoMScript "CloseWindows()".
[string "return {_uilua.lightuserdate="userdata: 39DD0..."]:1: '}' expected near '='
error per say it will not send anything out and I'm using this in my profile

Code: Select all

        if inventory:itemTotalCount(0) == 0 then
             UMM_SendAdvanced("meme",nil,nil,nil,nil,{"Recipe", "Legendary Arrow", "Elven Herb", "Mysterious Elf Stone", "Blend Rune", "Ring", "Earring", "Necklace"})
             yrest(1000)
             sendMacro("CloseWindows()")
          end
Last edited by AngelDrago on Tue Dec 30, 2014 11:43 am, edited 1 time in total.

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

Re: Question about portable mailbox

#12 Post by rock5 » Thu Sep 04, 2014 10:50 pm

The fact that the error message appears after the CloseWindows() message suggests it might be due to some code after the code you showed us. Try adding a print message after the sendMacro. Eg.

Code: Select all

print("CloseWindows() completed")
If it prints that message before the error then the error is caused by some code after that bit you showed us.

If you add a few print messages through your code it will help to narrow down which command is causing the error.
  • 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: No registered users and 25 guests