Page 32 of 39

Re: Rock5's Mail Mods

Posted: Sun Jun 08, 2014 1:49 am
by rock5
Updated the first post with version 1.84 of the userfunction which is essentially the same as 1.84b3 previously posted.

Re: Rock5's Mail Mods

Posted: Sun Jun 22, 2014 5:23 pm
by silinky
hi!
i think i have a problem ot don't use this how it should be used.
i have this code:

Code: Select all

			UMM_TakeMail();
			yrest(30000);
it opens the mailbox, collects very fast the first 5 items, and it closes the mailbox although i have 30 items inside.
also it does not delete the resulted 5 empty mails so it will clutter the mailbox.

also i tried the suggestion concerning RoMScript("UMMFrameTab1Tools:ButtonClick('take');"); line, but that sux because it either waits too much or too little.

can anyone tell me what am i doing wrong?

Re: Rock5's Mail Mods

Posted: Sun Jun 22, 2014 11:16 pm
by rock5
Do you have the latest version of the Rock5s_Mail_Functions userfunction?

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 5:58 am
by silinky
yes i redownloaded both last night :)
i 'kinda' resolved it with this:

Code: Select all

			repeat
				local belts = inventory:itemTotalCount(228966)
				local fusion = inventory:itemTotalCount(202999)
				openMailbox()
				UMM_DeleteEmptyMail()
				UMM_TakeMail()
			until belts == 27 and fusion == 27 
this works, but like this: it opens mailbox, deletes failed mails ok, gets the first 5 attachments VERY FAST, it closes, leaves these mails without attachments undeleted, and it will open again. so it will open mail 5 by 5 until everything is ok.
it works but it doesn't look like the right way.

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 6:07 am
by rock5
The last version of the userfunction is supposed to fix this. Did you delete or overwrite your old version of the userfunction? Or did you rename it as a backup?

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 6:50 am
by silinky
i have my old one renamed as a backup, because i have some customizations there.
the new one is loaded though, because the old one does not contain the function: UMM_DeleteEmptyMail()

my UMM is: Version: 1.6.5.1676

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 7:14 am
by rock5
If the old file still starts with "userfunctions_" and ends with ".lua" then it will get loaded as well. So if the old one loads last then the duplicate functions will be overwritten. UMM_DeleteEmptyMail() doesn't exist in the old file so doesn't get overwritten but all the other functions will.

I usually change the extention to "._lua". Try that.

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 8:02 am
by silinky
these are my userfunctions, i don't think i have the old one here.
Clipboard01.jpg
didn't know this bug is so hard to track down, if you cannot reproduce it, then it must be something on my side.

i am guessing the closing occurs somewhere here?

Code: Select all

	repeat
		yrest(5000)
		InboxCount = taggedCount()
		if InboxCount == lastInboxCount then
			-- Stuck
			RoMScript("HideUIPanel(MailFrame)")
			break
		end
		lastInboxCount = InboxCount
	until RoMScript("UMMMailManager.priv_AutoRunning") == nil

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 4:24 pm
by ZZZZZ
The addon_Rock5s_Mail_Functions files, move the old one to a new folder called "Backup" or something, then try again.

The issue you describe was definitely fixed with the latest Mail Function release, I had the exact same issue but not any more.

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 6:23 pm
by silinky
ZZZZZ wrote:The addon_Rock5s_Mail_Functions files, move the old one to a new folder called "Backup" or something, then try again.

The issue you describe was definitely fixed with the latest Mail Function release, I had the exact same issue but not any more.
well, i deleted it completely, and you are right. somehow it got loaded even with another extension. this fixed also another bug where it wouldn't wanted to open some mailboxes even if the char was near.
also, as a suggestion i would recommend introducing RoMScript("MailFrame:Show()"); RoMScript("MailFrame:Hide()") into the addon somewhere maybe in openMailbox(), because i get frequent errors concerning these.

thanks for the ideas and for this wonderful addon :)

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 8:51 pm
by cibervagos
Hi Rock5! I always get this error. Any idea??

IGF:\UMMFrameTab1Tools:ButtonClick('take');\:IGF [string "?"]:54: attempt to concatenate field 'Subject' (a nil value)

Re: Rock5's Mail Mods

Posted: Mon Jun 23, 2014 10:51 pm
by rock5
silinky wrote:you are right. somehow it got loaded even with another extension.
I had a look at the pattern the bot uses. It looks like it doesn't require that the name start with "userfunction_" and end with ".lua" only that it contain them. So "blahuserfunction_name.luablah" would still match. Obviously the simple fix would be to make sure there is no "userfunction_" or ".lua" in the name but I'll add a fix to the next version of the bot to make sure it starts and ends with those strings. BTW here is a demonstration of the pattern it uses. It still finds a match.

Code: Select all

Lua> v = "addon_rock5s_mail_functions.lua.bak" print(string.match(v, "addon_(.*)%.lua"))
rock5s_mail_functions
Lua> v = "bakaddon_rock5s_mail_functions.lua" print(string.match(v, "addon_(.*)%.lua"))
rock5s_mail_functions
This is what I'll change it too.

Code: Select all

Lua> v = "addon_rock5s_mail_functions.lua.bak" print(string.match(v, "^addon_(.*)%.lua$"))
nil
Lua> v = "bakaddon_rock5s_mail_functions.lua" print(string.match(v, "^addon_(.*)%.lua$"))
nil
Lua> v = "addon_rock5s_mail_functions.lua" print(string.match(v, "^addon_(.*)%.lua$"))
rock5s_mail_functions
cibervagos wrote:IGF:\UMMFrameTab1Tools:ButtonClick('take');\:IGF [string "?"]:54: attempt to concatenate field 'Subject' (a nil value)
Maybe there is something wrong with your UMM addon. Try reinstalling it. That's the addon in the games interface/addon folder. Don't forget to restart the game after updating it. If you want to keep your old version of the addon as a backup, move it to another location, don't just rename it.

Re: Rock5's Mail Mods

Posted: Wed Jun 25, 2014 9:06 pm
by cibervagos
Hi again.. I delete my UMM folder and I download again. But I get the same error. some times works. But when I change character doesn't work anymore. If I call UMM_TakeMail() from command line works. But if I put in a waypoint file, just work first time (sometimes) and I get error when I change character or doesn't work at all.

One more time I need to apologies for my english :oops:

Re: Rock5's Mail Mods

Posted: Thu Jun 26, 2014 12:24 am
by rock5
I don't know. It works for me. Do you recieve any unusual mails? When it fails, does it fail again as soon as you restart it? Does it fail on a particular mail?

Unless you can pinpoint the cause or can consistently reproduce the error, there is not much I can do.

Re: Rock5's Mail Mods

Posted: Sat Aug 02, 2014 4:46 pm
by cibervagos
Hi! I have some info about my problem. I found this error on RoM windows.

call ifg_events_Frame's OnEvent, line: [string "?"]:72: attempt to index global 'os' (a nil value)

and

call UMMMasterFrame's OnUpdate, line: [string "?"]:54: attempt to concatenate field 'subject' (a nil value)

Re: Rock5's Mail Mods

Posted: Sat Aug 02, 2014 10:43 pm
by rock5
The first error tells me you need an 'os' replacement addon such as d303fix. This is pretty much a needed requirement for the bot. There are probably some things you could do without this addon but a lot of things need this addon especially a lot of core userfunctions. And when you get an error due to not having it it's often hard to figure out the cause. So just install it.

I'm not sure about the second error. It could in some way be caused by the above problem so I would add the addon first and see if it reoccurs. Otherwise it seems to indicate a message with an empty subject. Are you aware if you received a mail with no subject?

Edit: Did some testing. Looks like it's impossible to send a mail with nil subject so that can't be the cause of your second error.

Re: Rock5's Mail Mods

Posted: Tue Aug 12, 2014 12:05 pm
by cibervagos
Hi again!
rock5 wrote: The first error tells me you need an 'os' replacement addon such as d303fix. This is pretty much a needed requirement for the bot. There are probably some things you could do without this addon but a lot of things need this addon especially a lot of core userfunctions. And when you get an error due to not having it it's often hard to figure out the cause. So just install it.
Well, I install d303fix and 'os' problem is solved. But d303fix causes much other issues in my game. Other addons stop working like pbinfo and DIYCE. And 'subject' still be a nil :(
rock5 wrote: I'm not sure about the second error. It could in some way be caused by the above problem so I would add the addon first and see if it reoccurs. Otherwise it seems to indicate a message with an empty subject. Are you aware if you received a mail with no subject?


All of my mail have a subject, and subject appear in list. But I guess here local packageIcon, sender, subject, COD, moneyMode, money, daysLeft, paperStyle, items, wasRead, wasReturned, canReply = GetInboxHeaderInfo(index); I have the problem. So I quit d303fix and fix the 'subject' problem:

Code: Select all

if (subject) then
	newMail.Subject = subject;
else
	newMail.Subject = "error";
end
(and 'os' message error gone too :shock: )

But with a solved subject new error appear :cry: . Now ItemQueueLength is a nil value.
rock5 wrote: Edit: Did some testing. Looks like it's impossible to send a mail with nil subject so that can't be the cause of your second error.
I dont try to send a mail. I try to take a mail. But I will do some test to see if is an addon problem or not. Be couse the addon work fine if I use manually in game.

Re: Rock5's Mail Mods

Posted: Tue Aug 12, 2014 12:54 pm
by rock5
cibervagos wrote:But d303fix causes much other issues in my game. Other addons stop working like pbinfo and DIYCE.
You have something majorly wrong. d303fix should not cause problems with addons. In fact it should fix some addons that need the os functions. Even pbinfo needs it for some features. Here is a quote from the d303fix curse page.
IMPORTANT

Any features using the recently removed os.* functions are available only if you install an addon providing these, e.g. d303Fix.
cibervagos wrote:But with a solved subject new error appear :cry: . Now ItemQueueLength is a nil value.
I think there is something buggy with your game.

Maybe you have an addon that is interfering with other addons and the bot. An easy way to test this is to remove all the other addons and see it it works. Note: removing addons may cause the game to loose any settings. Back up your savevariables.lua file so you can restore it later after you return your addons.

Or maybe you have a corrupt macro.bsd. This has been known to cause problems with the bot in the past. Macro.bsd is saved for each character. Are you having the problem with particular characters or all of them?

Re: Rock5's Mail Mods

Posted: Fri Aug 15, 2014 8:39 pm
by Rickster
I tried to send mail in Hortek for the first time. There are two mailboxes, but both do not open automatically when sending.
Do I have to target them manually, as in the beginning of the userfunction, before Rock5 added this great feature?

Ric

Re: Rock5's Mail Mods

Posted: Sat Aug 16, 2014 3:31 am
by rock5
I suspect it's the usual problem, the mailboxes don't have the floating mail icon over them. Is this the case?

Mailboxes can have different names so this userfunction searches for the icon that floats over the mail boxes and uses that to find the mailbox. I've already added 2 exceptions for Hyern and Muckgale Port which don't have the floating icon. I suspect, going forward, that more and more mailboxes will be added without the floating mail icon. I can't just keep adding exceptions. I think I will change the function so, hopefully, it wont be necessary in the future. It looks like all new mailboxes are called "Mailbox". Maybe I'll search for "Mailbox" or the floating icon. That should find all mailboxes to date. I'll work on it and post something soon.