Code: Select all
sendMacro("MailFrame:Show()");Code: Select all
sendMacro("MailFrame:Show()");Code: Select all
sendMacro("OpenMail()");Code: Select all
sendMacro("CloseMail()");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>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 lineVelsharon 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.
Code: Select all
repeat bagid = RoMScript("GetBagItemInfo("..slot..")") until bagid ~= nilBecause I only ask for 1 value then only the first value is returned. That code is correct.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..")")
Code: Select all
[sendMacro("OpenMail()")I'm assuming you are talking about using a "Convenient Mailbox"?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.Code: Select all
sendMacro("OpenMail()")
Code: Select all
[player:harvest(mail box id); yrest(2000);
If you are not using the "Convenient Mailbox" then, yes, you need to target a mailbox first.Kinzo23 wrote:I figured it out. I have to use theI was trying to use the wrong one for the normal mailbox xDCode: Select all
[player:harvest(mail box id); yrest(2000);
Thanks for the quick reply though Rock5
Code: Select all
player:target_Object("Mailbox",2000)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>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
Code: Select all
<waypoint x="xxxx" z="xxxx"> -- do somwthing </waypoint>Code: Select all
<waypoint x="xxxx" z="xxxx">
-- do somwthing
</waypoint>Code: Select all
<waypoint x="xxxx" z="xxxx"></waypoint>
-- This code will not be executed
<waypoint x="xxxx" z="xxxx"></waypoint>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>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>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>You don't think the missing 'end' has anything to do with it?Nebojsha wrote:Am I doing something wrong?
Here is part of waypoint that makes problem:Now I get this bug: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>
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
If you are getting an error then you probably are doing something wrong. Of course without the error we can't help you.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.
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> How canLorelei 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:
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?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>
Code: Select all
player:target_Object("Mailbox",2000)Code: Select all
sendMacro("OpenMail()");yrest(2000)Users browsing this forum: No registered users and 1 guest