<!-- # 13 --><waypoint x="5220" z="-2178" y="103">
for i = 1, 17 do
sendMacro("EquipItem("..i..")");
yrest(1000)
end
player:target_Object("Mailbox",2000);
yrest(1000)
if player.Name == "toon1" then
UMM_SendByNameOrId("toon2", {"Flannel Gloves","Double Welt Soft Boots","Staff of Witchery"}); yrest (2000);
end
yrest(5000);
sendMacro("}LoginNextToon=true;a={");
sendMacro("Logout();"); yrest(60*1000);
player = CPlayer.new();
settings.load();
yrest (4000)
loadPaths("CoOStart");
</waypoint>
<!-- # 13 --><waypoint x="5220" z="-2178" y="103">
for i = 1, 17 do
sendMacro("EquipItem("..i..")");
yrest(1000)
end
player:target_Object("Mailbox",2000);
yrest(1000)
if player.Name == "toon1" then
UMM_SendByStatNumber("toon2", 4); yrest (2000);
end
yrest(5000);
sendMacro("}LoginNextToon=true;a={");
sendMacro("Logout();"); yrest(60*1000);
player = CPlayer.new();
settings.load();
yrest (4000)
loadPaths("CoOStart");
</waypoint>
I always got an error saying "please close the mailbox interface...", toon1 sends first bag slot item or gives bound error if it is bound. Then it logs off swaps characters and next character "toon2" logs on but mailbox won't open get "Please close mailbox interface..." WTF?
It worked fine when I clean booted in other words if I had accessed the mailbox with "toon1" and got mailbox error couldn't open it with "toon2" but if I restarted ROM and MM the "toon1" would send items correctly. I think this indicates 2 problems one is the mail box interface error and the other is the UMM_SendByNameOrId line 214 error. Hope this helps with the problem, just rolling manually for now
There is a bug in the game that if you change character without closing the mailbox then the next character will think it's still open. When this happens the only way I've found to open the mailbox is to use the following command,
So just add that to your script before relogging and it should work.
The reason I never added it to my mail userfunctions is so that, if you want to use more than one of the functions, you don't need to open the mail box between each one.
Maybe I could add a "CloseAllWindows()" command to the player:logout() function? Of course a lot of people don't use that function but instead use the ingame logout function instead like yourself.
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.
if type(nam) == "table" then print("nam equals") table.print(nam)
elseif typee(slotitem.Name) == "table" then print("slotitem.Name equals") table.print(slotitem) end
for __, nam in pairs(_itemTable) do
if type(nam) == "table" then print("nam equals") table.print(nam)
elseif typee(slotitem.Name) == "table" then print("slotitem.Name equals") table.print(slotitem) end
if string.find(string.lower(slotitem.Name),string.lower(nam)) or (slotitem.Id == nam) then -- mark to send
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.
<!-- # 5 --><waypoint x="2759" z="968" y="53">
player:target_NPC("Lieve");
sendMacro("ChoiceOption(2);");yrest(1000);
sendMacro("ChoiceOption(2);");
waitForLoadingScreen(15)
</waypoint>
<!-- # 9 --><waypoint x="4916" z="-1994" y="115"> </waypoint>
<!-- # 10 --><waypoint x="4959" z="-2014" y="113">
player:target_NPC("Kerby");
sendMacro("ChoiceOption(1);");
RoMScript("CloseAllWindows()");
</waypoint>
<!-- # 13 --><waypoint x="5220" z="-2178" y="103">
for i = 1, 17 do
sendMacro("EquipItem("..i..")");
yrest(1000);
end
RoMScript("CloseAllWindows()");
</waypoint>
<!-- # 14 --><waypoint x="5220" z="-2178" y="103">
player:target_Object("Mailbox",2000);
if player.Name == "toon1" then
UMM_SendByNameOrId ("toon2", {221306,221305,220098});yrest(500);
end
RoMScript("UMMFrame:Hide()")
yrest(2000);
sendMacro("}LoginNextToon=true;a={");
sendMacro("Logout();"); yrest(60*1000);
player = CPlayer.new();
settings.load();
yrest (4000)
loadPaths("NextStart");
</waypoint>
</waypoints>
Opens vendor window and repairs then walks to mailbox and removes all equipment then opens mailbox says it is sending mail but sends nothing. If I restart the script with the gear in the bag it accurately sends everything... I re-equiped everything and boom same problem nothing gets sent. Is there some function I need to use to analyze the bags following equipment removal. I noticed when it is scanning bags it always stops at last item before recently removed gear almost as if it doesn't recognize those bag slots are full now.
I send a bunch t4 to the first. It then creates t8. If the character runs out of charges, i want to return
all t4 to the original sender, so he can send it to next character...
Wouldn't it make more sense to collect the stones and pass them on to the next character instead of having to login to the first one again to send it to the third?
Anyway, there is no "Select All" button but if one of the existing buttons works, you can use its underlying function.
Example, if the "char" option works then this should work from the bot after opening the mailbox
sending to next character would be nice, BUT that way i have to do
a check which char is active and then for each char one "if char...", and hardcode
the names in.
Plus if i send many stones directly, the mail funtion breaks up. returning mail however does
not breake.
function UMM_SendAmountByNameOrId(_recipient, _item, _amount)
---------------------------------
-- Sends Amount bag items by name or id.
-- Error checks
repeat UMMOpen = RoMScript("UMMFrame:IsVisible()") until UMMOpen ~= nil
if UMMOpen ~= true then
error("The UMM mail interface needs to be open first before using the UMM_SendAmountByNameOrId() function.")
elseif _recipient == nil or _item == nil then
error("You must specify a recipient and item table when using UMM_SendAmountByNameOrId()")
elseif type(_item) == "table" and type(_item) ~= "number" and type(_item) ~= "string" then
error("Argument #2 to UMM_SendAmountByNameOrId(): Expected type 'string' or 'number', got '" .. type(_item) .. "'")
elseif type(_amount) ~= "number" then
error("Argument #3 to UMM_SendAmountByNameOrId(): Expected type 'number', got '" .. type(_amount) .. "'")
end
-- place item in table if not already
if type(_item) == "number" or type(_item) == "string" then
_item = {_item}
end
printf("Sending amount items to ".._recipient.."...\n")
-- Open correct tab
RoMScript("UMMFrameTab1:Hide()") yrest(50)
RoMScript("UMMFrameTab2:Hide()") yrest(50)
RoMScript("UMMFrameTab3:Show();") yrest(50)
yrest(1000)
-- Selecting items
local counter = 0
for item = UMM_FromSlot, UMM_ToSlot, 1 do -- for each inventory
local amount = _amount
local slotitem = inventory.BagSlot[item];
local slotNumber = slotitem.SlotNumber - 60
if slotitem.Available and not slotitem.Empty and (amount > counter) then
-- Check the name or id
for __, nam in pairs(_item) do
if string.find(string.lower(slotitem.Name),string.lower(nam)) or (slotitem.Id == nam) then -- mark to send
bagid = math.floor((slotNumber-1)/30+1)
slotid = slotNumber - (bagid * 30 - 30)
RoMScript("UMMMassSendItemsSlotTemplate_OnClick(_G['UMMFrameTab3BagsBag"..bagid.."Slot"..slotid.."'])")
yrest(250)
counter = counter + 1
break
end
end
end
end
yrest(1000)
-- Enter recipients name
RoMScript("UMMFrameTab3RecipientRecipient:SetText('".._recipient.."');")
-- Sending
RoMScript("UMMFrameTab3Action:Send()")
-- Waiting until finished
repeat
yrest(2000)
until RoMScript("UMMFrameTab3Status:IsVisible()") == false
printf("Items sent.\n")
end
Last edited by Bot_romka on Fri Aug 26, 2011 12:34 am, edited 1 time in total.
At first I thought this wasn't really necessary but as I looked at my functions I realised there was a need for it. The current sendbynameorid sends all matching items. I can see there might be a need to send a set number.
That said, I have 2 observations to make.
1. Making a "send by ammount" function that can't handle stacked items is only doing half the job.
2. When you really come down to it, there's really no need for another function. Sending a specific amount should be an option for UMM_SendByNameOrId.
Otherwise, good idea.
If you can't make those changes, let me know. I'll do 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.
I modifed UMM_SendByNameOrId() function. Now you can sends amount bag items if you need it.
You can sent amount only 1 item of specific names or ids not a Table items. Attention stackable items in BagSlot sent like one item, split theirs first.
If you not specify a number of amount then UMM_SendByNameOrId() function sent all available items by Name or ID.
example: UMM_SendByNameOrId ("Botromka", "Excellent Belt", 9); --- 9 is number of amount item you want to sent.
function UMM_SendByNameOrId(_recipient, _itemTable, _amount)
---------------------------------
-- Sends bag items or by name or id. Sends Amount bag items by name or id.
-- Error checks
repeat UMMOpen = RoMScript("UMMFrame:IsVisible()") until UMMOpen ~= nil
if UMMOpen ~= true then
error("The UMM mail interface needs to be open first before using the UMM_SendByNameOrId() function.")
elseif _recipient == nil or _itemTable == nil then
error("You must specify a recipient and item table when using UMM_SendByNameOrId()")
elseif type(_amount) == "number" and type(_itemTable) == "table" then
error("You must specify only one item for sends amount bag items when using UMM_SendByNameOrId()")
elseif type(_itemTable) ~= "table" and type(_itemTable) ~= "number" and type(_itemTable) ~= "string" then
error("Argument #2 to UMM_SendByNameOrId(): Expected type 'table' or 'string' or 'number', got '" .. type(_itemTable) .. "'")
elseif type(_amount) == "table" or type(_amount) == "string" then
error("Argument #3 to UMM_SendAmountByNameOrId(): Expected type 'number', got '" .. type(_amount) .. "'")
end
-- for backward compatibility. Amount set to all.
if type(_amount) == "nil" then
_amount = 240
end
-- place item in table if not already
if type(_itemTable) == "number" or type(_itemTable) == "string" then
_itemTable = {_itemTable}
end
printf("Sending items to ".._recipient.."...\n")
-- Open correct tab
RoMScript("UMMFrameTab1:Hide()") yrest(50)
RoMScript("UMMFrameTab2:Hide()") yrest(50)
RoMScript("UMMFrameTab3:Show();") yrest(50)
yrest(1000)
-- Selecting items
local counter = 0
for item = UMM_FromSlot, UMM_ToSlot, 1 do -- for each inventory
local slotitem = inventory.BagSlot[item];
local slotNumber = slotitem.SlotNumber - 60
if slotitem.Available and not slotitem.Empty and (_amount > counter) then -- Check amount of item
-- Check the name or id
for __, nam in pairs(_itemTable) do
if string.find(string.lower(slotitem.Name),string.lower(nam)) or (slotitem.Id == nam) then -- mark to send
bagid = math.floor((slotNumber-1)/30+1)
slotid = slotNumber - (bagid * 30 - 30)
RoMScript("UMMMassSendItemsSlotTemplate_OnClick(_G['UMMFrameTab3BagsBag"..bagid.."Slot"..slotid.."'])")
yrest(250)
counter = counter + 1
break
end
end
end
end
yrest(1000)
-- Enter recipients name
RoMScript("UMMFrameTab3RecipientRecipient:SetText('".._recipient.."');")
-- Sending
RoMScript("UMMFrameTab3Action:Send()")
-- Waiting until finished
repeat
yrest(2000)
until RoMScript("UMMFrameTab3Status:IsVisible()") == false
printf("Items sent.\n")
end
Last edited by Bot_romka on Fri Aug 26, 2011 1:21 am, edited 1 time in total.