Cleanbag userfunction 2.5

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
kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Cleanbag userfunction 2.3

#41 Post by kenzu38 » Sat Jan 05, 2013 11:20 am

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.

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.3

#42 Post by botje » Sat Jan 05, 2013 12:01 pm

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

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.3

#43 Post by botje » Sat Jan 05, 2013 12:26 pm

i have no idea how to differenciate phirius from normal potions >.<

perhaps rock could help me? :P

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

Re: Cleanbag userfunction 2.3

#44 Post by rock5 » Sat Jan 05, 2013 12:36 pm

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

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.3

#45 Post by botje » Sat Jan 05, 2013 12:40 pm

do we have something like StringInString in lua?

would

if not string.find(item.Name, "phirius") then
item:delete();
end

work in the bot?

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Cleanbag userfunction 2.3

#46 Post by kenzu38 » Sat Jan 05, 2013 1:26 pm

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:

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"
	}
	
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?
Last edited by kenzu38 on Sat Jan 05, 2013 1:29 pm, edited 1 time in total.

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.3

#47 Post by botje » Sat Jan 05, 2013 1:28 pm

it does? weird, when i tested it it worked just fine O.o

ill debug it.

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Cleanbag userfunction 2.3

#48 Post by kenzu38 » Sat Jan 05, 2013 1:32 pm

Lol that was some fast reply. Ok, thanks.

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.3

#49 Post by botje » Sat Jan 05, 2013 1:59 pm

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

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.4

#50 Post by botje » Sat Jan 05, 2013 2:14 pm

k, uploaded and updated, also SHOULD ignore phirius potions now xd

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Cleanbag userfunction 2.4

#51 Post by kenzu38 » Sat Jan 05, 2013 3:15 pm

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:

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

Code: Select all

						if not string.find(item.Name, "Phirius") then
Maybe something like this will work:

Code: Select all

					elseif item:isType("Runes") or item:isType("Production Runes") then
						if not string.find(item.Name,[forcekeep]) then
						item:delete()
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?

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();
Can anyone help? Thanks.

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.4

#52 Post by botje » Sat Jan 05, 2013 4:54 pm

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

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.4

#53 Post by botje » Sat Jan 05, 2013 5:23 pm

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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Cleanbag userfunction 2.4

#54 Post by lisa » Sat Jan 05, 2013 5:37 pm

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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Cleanbag userfunction 2.4

#55 Post by kenzu38 » Sat Jan 05, 2013 5:42 pm

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:

Code: Select all

	forcekeep = {
		"Purify Rune","Activate Rune",
	}
Or like this:

Code: Select all

	forcekeep = {
		"Purify Rune",
		"Activate Rune",
	}
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?

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.4

#56 Post by botje » Sat Jan 05, 2013 5:45 pm

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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Cleanbag userfunction 2.4

#57 Post by kenzu38 » Sat Jan 05, 2013 5:50 pm

I think it's being overridden afterall. I don't know but maybe if you change this:

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
to this:

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
Then it'll probably work. Just guessing though, will try it out in a bit.

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.4

#58 Post by botje » Sat Jan 05, 2013 5:53 pm

but that would stop all other processing of the items, and skip all lines below it, dont think that works.

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Cleanbag userfunction 2.4

#59 Post by kenzu38 » Sat Jan 05, 2013 6:00 pm

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.

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cleanbag userfunction 2.4

#60 Post by botje » Sat Jan 05, 2013 6:08 pm

i know, i could replicate that O.o

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests