Page 9 of 39

Re: Rock5's Mail Mods

Posted: Wed Jul 13, 2011 11:04 am
by C3PO
Sorry ...

let me try to explain it. when you are using the Addon (so in the GeaFolder\Interface\Addon\) and you want to send in the game to someone gold than nothing happens after pressing the send button.

Hope this helps to help me ;)

Re: Rock5's Mail Mods

Posted: Wed Jul 13, 2011 8:03 pm
by lisa
when you add items to mail it automatically creates a subject for you, when you send gold it doesn't put anything in subject. Chances are you just need to type something in the subject section, even 1 letter is enough.

Re: Rock5's Mail Mods

Posted: Thu Jul 14, 2011 6:27 am
by rock5
Mine automatically adds "Money: XXX" in the subject.

Re: Rock5's Mail Mods

Posted: Tue Jul 26, 2011 2:22 pm
by C3PO
Hello again!

I found the Problem. For all players who are playing in other languages (not en) check your localization files. In the german version the translations for the confirmation dialoge where missing.

Re: Rock5's Mail Mods

Posted: Sat Jul 30, 2011 4:00 pm
by berzer
hi, is there any way to fix the mass sending item stucking;
when sending mass fusion stone or any other same mass items to same char it stucked after some time..
The only solution is relogin and resending, but it is very annoying..

Re: Rock5's Mail Mods

Posted: Sat Jul 30, 2011 11:29 pm
by rock5
berzer wrote:hi, is there any way to fix the mass sending item stucking;
when sending mass fusion stone or any other same mass items to same char it stucked after some time..
The only solution is relogin and resending, but it is very annoying..
I think there is some sort of limit as to how many you can send at once. Someone reported it once. I've never encountered it because I never send that much.

Re: Rock5's Mail Mods

Posted: Mon Aug 01, 2011 2:50 am
by berzer
can someone help me with a simple mailing script:

I want to buy x number of an item at NPC and send it to a Y char and this repeat to different chars

example: i want to buy 18 fusion stones, run to mailbox and send to my alts

Re: Rock5's Mail Mods

Posted: Mon Aug 01, 2011 5:59 am
by rock5
To buy is pretty simple.

Code: Select all

player:openStore(npcname)
store:buyItem("Random Fusion Stone", 18)
The sending is a bit more tricky because you need to alternate between recipients so you need a list. Create it in the onLoad section of the waypoint and initialise an index variable.

Code: Select all

</onLoad>
mailingList = {"name1","name2","name3","name4"}
mailingIndex = 1
</onLoad>
Then at the waypoint near the mail box do something like this.

Code: Select all

-- Check if name exists
if mailingList[mailingIndex] == nil then
    error("Finished sending to all recipients.")
end

-- Send items
player:target_Object("Mail Box")
UMM_SendByNameOrId(mailingList[mailingIndex],"Random Fusion Stone")

mailingIndex = mailingIndex + 1

Re: Rock5's Mail Mods

Posted: Tue Aug 02, 2011 7:28 am
by gloover
After a 4. Patch I've got this error

Image

b4 updating the game to v.4.xx it was runing like a charm.

that was the old source

Code: Select all

		player:target_Object("Briefkasten",2000);	
		sendMacro("ChoiceOption(1);"); yrest(2000);
		UMM_TakeMail();		
		
		UMM_SendMoney("character", "all"); yrest (2000);
                UMM_SendByNameOrId("character", {204791,204792}); yrest (200); 
also trying this

Code: Select all

player:target_Object("Briefkasten",2000);	
		sendMacro("ChoiceOption(1);"); yrest(2000);
		UMM_TakeMail();		
		
		UMM_SendMoney("character", "all"); yrest (2000);
		
		if (inventory:itemTotalCount(204791) > 0)  then   
			UMM_SendByNameOrId("character", {204791}); yrest (200); 
		end 
		
		if (inventory:itemTotalCount(204792) > 0)  then   
			UMM_SendByNameOrId("character", {204792}); yrest (200); 
		end 
same error.

whats goin wrong?

Re: Rock5's Mail Mods

Posted: Tue Aug 02, 2011 10:42 am
by rock5
Sorry but I can't see anything wrong with it. Are you sure you are using the latest version of my userfunction?

Re: Rock5's Mail Mods

Posted: Tue Aug 02, 2011 11:03 am
by gloover
Yes, userfunctions from bot rev 636.

Also Yours UMM. As i sad, it apears since the last patch. It seem to cause an error trying to set a text into the "recipent" line :(

Re: Rock5's Mail Mods

Posted: Tue Aug 02, 2011 11:18 am
by rock5
636 is the bot. Are you using my mail functions version 1.61?

Re: Rock5's Mail Mods

Posted: Wed Aug 03, 2011 2:56 pm
by gloover
yes, thats v.1.61 of your mail function. Even tested again, same error :cry:

It has been worked till the 4.xx patch. wtf. test it on small client, same error.

Re: Rock5's Mail Mods

Posted: Thu Aug 04, 2011 4:43 am
by rock5
Seems to work fine for me.

What the error means is either, an item in your inventory has a name of nil or one of the values you gave the function was nil. Neither of those should be true.

So we will need to add some code to see what's going on. Between line 213 and 214 of addon_Rock5s_Mail_Functions.lua,

Code: Select all

			for __, nam in pairs(_itemTable) do
				if string.find(string.lower(slotitem.Name),string.lower(nam)) or (slotitem.Id == nam) then -- mark to send
add these 2 lines

Code: Select all

if nam == nil then print("nam equals nil")
elseif slotitem.Name == nil then table.print(slotitem) end
So it looks like this

Code: Select all

			for __, nam in pairs(_itemTable) do
if nam == nil then print("nam equals nil")
elseif slotitem.Name == nil then table.print(slotitem) end
				if string.find(string.lower(slotitem.Name),string.lower(nam)) or (slotitem.Id == nam) then -- mark to send
Then show me what it prints when you get the error.

Re: Rock5's Mail Mods

Posted: Thu Aug 04, 2011 7:38 am
by gloover
Have added this 2 lines, same isue:

Code: Select all

Sending items to character...
...ts/rom/userfunctions/addon_Rock5s_Mail_Functions.lua:216: bad argument #1 to
'lower' (string expected, got table)
seems to be the same error in

Code: Select all

if string.find(string.lower(slotitem.Name),string.lower(nam)) or (slotitem.Id == nam) then -- mark to send
the bot overlows this two lines.

the bot opens umm, open "mass send tab" and then craches with this error :cry:

Ive tried to send by Name, and not by ID - same error!

EDIT:

I've found an old 1.60 version of your mailfunction :o on my backup hdd and this one works fine!
What is the difference between 1.60 and 1.61 except of takemail-loop?
I'm using a german client, maybe this could be the reasen?

Re: Rock5's Mail Mods

Posted: Thu Aug 04, 2011 8:20 am
by rock5
I think the only other difference is 1.6 assumes the second argument is a table and 1.61 checks to see if it's a string or a number. If so, then it converts it to a table.

What your saying implies that yours is seeing the second value as a string or number even though it is a table and turns it into a table within a table.

Do me a favour. Start the commandline waypoint file and type the following

Code: Select all

nam = {204791,204792} print(type(name))
Edit: btw the test I had you do before was wrong. Sorry. But what you are saying now makes it obvious that "nam" is the table.

Re: Rock5's Mail Mods

Posted: Thu Aug 04, 2011 10:29 am
by gloover
ye, you've right

Code: Select all

nam = {204791,204792} print(type(name))
print "nil"

Re: Rock5's Mail Mods

Posted: Thu Aug 04, 2011 10:39 am
by rock5
Doh! Another mistake. I'm full of them today. :oops:

It's supposed to be

Code: Select all

 nam = {204791,204792} print(type(nam)) 
Try that.

Re: Rock5's Mail Mods

Posted: Thu Aug 04, 2011 11:00 am
by gloover
Yep,

typing

Code: Select all

nam = {204791,204792} print(type(nam)) 
I've got

Code: Select all

table

Re: Rock5's Mail Mods

Posted: Thu Aug 04, 2011 11:48 am
by rock5
Then I don't understand why this part that I added doesn't work for you.

Code: Select all

	-- place item in table if not already
	if type(_itemTable) == "number" or type(_itemTable) == "string" then
		_itemTable = {_itemTable}
	end
I guess we could redo the first test but this time properly. Maybe it will shed some light on the matter. This time insert these lines.

Code: Select all

if type(nam) == "table" then print("nam equals") table.print(nam)
elseif typee(slotitem.Name) == "table" then print("slotitem.Name equals") table.print(slotitem) end