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
nokirk
Posts: 73
Joined: Sat Jul 03, 2010 2:26 pm

Opening the rented Mail Box

#41 Post by nokirk » Tue Sep 21, 2010 11:02 pm

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

Code: Select all

sendMacro("MailFrame:Show()");
and send your stuff while running around.

nokirk
Posts: 73
Joined: Sat Jul 03, 2010 2:26 pm

Re: Rock5's Mail Mods

#42 Post by nokirk » Wed Sep 22, 2010 3:37 am

just figured out that

Code: Select all

sendMacro("OpenMail()");
and

Code: Select all

sendMacro("CloseMail()");
is actually better because with MailFrame:Show it doesn't load UMM.

Velsharon
Posts: 12
Joined: Wed May 26, 2010 8:59 pm

Re: Rock5's Mail Mods

#43 Post by Velsharon » Wed Sep 22, 2010 7:23 pm

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>

nokirk
Posts: 73
Joined: Sat Jul 03, 2010 2:26 pm

Problem with waypoint

#44 Post by nokirk » Wed Sep 22, 2010 7:27 pm

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)

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

Re: Rock5's Mail Mods

#45 Post by rock5 » Thu Sep 23, 2010 1:02 am

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.
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Mail Mods

#46 Post by rock5 » Thu Sep 23, 2010 1:20 am

I added the fix I mentioned above to version 1.21. You can download it from 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

Velsharon
Posts: 12
Joined: Wed May 26, 2010 8:59 pm

Re: Rock5's Mail Mods

#47 Post by Velsharon » Thu Sep 23, 2010 4:35 am

Thanks for the comments Rock5. I'm learning lua little by little :D

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.

Kinzo23
Posts: 5
Joined: Fri Mar 06, 2009 10:20 pm

Re: Rock5's Mail Mods

#48 Post by Kinzo23 » Sun Sep 26, 2010 4:53 pm

How do I open the UMM mail interface ?

Code: Select all

[sendMacro("OpenMail()")
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.

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

Re: Rock5's Mail Mods

#49 Post by rock5 » Mon Sep 27, 2010 3:22 am

Kinzo23 wrote:How do I open the UMM mail interface ?

Code: Select all

sendMacro("OpenMail()")
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?
  • 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

Kinzo23
Posts: 5
Joined: Fri Mar 06, 2009 10:20 pm

Re: Rock5's Mail Mods

#50 Post by Kinzo23 » Mon Sep 27, 2010 12:08 pm

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

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

Re: Rock5's Mail Mods

#51 Post by rock5 » Mon Sep 27, 2010 9:51 pm

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.
  • 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

Bothox
Posts: 2
Joined: Mon Sep 27, 2010 8:56 pm

Re: Rock5's Mail Mods

#52 Post by Bothox » Tue Sep 28, 2010 9:11 am

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

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

Re: Rock5's Mail Mods

#53 Post by rock5 » Tue Sep 28, 2010 11:26 pm

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.
  • 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

Nebojsha
Posts: 25
Joined: Sun Nov 15, 2009 10:13 am

Re: Rock5's Mail Mods

#54 Post by Nebojsha » Wed Sep 29, 2010 12:47 pm

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

Bothox
Posts: 2
Joined: Mon Sep 27, 2010 8:56 pm

Re: Rock5's Mail Mods

#55 Post by Bothox » Wed Sep 29, 2010 1:22 pm

thx for helping that much
Last edited by Bothox on Wed Sep 29, 2010 8:15 pm, edited 1 time in total.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Rock5's Mail Mods

#56 Post by Administrator » Wed Sep 29, 2010 4:16 pm

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?

Nebojsha
Posts: 25
Joined: Sun Nov 15, 2009 10:13 am

Re: Rock5's Mail Mods

#57 Post by Nebojsha » Wed Sep 29, 2010 5:50 pm

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.

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

Re: Rock5's Mail Mods

#58 Post by rock5 » Thu Sep 30, 2010 12:15 am

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.
  • 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

Lorelei
Posts: 5
Joined: Wed Jul 07, 2010 4:11 am

Re: Rock5's Mail Mods

#59 Post by Lorelei » Sun Oct 03, 2010 4:59 am

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? :|

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

Re: Rock5's Mail Mods

#60 Post by rock5 » Sun Oct 03, 2010 8:01 pm

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?
  • 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 3 guests