Page 3 of 39
Opening the rented Mail Box
Posted: Tue Sep 21, 2010 11:02 pm
by nokirk
As it wasn't mentioned in this thread yet and I think it's a very handy option, you can open the rented mail box with
and send your stuff while running around.
Re: Rock5's Mail Mods
Posted: Wed Sep 22, 2010 3:37 am
by nokirk
just figured out that
and
is actually better because with MailFrame:Show it doesn't load UMM.
Re: Rock5's Mail Mods
Posted: Wed Sep 22, 2010 7:23 pm
by Velsharon
Are the Rock5's Mail Mods currently working? I updated to r501, downloaded and installed the modified UMM addon, and put the "addon_Rock5s_Mail_Functions.lua" in the appropriate dir but I'm getting the following error when attempting to use the function "UMM_SendByQuality (Recipient, Quality)".
We found Mailbox and will harvest it.
Sending items to character...
Updating inventory slotnumbers...
.../rom/userfucntions/addon_Rock5s_Mail_Functions.lua:358: error
I think I narrowed it down to the following line in the "updateSlotNumbers()" function
local bagid = RoMScript("GetBagItemInfo("..slot..")")
I think it's returning a nil value. Did the "GetBagItemInfo" API change or something? Looking at the API description, it says it returns 6 values as follows.
local inventoryIndex, icon, name, itemCount, locked, invalid = GetBagItemInfo ( bagIndex )
but it looks like the mod only reserves space for one?
local bagid = RoMScript("GetBagItemInfo("..slot..")")
Though I could be wrong because I don't know much about how lua programming works, lol.
Here is my simple script I'm using to try out the Mail Mods.
<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- # 1 --><waypoint x="-4545" z="6784"> </waypoint>
<!-- # 2 --><waypoint x="-4403" z="6784"> </waypoint>
<!-- # 3 --><waypoint x="-4275" z="6794"> </waypoint>
<!-- # 4 --><waypoint x="-4275" z="6794">
yrest(1000);
player:target_Object(114779,1000);
UMM_SendByQuality("character", 1)
yrest(1000);
player:sleep();
</waypoint>
</waypoints>
Problem with waypoint
Posted: Wed Sep 22, 2010 7:27 pm
by nokirk
I'm having a little trouble with the bot executing some commands. This is the code I'm using to send some specific items:
Code: Select all
<!-- # 25 --><waypoint x="2749" z="30814"> if ( inventory:itemTotalCount(207439) > 5 ) then
printf("Sending Items");
sendMacro("OpenMail()");yrest(300);
UMM_SendByNameOrId ("xy", {"Pukarifell"});yrest(500);
sendMacro("MailFrame:Hide()"); end
</waypoint>
The problem is that even though the requirements are fullfilled, in 4 out of 5 times the bot comes to the waypoint kills a mob but doesn't execute the commands and continous with the next waypoint. Anybody got an idea why it sometimes works and sometimes not? (reminded, the if requirements are fullfilled)
Re: Rock5's Mail Mods
Posted: Thu Sep 23, 2010 1:02 am
by rock5
Velsharon, I have been using my post functions so I know "updateSlotNumbers()" is working. Your post is a bit confusing though. The error says line 358 but there is no 358. Have you been editing my file?
Velsharon wrote:I think I narrowed it down to the following line in the "updateSlotNumbers()" function
local bagid = RoMScript("GetBagItemInfo("..slot..")")
I think it's returning a nil value.
You are correct. That is because RoMScript sometimes returns nil when it shouldn't. It happens rarely but it happens. I should have made that line
Code: Select all
repeat bagid = RoMScript("GetBagItemInfo("..slot..")") until bagid ~= nil
that way it should never be nil. I use that trick in many of my scripts.
Velsharon wrote: Did the "GetBagItemInfo" API change or something? Looking at the API description, it says it returns 6 values as follows.
local inventoryIndex, icon, name, itemCount, locked, invalid = GetBagItemInfo ( bagIndex )
but it looks like the mod only reserves space for one?
local bagid = RoMScript("GetBagItemInfo("..slot..")")
Because I only ask for 1 value then only the first value is returned. That code is correct.
Re: Rock5's Mail Mods
Posted: Thu Sep 23, 2010 1:20 am
by rock5
I added the fix I mentioned above to
version 1.21. You can download it from the
first post.
Re: Rock5's Mail Mods
Posted: Thu Sep 23, 2010 4:35 am
by Velsharon
Thanks for the comments Rock5. I'm learning lua little by little
And yes your correct. I did mod your code a little. I was adding some debug screen prints throughout to try to help find out what was going on. Good catch. Keep up the good work.
Re: Rock5's Mail Mods
Posted: Sun Sep 26, 2010 4:53 pm
by Kinzo23
How do I open the UMM mail interface ?
The above command opens the mailbox, but i keep getting told that the UMM mail interface needs to be loaded before i can use a script for the UMM.
Re: Rock5's Mail Mods
Posted: Mon Sep 27, 2010 3:22 am
by rock5
Kinzo23 wrote:How do I open the UMM mail interface ?
The above command opens the mailbox, but i keep getting told that the UMM mail interface needs to be loaded before i can use a script for the UMM.
I'm assuming you are talking about using a "Convenient Mailbox"?
Did you add a pause after the OpenMail() command to give the UMM interface time to open?
Re: Rock5's Mail Mods
Posted: Mon Sep 27, 2010 12:08 pm
by Kinzo23
I figured it out. I have to use the
Code: Select all
[player:harvest(mail box id); yrest(2000);
I was trying to use the wrong one for the normal mailbox xD
Thanks for the quick reply though Rock5
Re: Rock5's Mail Mods
Posted: Mon Sep 27, 2010 9:51 pm
by rock5
Kinzo23 wrote:I figured it out. I have to use the
Code: Select all
[player:harvest(mail box id); yrest(2000);
I was trying to use the wrong one for the normal mailbox xD
Thanks for the quick reply though Rock5
If you are not using the "Convenient Mailbox" then, yes, you need to target a mailbox first.
Ideally you should be using player:target_Object(), eg.
Code: Select all
player:target_Object("Mailbox",2000)
player:harvest() is mainly geared towards collecting ore, wood and herbs. The ability to open other objects was left in only for backward compatibility.
player:target_Object() is also a lot more versatile, eg. you can use names instead of ids.
Re: Rock5's Mail Mods
Posted: Tue Sep 28, 2010 9:11 am
by Bothox
sry if my quest is stupid il wt use the bot to farm daylis and sent it to an alt i have open the mailbox at beginnig i want that it stay open but i dont know after hours of reading how i can sent it i it colect the items but dont sent it away
<?xml version="1.0" encoding="utf-8"?><waypoints>
local f = loadfile( "rom/userfunctions/addon_Rock5s_Mail_Functions.lua");
<!-- # 1 --><waypoint x="xxxx" z="xxxx">player:target_Object("itemname", 8000); </waypoint>
if 10 > inventory:itemTotalCount("itemname") than
player:target_Object("Mailbox",2000)
UMM_SendByNameOrId ("main", {"itemname"}); yrest(500);
end
</waypoints>
sry i know im just in beginning
thx for help or just a lill tip
Re: Rock5's Mail Mods
Posted: Tue Sep 28, 2010 11:26 pm
by rock5
Bothox wrote:sry if my quest is stupid il wt use the bot to farm daylis and sent it to an alt i have open the mailbox at beginnig i want that it stay open but i dont know after hours of reading how i can sent it i it colect the items but dont sent it away
<?xml version="1.0" encoding="utf-8"?><waypoints>
local f = loadfile( "rom/userfunctions/addon_Rock5s_Mail_Functions.lua");
<!-- # 1 --><waypoint x="xxxx" z="xxxx">player:target_Object("itemname", 8000); </waypoint>
if 10 > inventory:itemTotalCount("itemname") than
player:target_Object("Mailbox",2000)
UMM_SendByNameOrId ("main", {"itemname"}); yrest(500);
end
</waypoints>
sry i know im just in beginning
thx for help or just a lill tip
I don't follow everything you are trying to do but you need to know that all code needs to be between open and close tags. This is an open tag <waypoint x="xxxx" z="xxxx"> and this is a close tag </waypoint>
Example:
Code: Select all
<waypoint x="xxxx" z="xxxx"> -- do somwthing </waypoint>
or
Code: Select all
<waypoint x="xxxx" z="xxxx">
-- do somwthing
</waypoint>
This is wrong.
Code: Select all
<waypoint x="xxxx" z="xxxx"></waypoint>
-- This code will not be executed
<waypoint x="xxxx" z="xxxx"></waypoint>
If you want to execute some code when the file gets loaded you can use "onLoad" tags.
Example:
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onloiad>
-- Do some things when you load the file
</onLoad>
<waypoint x="xxxx" z="xxxx">
-- do somwthing at this waypoint
</waypoint>
</waypoints>
I'm not sure why you are trying to load my mail functions file. It should get loaded automatically. If you are trying to make it work with an older version of rombot then you shouldn't be assigning it to variable f. I think you should just be using the 'include' function. I can't guarantee that it will work though.
So it should look something like this;
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
include( "/userfunctions/addon_Rock5s_Mail_Functions.lua");
</onLoad>
<!-- # 1 --><waypoint x="xxxx" z="xxxx">
player:target_Object("itemname", 8000);
if inventory:itemTotalCount("itemname") >=10 than
player:target_Object("Mailbox",2000)
UMM_SendByNameOrId ("main", {"itemname"}); yrest(500);
end
</waypoint>
</waypoints>
Hope that helps.
Re: Rock5's Mail Mods
Posted: Wed Sep 29, 2010 12:47 pm
by Nebojsha
Am I doing something wrong?

Here is part of waypoint that makes problem:
Code: Select all
<!-- # 12 --><waypoint x="2678" z="30816">
if 5 > inventory:itemTotalCount("Pipi Tree Sap") then
__WPL:setWaypointIndex(1) </waypoint>
<!-- # 13 --><waypoint x="2678" z="30816"> UMM_SendByNameOrId("Offshore",{"Pipi Tree Sap"}); </waypoint>
Now I get this bug:
scripts\rom\bot.lua:679: Failed to compile and run Lua code for waypoint #13
I have pretty similair firewood one, and it worked nice
Re: Rock5's Mail Mods
Posted: Wed Sep 29, 2010 1:22 pm
by Bothox
thx for helping that much
Re: Rock5's Mail Mods
Posted: Wed Sep 29, 2010 4:16 pm
by Administrator
Nebojsha wrote:Am I doing something wrong?

Here is part of waypoint that makes problem:
Code: Select all
<!-- # 12 --><waypoint x="2678" z="30816">
if 5 > inventory:itemTotalCount("Pipi Tree Sap") then
__WPL:setWaypointIndex(1) </waypoint>
<!-- # 13 --><waypoint x="2678" z="30816"> UMM_SendByNameOrId("Offshore",{"Pipi Tree Sap"}); </waypoint>
Now I get this bug:
scripts\rom\bot.lua:679: Failed to compile and run Lua code for waypoint #13
I have pretty similair firewood one, and it worked nice
You don't think the missing 'end' has anything to do with it?
Re: Rock5's Mail Mods
Posted: Wed Sep 29, 2010 5:50 pm
by Nebojsha
Thanks, im such a nub

Concerning this type of waypoints, I have question. Is it possible to include in each waypoint check for number of items before sending mail (for example I am at waypoint 3, i check if i have 5 pipi sap, if i have i send it to offshore, if i don't i go to wp 4) I tried doing it, but I always get some error, possibly I do it wrong way.
Re: Rock5's Mail Mods
Posted: Thu Sep 30, 2010 12:15 am
by rock5
Nebojsha wrote:Thanks, im such a nub

Concerning this type of waypoints, I have question. Is it possible to include in each waypoint check for number of items before sending mail (for example I am at waypoint 3, i check if i have 5 pipi sap, if i have i send it to offshore, if i don't i go to wp 4) I tried doing it, but I always get some error, possibly I do it wrong way.
If you are getting an error then you probably are doing something wrong. Of course without the error we can't help you.
Re: Rock5's Mail Mods
Posted: Sun Oct 03, 2010 4:59 am
by Lorelei
I am using Ultimate Mail Mod and the mailbox purchased with diamonds. I am using the code you outlined above Rock, but it's hanging up. Here's the code I used:
Code: Select all
Code:
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
include( "/userfunctions/addon_Rock5s_Mail_Functions.lua");
</onLoad>
<!-- # 1 --><waypoint x="-8549" z="871">
player:target_Object("Pipi Tree Sap", 8000);
if inventory:itemTotalCount("Pipi Tree Sap") >=10 then
player:target_Object("Mailbox",2000)
UMM_SendByNameOrId ("charactername", {"Pipi Tree Sap"}); yrest(500);
end
</waypoint>
</waypoints>
It opens up the mailbox, pauses briefly as it rests, then switches pages on the mailbox to the compose tab, and begins spamming zero's in the sender line (trying to activate the bot macro). It says "update inventory slot numbers" in the bot window at this point. It continues this indefinitely. I've tried playing around with the different coding listed in this thread, but they all hang up at the same place. I downloaded your UMM and mail functions files and put them in the folders indicated. What am I doing wrong?

Re: Rock5's Mail Mods
Posted: Sun Oct 03, 2010 8:01 pm
by rock5
Lorelei wrote:I am using Ultimate Mail Mod and the mailbox purchased with diamonds. I am using the code you outlined above Rock, but it's hanging up. Here's the code I used:
Code: Select all
Code:
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
include( "/userfunctions/addon_Rock5s_Mail_Functions.lua");
</onLoad>
<!-- # 1 --><waypoint x="-8549" z="871">
player:target_Object("Pipi Tree Sap", 8000);
if inventory:itemTotalCount("Pipi Tree Sap") >=10 then
player:target_Object("Mailbox",2000)
UMM_SendByNameOrId ("charactername", {"Pipi Tree Sap"}); yrest(500);
end
</waypoint>
</waypoints>
It opens up the mailbox, pauses briefly as it rests, then switches pages on the mailbox to the compose tab, and begins spamming zero's in the sender line (trying to activate the bot macro). It says "update inventory slot numbers" in the bot window at this point. It continues this indefinitely. I've tried playing around with the different coding listed in this thread, but they all hang up at the same place. I downloaded your UMM and mail functions files and put them in the folders indicated. What am I doing wrong?

How can
Code: Select all
player:target_Object("Mailbox",2000)
work if the mailbox is not near by?
I see that others successfully use
Code: Select all
sendMacro("OpenMail()");yrest(2000)
when using a diamond bought Convenient Mailbox.
Also, I see that you "include" the mail functions file. Is that because you are using an older version of rombot without the addons support?