Question about portable mailbox
-
- Posts: 133
- Joined: Fri May 06, 2011 10:39 am
Question about portable mailbox
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
Re: Question about portable mailbox
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
Re: Question about portable mailbox
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.
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
-
- Posts: 133
- Joined: Fri May 06, 2011 10:39 am
Re: Question about portable mailbox
Thank you for the reply, so i would add it to my onload or should i add it in the waypoint? please advice
Re: Question about portable mailbox
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.
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
-
- Posts: 133
- Joined: Fri May 06, 2011 10:39 am
Re: Question about portable mailbox
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
Re: Question about portable mailbox
Then probably add it to the onLeaveCombat? =)
Re: Question about portable mailbox
in your onload waypointAngelDrago 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
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??
Re: Question about portable mailbox
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:Although, you don't need to create a function, you could just have the contents of the function,eg.
Or, if you want it to only apply for a particular waypoint file you can change the profile onleavcombat from the waypoint onload, eg.
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>
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>
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
-
- Posts: 133
- Joined: Fri May 06, 2011 10:39 am
Re: Question about portable mailbox
thank you for all the input i will try that... i will give update later
-
- Posts: 133
- Joined: Fri May 06, 2011 10:39 am
Re: Question about portable mailbox
OK tried this one out and I'm getting this error per say it will not send anything out and I'm using this in my profile
Code: Select all
Sending items to xxxxx... Nothing to send.
Use MACRO: Executing RoMScript "CloseWindows()".
[string "return {_uilua.lightuserdate="userdata: 39DD0..."]:1: '}' expected near '='
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.
Re: Question about portable mailbox
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.
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.
Code: Select all
print("CloseWindows() completed")
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
Who is online
Users browsing this forum: Bing [Bot] and 6 guests