Good work. I should have remembered about the find issue, we've come across it before. Another way to deal with the '-' is to replace it with '.' which means "any character". This is something all users who have hyphens in their language need to be aware of. If you are using a userfunction or command and it doesn't recognise the non-alpha characters in your string, try replacing them with '.'
If we want to really make it universal we should probably leave the find command as it was because I was just checking some other languages and Polish eggs seem to be named "Egg <something> Pet" so with the pattern matching enabled they could use
local lang = bot.ClientLanguage
local textInAllEggNames
if lang == "EN" then
textInAllEggNames = "Egg Pet"
elseif lang == "DE" then
textInAllEggNames = "Begleiter.Ei"
elseif lang == "PL" then
textInAllEggNames = "Jajo .* Zwierzątka"
etc.
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.
local eggnames = {
[1] = getIdName(204476), -- Wild Pet Egg
[2] = getIdName(204482), -- Natural Pet Egg
[3] = getIdName(204488), -- Amazing Pet Egg
[4] = getIdName(204494), -- Magical Pet Egg
[5] = getIdName(204500), -- Holy Pet Egg
[6] = getIdName(204506), -- Rune Pet Egg
}
local function IsPetEgg(name)
for k,v in pairs(eggnames) do
if v == name then
return true
end
end
return false
end
function sendEggsByLevel(_recipient, lowest, highest)
local sendlist = {} -- Make table of items to send
for item = 61, 240, 1 do -- for each inventory
local slotitem = inventory.BagSlot[item];
local eggLevel = memoryReadByte(getProc(), slotitem.Address + 0x2E)
if IsPetEgg(slotitem.Name) and eggLevel >=lowest and highest >= eggLevel then
-- Add to table
table.insert(sendlist, slotitem.SlotNumber)
end
end
UMM_SendInventoryItem(_recipient, sendlist)
end
I might be getting a bit carried away now.
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.
nice work.
I prefer and will use the second solution with the table of local egg names, because that way nobody has to care about entering a search string.
When using UMM_TakeMail() bot seems to hang if backpack is full. Is there anyway to set a timeout for this function, say 60sec, where it can just give up trying to take mail and resume?
I would like to check if my characters have over 100 phirius tokens, that's easy, but then I want the bot to either write the charname to a separate file or to my belt/fusion stone sending files.
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
player.free_counter1 = 1;
</onLoad>
<!-- # 1 --><!--waypoint x="-5056" z="6778" y="86"> </waypoint-->
<!-- # 1 --><waypoint x="2742" z="-1632" y="78">
local tobuy = 10;
local beltname = RoMScript("TEXT('Sys202999_name')") -- Stones
repeat
local beltcount = inventory:getItemCount(202999) -- Number of stones you already have
if beltcount >= tobuy then break end
player:openStore("Prole");
inventory:storeBuyItem(beltname, tobuy - beltcount)
yrest(3000)
until false
sendMacro("CloseAllWindows()");
inventory:update();
player:clearTarget()
sendMacro("OpenMail()"); yrest(1000);
nameTable = {
"name",
"name"
"name"
"name"
"end"
}
if nameTable[player.free_counter1] == player.Name then
player.free_counter1 = player.free_counter1 + 1
if player.free_counter1 > #nameTable then
player.free_counter1 = 1
end
end
UMM_SendByNameOrId(nameTable[player.free_counter1], {202999},10); yrest(1000);
player.free_counter1 = player.free_counter1 + 1;
if (player.free_counter1 > #nameTable) then
player.free_counter1 = 1;
end
sendMacro("CloseAllWindows()");inventory:update();
-- Changing channel
repeat parallelID = RoMScript("GetCurrentParallelID()"); yrest(500) until parallelID
if (parallelID == 2) then
sendMacro("ChangeParallelID(1);");
else
sendMacro("ChangeParallelID(2);");
end
player:rest(25);
if nameTable[player.free_counter1] == "end" then
-- Last character
print("Last player finished.")
player:sleep()
end
</waypoint>
</waypoints>
So I need to save the names in that format or I will have to copy it all separate and add "". The reason I need this is because I don't run all my characters every day so i only want to send it to those that have at least 100 tokens.
Even better would be if it could also check if the char have 200, 300, 400 tokens in which it would add the name more than once.
rock5 wrote:I could but what would be the point? If I make it time out what are you going to make the bot do with a full backpack after taking the mail?
The bot is the first on an account that does dailies for tokens. Each char on the account does dailies and then buys mana stones and logs on next char using the autologon function. All junk that can make T4 and above is sent to it from other accounts (Anything from 0 to 100+ items). I then tier manually using fusion.
If the last thing you are going to bot with the character is take the mail then you fuse manually, you could just as easily take your mail manually then do your fusing.
Now if you were going to bot the fusing as well you still would want to make sure you keep enough space in your bags. You would make sure you have at least 30 spaces then collect the mail once, do the fusing, send mana stones of the correct level to the next character, make sure you still have 30 spaces then collect more mail.
I just can't see a situation while botting, where it would be ok to fill your bag with mail unless, like in your situation, you intend to stop the bot. So what I'm saying is it's usually good if the bot stops if your bags become unexpectedly full otherwise it might end up running around trying to do stuff and accomplishing nothing. On the other hand they could check whether their inventory is full after checking their mail.
I don't know. I may still do it. Let me think on it a bit more.
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.
rock5 wrote:I could but what would be the point? If I make it time out what are you going to make the bot do with a full backpack after taking the mail?
The bot is the first on an account that does dailies for tokens. Each char on the account does dailies and then buys mana stones and logs on next char using the autologon function. All junk that can make T4 and above is sent to it from other accounts (Anything from 0 to 100+ items). I then tier manually using fusion.
Just as an aside, T5 is pretty much the min now I think. At least on the "official" servers. All of the drops in Syrbal make T5 and the drop rates are pretty insane. 6 bags of T5 stuffs in about 100 minutes. The instances drop clean greens that make clean T5s.
As for your problem, you could add a check before getting mail like lisa'a bagckeck function in the <onload> section...
function bagcheck()
if 31 >= inventory:itemTotalCount(0) then
skip over getting mail with __WPL:setWaypointIndex(__WPL:findWaypointTag());
or start using Rock's fusion control userfunction.
end
end
Call bagcheck() before you get the mail. I used 31 because if you fill your bag exactly then the empty mails will not be deleted by the addon (not the mod).
All mailboxes have the floating mail icon above them with the same id. That's how the userfunction finds the mail box. But the one in Hyern doesn't have it so it doesn't find the mailbox. I'll have to add an exception for it. Easy enough. Are there any other mailboxes in Syrbal Pass?
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.