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
kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Rock5's Mail Mods

#501 Post by kuripot » Sun Aug 04, 2013 4:50 am

did i missed or i overlook but i cant find how to use portable mailbox in sending

Code: Select all

/run ToggleTimeFlagPopupMenu()

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

Re: Rock5's Mail Mods

#502 Post by rock5 » Sun Aug 04, 2013 5:48 am

You don't need to open the mailbox to use these userfunctions, the bot opens them automatically. If there is a mailbox nearby it will use that. Otherwise it will see if you have a rented mailbox and use that. Lastly it will check if you have a 1 or 7 day 'convenient' mailbox.
  • 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
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Rock5's Mail Mods

#503 Post by Lamkefyned » Tue Aug 20, 2013 11:25 am

hello
how do I send packs "guardian dog meat" and then to leave a pack of 99 and double it through the holes you have?
If you think something is right just because everyone else believes,you're not thinking.

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

Re: Rock5's Mail Mods

#504 Post by Rickster » Wed Aug 21, 2013 2:05 am

rock5 wrote:@Rickster, when it get's stuck in a relog loop does it open the mailbox and try to send each time? Or does it just relog without opening the mailbox?
sorry for the late feedback.
it took me some time to get the right conditions for testing.

but strange things are happening and i am only confused after those testings :D

none of the umm send functions work as a expected when the recipients mailbox is full. the ingame onscreen message correctly informs about the full mailbox, but then relogging starts in an endless loop, instead of continuing. after reloggin it does not open the mailbox before relogging again.

except UMM_SendByFusedTierLevel(), which correctly recognises the full mailbox. but when sending to an alternative char, by checking the (correct) return values from first try, it also ends in an infinite loop of reloggin, although, the alts mailbox is not full.

so in none case i got to send items to an alternative char, when the primary recipients mailbox is full ... which finaly is my goal.

unfortunately this stops all my scripts, where sending to a full mailbox.
this is even more worse, thinking back to times, when we could not react on sending results and items where just left in the bags, without knowing what happend.

for sure rock5, i love the new possibilities, as you can react on errors when sending mail.
but i have restless nights thinking about this :D ... as i am not sure, how to start from scratch to set up a test environment to eliminate errors step by step.

Ric

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

Re: Rock5's Mail Mods

#505 Post by rock5 » Wed Aug 21, 2013 2:30 am

If you have done some code to "react on errors" then the bug could be in your code. What does your mailing code look like?
  • 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

#506 Post by Rickster » Wed Aug 21, 2013 3:19 am

ambolia wrote:hello
how do I send packs "guardian dog meat" and then to leave a pack of 99 and double it through the holes you have?
to send Guard Dog Meat and and keep a stack of 99 you can use this

Code: Select all

id_watchdogmeat = 209453
num_meat = inventory:itemTotalCount(id_watchdogmeat) -- watchdog meat
num_meatToSend = num_meat - 99 -- keep one stack of meat
UMM_SendByNameOrId(_recipient, {id_watchdogmeat}, num_meatToSend) -- send the meat
to split the rest over the free bag slots this comes to my mind, but i did not test it

Code: Select all

for slot = 1, 240 do
	if 0 >= inventory:itemTotalCount(0,"bags") then break end -- stop the loop if there are no free bag slots

	item = inventory.BagSlot[slot]
	
	-- if there is an item, check if its watchdogmeat and if there is enough to split
	if item.Available and not item.Empty and item.Id == id_watchdogmeat and inventory:itemTotalCount(id_watchdogmeat) >= 2 then
		while (inventory:itemTotalCount(0,"bags") >= 1 do -- while at least one free bag slot
			RoMScript("SplitBagItem("..slot..","..1..")"); yrest(300)
		end
	end
end;
I did not find much info about SplitBagItem(), but here are some infos about it:
http://runesofmagic.gamepedia.com/API:SplitBagItem

and there is a topic about it on solarstrike:
http://www.solarstrike.net/phpBB3/viewt ... =21&t=4775
Last edited by Rickster on Wed Aug 21, 2013 3:36 am, edited 1 time in total.

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

Re: Rock5's Mail Mods

#507 Post by Rickster » Wed Aug 21, 2013 3:35 am

rock5 wrote:If you have done some code to "react on errors" then the bug could be in your code. What does your mailing code look like?
i use this to send to an alt, in case of the primary recipients mailbox is full

Code: Select all

			local success, err_msg = UMM_SendByFusedTierLevel(char1, 5)
			if success==false then
					UMM_SendByFusedTierLevel(char2, 5)
				end
			end
all other UMM_Send... functions start to relog in case the recipients mailbox is full.i use something like this to just log the errors and want the scripts to just continue without sending mail

Code: Select all

			local success, err_msg = UMM_Send...(...)
			if success==false then
					logMailStatus(_recipient, success, err_msg, _debug_mode) -- own log function
				end
			end
i use Version 1.82b4 of your mail functions.

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

Re: Rock5's Mail Mods

#508 Post by rock5 » Wed Aug 21, 2013 6:10 am

I just tested it and it works fine. I'm testing with the latest userfunction version 1.82b4 and I tested with both my 1.2 version of the UMM addon and the 2012 version available at curse. I was using

Code: Select all

UMM_SendByNameOrId("recip", {"Obsidian Arrow"}, 30)
Ok, just discovered that when you get the bag full warning one of the items to be sent gets locked. You can't move it or send it until you close the mailbox. So I have it close the mailbox if it gets that error.

Also if trying to send only 1 item to the bag full recipient it fails to detect the warning message. I think it's a timing issue. I've fixed that too.

Try this file.

<< -- File deleted. File on first post updated -- >>
  • 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
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Rock5's Mail Mods

#509 Post by Lamkefyned » Wed Aug 21, 2013 6:38 am

Rickster wrote:
ambolia wrote:hello
how do I send packs "guardian dog meat" and then to leave a pack of 99 and double it through the holes you have?
to send Guard Dog Meat and and keep a stack of 99 you can use this

Code: Select all

id_watchdogmeat = 209453
num_meat = inventory:itemTotalCount(id_watchdogmeat) -- watchdog meat
num_meatToSend = num_meat - 99 -- keep one stack of meat
UMM_SendByNameOrId(_recipient, {id_watchdogmeat}, num_meatToSend) -- send the meat
to split the rest over the free bag slots this comes to my mind, but i did not test it

Code: Select all

for slot = 1, 240 do
	if 0 >= inventory:itemTotalCount(0,"bags") then break end -- stop the loop if there are no free bag slots

	item = inventory.BagSlot[slot]
	
	-- if there is an item, check if its watchdogmeat and if there is enough to split
	if item.Available and not item.Empty and item.Id == id_watchdogmeat and inventory:itemTotalCount(id_watchdogmeat) >= 2 then
		while (inventory:itemTotalCount(0,"bags") >= 1 do -- while at least one free bag slot
			RoMScript("SplitBagItem("..slot..","..1..")"); yrest(300)
		end
	end
end;
I did not find much info about SplitBagItem(), but here are some infos about it:
http://runesofmagic.gamepedia.com/API:SplitBagItem

and there is a topic about it on solarstrike:
http://www.solarstrike.net/phpBB3/viewt ... =21&t=4775
hello and as I put it?

be so?

Code: Select all

<!-- #  3 --><waypoint x="6394" z="3497" y="158">
id_watchdogmeat = 209453
num_meat = inventory:itemTotalCount(id_watchdogmeat) -- watchdog meat
num_meatToSend = num_meat - 99 -- keep one stack of meat
UMM_SendByNameOrId(_recipient, {id_watchdogmeat}, num_meatToSend) -- send the meat
</waypoint>
If you think something is right just because everyone else believes,you're not thinking.

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

Re: Rock5's Mail Mods

#510 Post by Rickster » Wed Aug 21, 2013 7:33 am

yes, just put it into a waypoint and be sure there is a mailbox nearby

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Rock5's Mail Mods

#511 Post by Lamkefyned » Thu Aug 22, 2013 9:35 am

ambolia wrote:
Rickster wrote:
ambolia wrote:hello
how do I send packs "guardian dog meat" and then to leave a pack of 99 and double it through the holes you have?
to send Guard Dog Meat and and keep a stack of 99 you can use this

Code: Select all

id_watchdogmeat = 209453
num_meat = inventory:itemTotalCount(id_watchdogmeat) -- watchdog meat
num_meatToSend = num_meat - 99 -- keep one stack of meat
UMM_SendByNameOrId(_recipient, {id_watchdogmeat}, num_meatToSend) -- send the meat
to split the rest over the free bag slots this comes to my mind, but i did not test it

Code: Select all

for slot = 1, 240 do
	if 0 >= inventory:itemTotalCount(0,"bags") then break end -- stop the loop if there are no free bag slots

	item = inventory.BagSlot[slot]
	
	-- if there is an item, check if its watchdogmeat and if there is enough to split
	if item.Available and not item.Empty and item.Id == id_watchdogmeat and inventory:itemTotalCount(id_watchdogmeat) >= 2 then
		while (inventory:itemTotalCount(0,"bags") >= 1 do -- while at least one free bag slot
			RoMScript("SplitBagItem("..slot..","..1..")"); yrest(300)
		end
	end
end;
I did not find much info about SplitBagItem(), but here are some infos about it:
http://runesofmagic.gamepedia.com/API:SplitBagItem

and there is a topic about it on solarstrike:
http://www.solarstrike.net/phpBB3/viewt ... =21&t=4775
hello and as I put it?

be so?

Code: Select all

<!-- #  3 --><waypoint x="6394" z="3497" y="158">
id_watchdogmeat = 209453
num_meat = inventory:itemTotalCount(id_watchdogmeat) -- watchdog meat
num_meatToSend = num_meat - 99 -- keep one stack of meat
UMM_SendByNameOrId(_recipient, {id_watchdogmeat}, num_meatToSend) -- send the meat
</waypoint>
the dealer does not work as I put it? in onload?
If you think something is right just because everyone else believes,you're not thinking.

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

Re: Rock5's Mail Mods

#512 Post by Rickster » Thu Aug 22, 2013 11:33 am

I do not exactly understand what mean.

Does the mailbox open, when you use your code?

For testing you can use this and insert specific values:

Code: Select all

UMM_SendByNameOrId("recipient name", {"name of guard dog meat ini your language"}, NumberOfItemsToSend)
player:sleep()
if that works you can try to calculate how much you have and how much you want to send.

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

Re: Rock5's Mail Mods

#513 Post by lolita » Thu Aug 22, 2013 3:34 pm

why you inventing hot water, you can find it anywhere :D
simply use

Code: Select all

UMM_SendByNameOrId("Charname", 209453, 99)
Life is a journey, not destination :D

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

Re: Rock5's Mail Mods

#514 Post by Rickster » Thu Aug 22, 2013 5:29 pm

ambolia wants to keep one stack, but you are sending one stack.

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

Re: Rock5's Mail Mods

#515 Post by lolita » Fri Aug 23, 2013 4:36 pm

well this is hard to understand
ambolia wrote:hello and as I put it?
be so?
_____________________
the dealer does not work as I put it? in onload?
any way put this onload to your waypoint

Code: Select all

<onLoad>
	function give_name_to_this_function()
		num_meat = inventory:itemTotalCount(209453) -- watchdog meat
		num_meatToSend = num_meat - 99 -- keep one stack of meat
		UMM_SendByNameOrId("CharName", 209453, num_meatToSend) -- change "CharName" with your recipient
	end
</onLoad>
and use in on some of your waypoint's

Code: Select all

<!-- #  1 --><waypoint x="6394" z="3497" y="158">
	give_name_to_this_function()
	<waypoint>
Life is a journey, not destination :D

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

Re: Rock5's Mail Mods

#516 Post by Rickster » Tue Aug 27, 2013 3:21 am

Referring to the problem, sending mail to chars with full mailboxes.
rock5 wrote:Ok, just discovered that when you get the bag full warning one of the items to be sent gets locked. You can't move it or send it until you close the mailbox. So I have it close the mailbox if it gets that error.

Also if trying to send only 1 item to the bag full recipient it fails to detect the warning message. I think it's a timing issue. I've fixed that too.

Try this file.
I tried version 1.82b5 and tested it with UMM_SendByFusedTierLevel sending to a full mailbox. I tested it lots of times now, sending lots of mails while running the client for a very long time and after changing chars. There were no errors like before.
The recipients full mailbox was allways recognised, the return values were correct and there was no relogging anymore, caused by a full recipients mailbox.
This seems to work fine now :)

Thank you Rock!

[edit] Tested it with some other UMM_... functions and it also works without errors :)

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Rock5's Mail Mods

#517 Post by kuripot » Sat Oct 26, 2013 8:01 pm

Code: Select all

Mailing delayed. Reloging before continuing.
The game client did not crash.
8:54am - IGF:\ChangeChar(CHARACTER_SELECT.selectedIndex)\ [string "local a={Chan
geChar(CHARACTER_SELECT.select..."]:1: attempt to call global 'ChangeChar' (a ni
l value)


AL lib: FreeContext: (00C1CF68) Deleting 1 Source(s)
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>

I i need to set up fastlogin... only relog?? how??

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

Re: Rock5's Mail Mods

#518 Post by rock5 » Sat Oct 26, 2013 9:53 pm

Even just relogging back into the same account requires the account information. Add the account information as instructed and it should work.
  • 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

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Rock5's Mail Mods

#519 Post by kuripot » Tue Oct 29, 2013 8:24 pm

how to repeat the command... i wanted to buy 5 stone then repeat until reached 27 pcs

Code: Select all

	<onLoad>	
	function fusioncheck()
		if inventory:itemTotalCount(202999) >= 27 then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("padala"));
			else
			__WPL:setWaypointIndex(__WPL:findWaypointTag("pabili"));
		end
	end



      function MakeMaxManaStones()
         -- Setup config options
         Fusion_Config("Use Item Whitelist", false)
         Fusion_Config("Fusion Stones", true)
         Fusion_Config("Green", true)
         Fusion_Config("Speed", .7)

         -- Open dialogs
         if RoMScript("AdvancedMagicBoxFrame ~= nil") then
            RoMScript("AdvancedMagicBoxFrame:Show()"); yrest(1500)
            RoMScript("FusionFrame2:Show()"); yrest(1500)
            RoMScript("Fusion_Max(FusionFrame2_Max)") yrest(1500)
            print("Now Fusing ...")
            RoMScript("Fusion_QueueManastones(FusionFrame2_Do)");
         else
            RoMScript("MagicBoxFrame:Show()"); yrest(1500)
            RoMScript("FusionFrame1:Show()"); yrest(1500)
            RoMScript("Fusion_Max(FusionFrame1_Max)") yrest(1500)
            print("Now Fusing ...")
            RoMScript("Fusion_QueueManastones(FusionFrame1_Do)");
         end

         repeat
            yrest(1500)
         until RoMScript("Fusion.LastGrad")==0

         -- close
         yrest(2000)
         if RoMScript("AdvancedMagicBoxFrame ~= nil") then
            RoMScript("AdvancedMagicBoxFrame:Hide()"); yrest(500)
         else
            RoMScript("MagicBoxFrame:Hide()"); yrest(500)
         end
      end

	
	</onLoad>
	<!-- #  1 --><waypoint x="-23029" z="4584" tag="pabili">
			sendMacro("CloseWindows()")
	         player:openStore("Leskar Prole"); yrest(2000);
		         sendMacro("ChoiceOption(1);"); yrest(2000);
		         inventory:storeBuyItem(202999,6)
		         yrest(2000)
			 fusioncheck()
		         yrest(1000)
	</waypoint>
when i use this my char ere go to next point then back to npc again and agiain.. i want my char only standing in npc then 5 pcs then repeat buying 5 pcs until reached 27

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

Re: Rock5's Mail Mods

#520 Post by rock5 » Tue Oct 29, 2013 11:44 pm

Code: Select all

while 27 > inventory:itemTotalCount("Fusion Stone") do
    inventory:storeBuyItem(202999,5)
end
A better way might be to see how many you have and buy the correct amount.

Code: Select all

local have = inventory:itemTotalCount("Fusion Stone")
if 27 > have then
    inventory:storeBuyItem(202999,27-have)
end
Although, counting the fusion stones in your inventory could be trickier. If you have Fusion Stones from mini games and Random Fusion Stones previously purchased in your inventory you would have to count both, eg.

Code: Select all

local have = inventory:itemTotalCount("Fusion Stone") + inventory:itemTotalCount("Random Fusion Stone")
  • 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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest