Rock5's Mail Mods

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#441 Post by rock5 » Sun Jun 23, 2013 2:28 am

Updated to Version 1.81
  • - Added exception for the Hyern mailbox.
    - Added support for tier 5 items.
    - UMM_SendIntentoryItem can now also accept a table of items and slotnumbers.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#442 Post by Rickster » Sun Jun 23, 2013 3:32 am

Thanx Rock! Good job!

Ric

p.s. you left the debugfilter enabled

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#443 Post by rock5 » Sun Jun 23, 2013 5:15 am

Rickster wrote:p.s. you left the debugfilter enabled
Thanks. Fixed.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#444 Post by Rickster » Tue Jun 25, 2013 4:22 am

My server is down for maintanance right now, so I have time to get through some probs and questions I have :)
  1. Relogging on mailsend

    When I send some mails to a recipient, whos mailbox is full, the bot relogs in an endless loop.
    The behaviour I would prefer is that it just stops sending, skips an additional try to send mail and continues with the next waypoint or whatelse task it has to do by the script.
    Can I get the behaviour of the bot like this and maybe get some return values that it skipped sending mails to this recipient? The idea is to write that info to a logfile (no explanation needed on that) to get to this char later on and clear the mailbox.
    UMM_SetOneUseMailboxRelog(_boolean)

    When reaching the sending limit, UMM can now relog and continue sending when using a mailbox, rented portable mailbox or IS purchased convenient mailbox. By default it wont relog when using single-use convenient mailboxes as it might be wasteful. If you still want it to relog and use another single-use mailbox then set this option to true before sending.
    Does this only trigger when using OneUseMailboxes, or also skips relogging at normal mailboxes?
  2. Sending jewels for T5

    In some regions there drop items from bags, which make a manastone of tier 5. These items are most of the time jewels (necklaces, rings, earrings).
    _fusedtier - [..] Sends only armor and weapons.
    I have not tried jet, but does this also trigger for jewels?

    In itemtypestable.lua for the german client jewels are listed as "Schmuckstücke".
    So does the following code sends blue jewels with at least level 74?

    Code: Select all

    UMM_SendAdvanced("recipient", nil, 2, 74, nil, "Schmuckstücke")
Thanx
Ric

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#445 Post by Rickster » Tue Jun 25, 2013 4:29 am

rock5 wrote:Updated to Version 1.81
  • - UMM_SendIntentoryItem can now also accept a table of items and slotnumbers.
Maybe you want to change the documentation to
UMM_SendInventoryItem(_recipient, _item)

Sends a specific slot item. Useful if you have selected the item yourself with your own code. Can accept an item object or slot number (61 to 240) or a table of item objects or slotnumbers.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#446 Post by rock5 » Tue Jun 25, 2013 5:36 am

1. I never fixed this before, I think, because the UMM interface can't supply the reason the send failed but the bot now has an easy way to check for system messages. It usually displays something like "Recipient's mailbox is full!" right? I can add a check for that.

UMM_SetOneUseMailboxRelog is just for stopping it wasting a lot of 1 use mailboxes if it can't send.

2.
Rickster wrote:These items are most of the time jewels (necklaces, rings, earrings)
Necklaces, rings and earrings are 'armor' and are usually included when using _fusedtier.
Rickster wrote:UMM_SendAdvanced("recipient", nil, 2, 74, nil, "Schmuckstücke")
That looks correct.
Rickster wrote:Maybe you want to change the documentation
I'll update it.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#447 Post by Rickster » Tue Jun 25, 2013 6:36 am

rock5 wrote:1. I never fixed this before, I think, because the UMM interface can't supply the reason the send failed but the bot now has an easy way to check for system messages. It usually displays something like "Recipient's mailbox is full!" right? I can add a check for that.
That would be great! :)
Yes, it displays a red on screen message, I am not sure about the exact text ... I play on a german client and will look at it later, as soon as a recipients mailbox is full ;)
Maybe you can set it to use a language string or make the search string a useroption.
Can you make the userfunction to return something like "recipientmailboxfull" if it detects that system message?
rock5 wrote:2.
Rickster wrote:These items are most of the time jewels (necklaces, rings, earrings)
Necklaces, rings and earrings are 'armor' and are usually included when using _fusedtier.
A closer look at itemtypestable.lua should have prevented my unnecessary question ;)

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#448 Post by rock5 » Tue Jun 25, 2013 7:24 am

Yes I'll use a language string. I found that one, I think it's the right one. In German it is "Empfänger-Postfach ist voll!". Looks like ROM.dbLanguageFileConverter doesn't show the characters properly.

Sorry, I forgot to mention about returned values. I'll probably have it return true/false for first argument and if false then an error message as a second argument, eg.

Code: Select all

success, err = UMM_Sendfunction(....)
if not success then
    -- Take action depending on error message
    if err == "Recipients bags are full" then
        -- take appropriate action
etc...
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#449 Post by Rickster » Tue Jun 25, 2013 10:10 am

That sounds very cool! :)

The string in German is: "Empfänger-Postfach ist voll!" (german "Umlaut") ... which most time ends with saving files with supporting codes, which ist not reliable at all, or escaping this characters.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#450 Post by rock5 » Tue Jun 25, 2013 12:37 pm

Try the beta version on the first post.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#451 Post by Rickster » Wed Jun 26, 2013 7:45 am

When starting MM the following error is thrown and mm aborts:

Code: Select all

2:43pm - scripts\rom/bot.lua:79: ... of micromacro/scripts/rom/f
unctions.lua:2313: bad argument #1 to 'gmatch' (string expected, got nil)

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#452 Post by rock5 » Wed Jun 26, 2013 8:34 am

I take it you are using an old version of the bot. The latest has been updated to not use gmatch.

That said, the only way I can see that value being nil is if you called "getTEXT()" with a nil value. I suspect there might be an error in a userfunction. Try removing all your userfunctions and seeing if it starts. If it does then, through the process of elimination, find out which userfunction has the problem.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#453 Post by Rickster » Wed Jun 26, 2013 9:22 am

ok, i will check that, but i can check it in a few hours at the earliest.

only thing i changed from working mm and bot version was this userfunction ... but i will report back soon.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#454 Post by rock5 » Wed Jun 26, 2013 10:04 am

There is a new getTEXT in the UMM userfunction so I had a closer look.

With just a couple of line changes I was able to get getTEXT to work like before and sure enough I got that error. Then I realized I had it doing a getTEXT on function load. That wont work with the old getTEXT because it needed to use RoMScript which hasn't been setup by then.

I've changed it to do the getTEXT when it actually uses the functions so it should work fine now. Hopefully everything else works properly.

I updated the first post beta.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#455 Post by Rickster » Thu Jun 27, 2013 5:31 pm

tested and its going to be a litle difficult for me to explain.

sending to one char works fine, wether its mailbox is full or not.
if its free, the first return value contains true and mail is send.
if its full, the return values contain false and the system message and the chars continues the script.
so one can work with the return values to decide what to do next.

but when again sending to another char, because the mailbox of the first char is full, it does not send to the second char, returning false and also the message that its mailbox is full, although it is not.

i used this code to test it:

Code: Select all

			sendTItemsTo = char1
			sendTItemsToAlternative = char2
			debug_mode = true

			local success1, err_msg1 = UMM_SendByFusedTierLevel(sendTItemsTo, 5)
			if debug_mode then
				cprintf_ex("|purple| returnvalue 1: %s\n",success1)
				player:sleep()
			end
			if not success1 then
				if sendTItemsToAlternative and sendTItemsToAlternative ~= "" then
					local success2, err_msg2 = UMM_SendByFusedTierLevel(sendTItemsToAlternative, 5)
					if debug_mode then
						cprintf_ex("|purple| returnvalue 2: %s\n",success2)
						player:sleep()
					end
					if not success2 then
						-- do something
					end
				end
			end
[edit] ah, i just run out of full mailboxes to test, but had an idea ... maybe my variable names (sendTItemsToAlternative) are too long. if they are internally cut to 12 chars, they are the same :o

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#456 Post by rock5 » Fri Jun 28, 2013 12:20 am

No I don't believe there are limits on variable name length. Where you have

Code: Select all

              if not success2 then
Have it print out the err_msg2.

I can't see what's wrong yet but if you show me what it prints and tel me any other error messages you see and what it does, I might find the problem.

How many items does it take to make a mailbox full anyway?
  • 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

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Rock5's Mail Mods

#457 Post by lolita » Fri Jun 28, 2013 12:26 am

rock5 wrote:How many items does it take to make a mailbox full anyway?
300 items is mail capacity
Life is a journey, not destination :D

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#458 Post by Rickster » Sat Jun 29, 2013 6:10 am

here is the result with the return values.
when the postbox of recipient one is full the return values are correct, but the return valus for the second recipient seem to be always the same than the ones from the first recipient.

Code: Select all

Sending items by fused tier.
Sending items to (char1)...  Recipient's bags are full.
 success1: false, err_msg1: Recipient's bags are full

Sending items by fused tier.
Sending items to (char2)...  Recipient's bags are full.
 success2: false, err_msg2: Recipient's bags are full
right after that i restarted the script, but sent directly to char2 and all is sent as expected.

I use this code to send, nearly the same as i used before.

Code: Select all

			local success1, err_msg1 = UMM_SendByFusedTierLevel(char1, 5)
			err_msg1 = err_msg1 or ""
			cprintf_ex("|purple| success1: %s, err_msg1: %s\n",success1, err_msg1)
			if not success1 then
				if char2 and char2 ~= "" then
					local success2, err_msg2 = UMM_SendByFusedTierLevel(char2, 5)
					err_msg2 = err_msg2 or ""
					cprintf_ex("|purple| success2: %s, err_msg2: %s\n",success2, err_msg2)
					if not success2 then
					 -- too bad :(
					end
				end
			end
Last edited by Rickster on Sat Jun 29, 2013 2:10 pm, edited 1 time in total.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#459 Post by rock5 » Sat Jun 29, 2013 8:22 am

Ok, I think I see the problem. It's skipping the age check. Try this version.
igf_events.lua
(7.23 KiB) Downloaded 162 times
Replace the file in "Runes of Magic/Interface/Addons/ingamefunctions/". Don't forget to restart the game (or do a /script ReloadUI()). Let me know how it goes.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Rock5's Mail Mods

#460 Post by Rickster » Sat Jun 29, 2013 9:45 am

This time, it did not send to recipient one, which is correct, coz the mailbox is full, then it did a relog, where it does not need one, and then send the mails to recipient two:

Code: Select all

Wir versuchen den NPC 122097 zu finden:
Sending items to recipient1 ...  Recipient's bags are full.
 success1: false, err_msg1: Recipient's bags are full

Sending items by fused tier.
Sending items to recipient2 ...
Mailing delayed. Reloging before continuing.
Spieleradresse geändert: 0x4B33FA00
Fernkampffähigkeit gefunden: xxx
Wir versuchen den NPC 122097 zu finden:
Der NPC 'Postfach' wurde erfolgreich ausgewählt. Wir öffnen das Dialogfenster.
Items sent.
 success2: true, err_msg2:
another thing: is there an option or somethinig else to have it not to relog in whatever case, mailbox full, sent too many mails already e.g.?

[edit]
second test resultet in the expected behaviour and send to the second recipient without relogging:

Code: Select all

Sending items by fused tier.
Sending items to recipient1...  Recipient's bags are full.
 success1: false, err_msg1: Recipient's bags are full

Sending items by fused tier.
Sending items to recipient2...  Items sent.
 success2: true, err_msg2:
Last edited by Rickster on Sat Jun 29, 2013 2:11 pm, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests