Page 1 of 1

Mail and Bank Function?

Posted: Sat May 26, 2012 3:37 am
by dr-nuker
Hello there!

I`ve seen the forum offfers a nice function to send mails and use the bankmaids. Unfortunally i`m not smart enought to use them correctly...

What i tried is:
Stay near mailbox and send all Recipes to one character, crafting items like from malatina to another etc.
In general i would be happy to send all unbound items, but no foods, to one specific character.
Afterwards i wanted to go to the banker and store all bound items from my bag to bank, that have stacks in the bank already. Like Goblin Tokens but no phirius coins.

So the problem that i have might be that i`m not able to search for what i carry around and what can be send and should be send...

Anyone has a little loop created for the above mentioned already?

Thanks for reading ;)

Re: Mail and Bank Function?

Posted: Sat May 26, 2012 6:43 am
by lisa
Well I don't have any code done ready to go but you would be looking at checking through your inventory and checking for what you want.

Code: Select all

function sendstuff()
	local recipe = {}
	local unbound = {}
	inventory:update()
	for slot = 61, 240 do
		item = inventory.BagSlot[slot]
		
		if item:isType("Recipe") then
			table.insert(recipe, slot)
		-- 0 = bound on pickup, 1 = not bound, 2 = binds on equip 3 = binds on equip and bound
		elseif item.BoundStatus == 1 and (not item:isType("Foods")) then
			table.insert(unbound, slot)
		end
	end
	for k,v in ipairs(recipe) do
		UMM_SendInventoryItem("charname1", v)
		yrest(500)
	end
	for k,v in ipairs(unbound) do
		UMM_SendInventoryItem("charname2", v)
		yrest(500)
	end
end

function bankstuff()
	inventory:update()
	for slot = 61, 240 do
		item = inventory.BagSlot[slot]
		if item then 
			-- code to move to bank here
		end
	end
end

when you are at the mailbox call sendstuff() and it will mail the stuff.
Then go to the bank and call bankstuff().

Obviously you need to change charname1 and charname2
Also you need to come up with some fancy code to move the rest of the stuff to your bank.

Either way this should get you started.

Re: Mail and Bank Function?

Posted: Mon May 28, 2012 11:52 am
by dr-nuker
Thanks lisa!

This seems to work when i have the mailbox in Logar open already.
Of course I also want the mailbox to be opend by the bot.

player:target_Object("Mailbox",1000); is not working...
it tells me that we found a mail, moves close but does nothing. I tried to change my functions.lua in the attac function already but seem to be too stupid to get it working correctly :&
The script ends there because mm tells me that the mailfunction needs an open mailbox to work :/

any comments on this? ;)

Re: Mail and Bank Function?

Posted: Mon May 28, 2012 12:19 pm
by rock5
That's because thats not how it's spelt. The name of the mail box is "Logar mailbox". A capital M wouldn't work. What it actually found and tried to target (if you'd read the message properly) is "Mailbox Icon". Which is probably the icon above the mailbox which can't be clicked.

The logar mailbox has another problem and that is that you have to select the "Open mailbox" option. So you also need

Code: Select all

ChoiceOptionByName("Open mailbox")
or use an addon such as Streamline to auto open the mailbox when the mailbox is clicked.

Re: Mail and Bank Function?

Posted: Mon May 28, 2012 1:31 pm
by dr-nuker
Well...

"bleh!" is all i can say now :)

I tried all possible combinations but did not realize that i used an "M" instead of "m" so thats what was needed :P

Thanks rock!