Page 1 of 1

MailMats function

Posted: Thu Jul 23, 2015 12:21 pm
by beanybabe
I made this but I need to expand it to handle all crafting mats in bag.
just give it a chars name and it mails all mats in the bag to them.
If anyone has done this or has simple idea before I spend weeks trying to figure it out.
I looked at the mail belts from fusion controls and this may also need a list of people to send to in case the mailbox fills.
YGather from Curse looks like it has code to load a table with all the mats but its to hard for me to figure out.

This is what I use now to mail just 1 mat at a time.

Code: Select all

function mailgoods()
	GotoGuild("Guild Mailbox")
	player:target_NPC("Guild Mailbox") -- Mailbox
	UMM_SendByNameOrId(nametosendto,numberofitemtosend, inventory:itemTotalCount(itemname));
	yrest(500);
	RoMScript("UMMFrame:Hide()")
end	

Re: MailMats function

Posted: Thu Jul 23, 2015 1:11 pm
by noobbotter
If you were to look in the itemtypestable.lua file, it lists types of items that you can use with the function. If you use "Materials" in your mail function, it would send all Wood, Herbs, Ores, Raw Materials, Production Runes, Prepared Materials, and Ore:

Code: Select all

function mailgoods()
   GotoGuild("Guild Mailbox")
   player:target_NPC("Guild Mailbox") -- Mailbox
   UMM_SendAdvanced(nametosendto,nil,nil,nil,nil,"Materials") --look in rom/cache/itemtypestable.lua for exact name of "Materials"
   yrest(500);
   RoMScript("UMMFrame:Hide()")
end   
That would send all Materials to the named character.

If you want to send only, for example, wood, herbs and ore, you could use this line:

Code: Select all

UMM_SendAdvanced(nametosendto,nil,nil,nil,nil,{"Wood", "Herbs", "Ore"}) --look in rom/cache/itemtypestable.lua for exact name of "Materials"

Re: MailMats function

Posted: Thu Jul 23, 2015 10:59 pm
by beanybabe
I needed way to have multiple wp call one and have it return. I found post by rock saying it cannot be done. I was going to have multiple dailys being called by several main. So now I am rewriting all the dailys into functions I can call.

Re: MailMats function

Posted: Wed Feb 03, 2016 3:57 am
by beanybabe
UMM_SendAdvanced(nametosendto,nil,nil,nil,nil,{"Wood", "Herbs", "Ore"})

I tried to use this to send just these 3 items but it did not work, Any ideas?

I tried just one mat at a time also.
The only way it worked is the word "Materials"

Re: MailMats function

Posted: Wed Feb 03, 2016 8:36 am
by noobbotter
It should work. I know I used to use this line in one of my scripts:

UMM_SendAdvanced("CharNameToSendTo",nil,nil,nil,nil,{"Herbs","Ores","Raw Materials","Prepared Materials"})

Only difference I can see is the spaces you have between the {"Wood", "Herbs", "Ore"}. Try it like this: {"Wood","Herbs","Ore"}. Maybe that will do it?

Re: MailMats function

Posted: Fri Mar 18, 2016 9:53 pm
by lovemelongtime
Is there a way I could get it to send items only when backpack is full?

Re: MailMats function

Posted: Sat Mar 19, 2016 5:38 pm
by beanybabe
You would need a path to a mail box or have mail tickets. Then check when bag near full you could call a mail function.

I made a mail function that runs to some mail box and sends mail. Each zone is little different so unless you use mail tickets you need to custom make them.