Cleanbag userfunction 2.5
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Only post additional bot resources here. Please do not ask unrelated questions.
Re: Cleanbag userfunction 2.3
Hey guyz, is there a way I can make this function keep any type of Phirius potion without having to list all of them in the forcekeep table?
Thanks.
Thanks.
Re: Cleanbag userfunction 2.3
err... you mean it trows them out? O.o
i didnt know phirius would be seen as a normal potion...
you could do what i do in the meantime, adjust your <option name="INV_AUTOSELL_FROMSLOT" value="13" />
to only check from slot 13, which leaves the first 2 rows alone, i always do that to store stuff i really need to keep.
and ill see if i can fix the potions from dropping
i didnt know phirius would be seen as a normal potion...
you could do what i do in the meantime, adjust your <option name="INV_AUTOSELL_FROMSLOT" value="13" />
to only check from slot 13, which leaves the first 2 rows alone, i always do that to store stuff i really need to keep.
and ill see if i can fix the potions from dropping
Re: Cleanbag userfunction 2.3
i have no idea how to differenciate phirius from normal potions >.<
perhaps rock could help me?
perhaps rock could help me?
Re: Cleanbag userfunction 2.3
They have the word "Phirius" in the name? Or maybe you could use a list of the Phirius pot ids. There can't be that many of them.
- 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
Re: Cleanbag userfunction 2.3
do we have something like StringInString in lua?
would
if not string.find(item.Name, "phirius") then
item:delete();
end
work in the bot?
would
if not string.find(item.Name, "phirius") then
item:delete();
end
work in the bot?
Re: Cleanbag userfunction 2.3
Hi botje, thanks for responding.
Actually, I already added some of them to the forcekeep table, so this is how my CleanBag lua file looks atm:
I tested it using commandline, typed CleanBag() and it still deletes the items in the forcekeep table. I also tested it with a normal waypoint file, which is the KS script found here in the forum. Same problem, still deletes said items.
Any idea what I am doing wrong?
Actually, I already added some of them to the forcekeep table, so this is how my CleanBag lua file looks atm:
Code: Select all
-- version 2.3 --
-- sell prize = value which drops all below it
-- rarity = / 0 = white / 1 = green / 2 = blue / 3 = purple / 4 = orange / 5 = gold
-- drop true/false = if allready learned recipes should be dropped
function CleanBag(sellprize, rarity, drop, logg)
inventory:update();
-- custom database for user added items to trow out
forcedrop = {
"Lost Gift",
}
-- custom database for user added items to keep
forcekeep = {
"Blend Rune",
"Phirius Potion - Type A",
"Phirius Potion - Type B",
"Phirius Elixir - Type A",
"Phirius Elixir - Type B"
}
Any idea what I am doing wrong?
Last edited by kenzu38 on Sat Jan 05, 2013 1:29 pm, edited 1 time in total.
Re: Cleanbag userfunction 2.3
it does? weird, when i tested it it worked just fine O.o
ill debug it.
ill debug it.
Re: Cleanbag userfunction 2.3
Lol that was some fast reply. Ok, thanks.
Re: Cleanbag userfunction 2.3
dunno what i did, but it works fine on my end, perhaps i changed something between uploads, so ill upload my current one so you can test
Re: Cleanbag userfunction 2.4
k, uploaded and updated, also SHOULD ignore phirius potions now xd
Re: Cleanbag userfunction 2.4
Tested the new file just now, and it still didn't work.
But when I tried to change "phirius" into "Phirius" with a capital "P" then it worked. So string.find seems case-sensitive. You might want to change your uploaded file again.
Also, your forcekeep table still doesn't work. I think the problem is that this code:
...is overridden by the lines under it. So It just prints "Keeping item:" but it's deleting them anyway.
But I think you already found the solution with the line:
Maybe something like this will work:
Now, I don't know how to exactly make it string.find all the items listed in the forcekeep table, but if you can do that, then it could work.
Anyway, at least for now my Phirius potions don't get deleted. Thanks for helping out.
EDIT: Or maybe this is the proper code?
Can anyone help? Thanks.
But when I tried to change "phirius" into "Phirius" with a capital "P" then it worked. So string.find seems case-sensitive. You might want to change your uploaded file again.
Also, your forcekeep table still doesn't work. I think the problem is that this code:
Code: Select all
for j, l in ipairs(forcekeep) do
--printf("force Item: "..l.."\n");
--printf("Item name: "..item.Name.."\n");
if l == item.Name then
--keep it
printf("Keeping Item: "..item.Name.."\n");
else
But I think you already found the solution with the line:
Code: Select all
if not string.find(item.Name, "Phirius") then
Code: Select all
elseif item:isType("Runes") or item:isType("Production Runes") then
if not string.find(item.Name,[forcekeep]) then
item:delete()
Anyway, at least for now my Phirius potions don't get deleted. Thanks for helping out.
EDIT: Or maybe this is the proper code?
Code: Select all
elseif item:isType("Runes") or item:isType("Production Runes") then
for j, l in ipairs(forcekeep) do
if not string.find(item.Name, l) then
item:delete();
Re: Cleanbag userfunction 2.4
seems its case sensitive indeed, ill change that.
i tested it with link runes, and it did'nt delete them, but that was after i took it out of my lootfilter xd
i forgot it was in lootfilter+, so it kept deleting it xd
and no, its not over ridden by the lower lines, because its in a if then statement.
edit: just tested it again, it prints keeping item, and keeps it, no deleting going on here O.o
i tested it with link runes, and it did'nt delete them, but that was after i took it out of my lootfilter xd
i forgot it was in lootfilter+, so it kept deleting it xd
and no, its not over ridden by the lower lines, because its in a if then statement.
edit: just tested it again, it prints keeping item, and keeps it, no deleting going on here O.o
Re: Cleanbag userfunction 2.4
perhaps rock or lisa could jump in with this problem, and perhaps see if they can optimize my code a bit, im sure its a bit slow xd
Re: Cleanbag userfunction 2.4
Sorry I haven't really been watching this thread, can you sum up the issue you are having and I'll see if I can help.botje wrote:perhaps rock or lisa could jump in with this problem, and perhaps see if they can optimize my code a bit, im sure its a bit slow xd
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Cleanbag userfunction 2.4
Ok, now it's gotten weirder. When I only list one item to the forcekeep table, then it keeps that item. But when I list more, then it'll delete the items, even the first one on the list gets deleted as well as soon as I list more than one.
Whether I list it like this:
Or like this:
As long as there's more than one on the list, then it deletes all in the list. So any idea why it's doing that?
Whether I list it like this:
Code: Select all
forcekeep = {
"Purify Rune","Activate Rune",
}
Code: Select all
forcekeep = {
"Purify Rune",
"Activate Rune",
}
Re: Cleanbag userfunction 2.4
basicly, the database i tried using in determining what items to keep fails, when you use more then 1 item it seems O.o
lets wait for guru assistance xd
lets wait for guru assistance xd
Re: Cleanbag userfunction 2.4
I think it's being overridden afterall. I don't know but maybe if you change this:
to this:
Then it'll probably work. Just guessing though, will try it out in a bit.
Code: Select all
for j, l in ipairs(forcekeep) do
--printf("force Item: "..l.."\n");
--printf("Item name: "..item.Name.."\n");
if l == item.Name then
--keep it
printf("Keeping Item: "..item.Name.."\n");
else
Code: Select all
for j, l in ipairs(forcekeep) do
--printf("force Item: "..l.."\n");
--printf("Item name: "..item.Name.."\n");
if l == item.Name then
--keep it
printf("Keeping Item: "..item.Name.."\n");
end
end
Re: Cleanbag userfunction 2.4
but that would stop all other processing of the items, and skip all lines below it, dont think that works.
Re: Cleanbag userfunction 2.4
Lol yep, that idea didn't work. Now, I'm getting really puzzled over this. The forcedrop works fine, though, even if I list multiple items. It's just the forcekeep table giving me problems.
Re: Cleanbag userfunction 2.4
i know, i could replicate that O.o
Who is online
Users browsing this forum: No registered users and 1 guest