Page 3 of 3

Re: droping items based on gold worth

Posted: Tue Jun 05, 2012 2:15 am
by rock5
Please remember to add code into [ code] tags for easier reading.

It looks like the slot numbering is wrong. As the comments say "1 = bag 1 slot 1". The rest of the comment you added is wrong. Let me explain. The slots in the inventory go like this
  • 1-50 = itemshop bags
    51-60 = transmutor
    61-240 = backpack (6 bags)
But the option for autosell can only sell from the bags so they go from 1 to 180. It was never changed when we changed the slot numbering for the inventory.

Thats why you are using

Code: Select all

settings.profile.options.INV_AUTOSELL_FROMSLOT + 60 
in your code.

Re: droping items based on gold worth

Posted: Tue Jun 05, 2012 5:52 am
by Salrom
So if I am understanding you correctly for the autosell functions bag1 slot 1 is still 1 not 61 therefore if I want to sell bags 3, 4 and 5 only it would look like this

Code: Select all

		<!-- Auto selling options when used with player:merchant -->
		<option name="INV_AUTOSELL_ENABLE"	value="false" />		<!-- true | false -->
		<option name="INV_AUTOSELL_FROMSLOT"     value="61" /> 		<!-- 1 = bag 1 slot 1  -->
		<option name="INV_AUTOSELL_TOSLOT"	value="150" /> 		<!-- 30 = last slot bag 1  -->
		<option name="INV_AUTOSELL_QUALITY"	value="white,green" /> 	<!-- white,green,blue,purple  -->


Re: droping items based on gold worth

Posted: Tue Jun 05, 2012 7:18 am
by rock5
Yes.

Re: droping items based on gold worth

Posted: Sat Jul 14, 2012 2:50 am
by romaniac
I have tried to use this script, but it does not seem to drop anything. I have put in trace output and it defnitely enters the slot index check

Code: Select all

if item:isType("Runes") then
            item:delete()
         end
         if ( item:isType("Weapons") or item:isType("Armor") ) and (400 > item.Worth)then
            item:delete()
         end
But this code never drops anything, even thogh there are runes and cheap armor in the bag.

Any ideas?

Re: droping items based on gold worth

Posted: Sat Jul 14, 2012 4:33 am
by rock5
When are you running it? What slot numbers are you going through? Are you sure you assigned the correct value to 'item'? Are you playing on an English client?

Re: droping items based on gold worth

Posted: Sun Jul 15, 2012 6:07 am
by romaniac
That's probably it. It's not an english client. The values for Type() in the bot are language dependent?

Re: droping items based on gold worth

Posted: Sun Jul 15, 2012 7:52 am
by rock5
Look in "cache\itemtypestable.lua" to see the name you should use.

Re: droping items based on gold worth

Posted: Sun Aug 05, 2012 11:41 pm
by kuripot
lisa wrote:Actually since I made that function specific to KS I just add it to the onload for the KS WP file.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>	
	<onLoad>
	setwindow("gold")
	ToPancer = 1
	StopAtBoss = 3
-- 0 = white / 1 = green / 2 = blue / 3 = purple / 4 = orange / 5 = gold

changeProfileOption("INV_AUTOSELL_ENABLE",true)

function CleanBagKS()
	for i, item in pairs(inventory.BagSlot) do
		if item.SlotNumber >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 60 and
		settings.profile.options.INV_AUTOSELL_TOSLOT + 60 >= item.SlotNumber then
			if item:isType("Runes") then 
				item:delete()
			end
			if ( item:isType("Weapons") or item:isType("Armor") ) and (400 > item.Worth and 3 > item.Quality)then
				item:delete()
			end
			if item.Name  == "Link Rune" then
				item:delete()
			end
			if item:isType("Potions") and (45 > item.RequiredLvl and item.RequiredLvl > 10) then
				item:delete()
			end			
		end
	end
end	
	</onLoad>
then I just do this a few times in the waypoints

Code: Select all

	<!-- # 27 --><waypoint x="4148" z="1439">CleanBagKS()	</waypoint>
	<!-- # 60 --><waypoint x="3149" z="1446">CleanBagKS()	</waypoint>
	<!-- # 83 --><waypoint x="2857" z="2210">CleanBagKS()	</waypoint>
Code literally takes a second to dump 15-20 items, I didn't even put in a rest for it.

how can i delete all Runes,Ammunition,Raw Material and Potion

i use this

Code: Select all

function CleanBagDOD()
	   for i, item in pairs(inventory.BagSlot) do
	      if item.SlotNumber >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 30 and
	      settings.profile.options.INV_AUTOSELL_TOSLOT + 30 >= item.SlotNumber then
	         if item:isType("Runes") then
	            item:delete()
	         end
	         if ( item:isType("Weapons") or item:isType("Armor") ) and (1000 > item.Worth and 4 > item.Quality)then
	            item:delete()
	         end
		if item:isType("Equipment Enhancement") then
	            item:delete()
	         end
		if 1000 > item.Worth and 4 > item.Quality then
	            item:delete()
	         end
		if item.Name  == "Wild Boar Meat" then
	            item:delete()
	         end 
		if item:isType("Potions") and (70 > item.RequiredLvl and item.RequiredLvl > 10) then
	            item:delete()
	         end          
	      end
	   end
	end  

Re: droping items based on gold worth

Posted: Mon Aug 06, 2012 12:05 am
by lisa
Have a look in the file
scripts/rom/cache/itemtypestable.lua
you can use

Code: Select all

        if item:isType("Runes") then 
            item:delete()
         end
For any of the names in that file.

Code: Select all

		[3] = { Name = "Raw Materials" },
		[4] = { Name = "Production Runes" },
I am sure you can find the others you want easy enough.

Re: droping items based on gold worth

Posted: Mon Aug 06, 2012 12:41 am
by kuripot
still not working,,,, not deleting

Code: Select all

	function CleanBagDOD()
	   for i, item in pairs(inventory.BagSlot) do
	      if item.SlotNumber >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 30 and
	      settings.profile.options.INV_AUTOSELL_TOSLOT + 30 >= item.SlotNumber then

	         if item:isType("Materials") then
	            item:delete()
	         end
	         if item:isType("Arrows") then
	            item:delete()
	         end
	         if item:isType("Projectiles") then
	            item:delete()
	         end
	         if ( item:isType("Weapons") or item:isType("Armor") ) and (1000 > item.Worth and 5 > item.Quality)then
	            item:delete()
	         end
		if item:isType("Equipment Enhancement") then
	            item:delete()
	         end
		if 1000 > item.Worth and 5 > item.Quality then
	            item:delete()
	         end
		if item.Name  == "Wild Boar Meat" then
	            item:delete()
	         end 
		if item:isType("Potion") then
	            item:delete()
	         end          
	      end
	   end
	end

Code: Select all

				<waypoint x="2252" z="2444" y="401">
							useGoodie("mdmg2");
							useGoodie("casting");
							useGoodie("speed");
							useGoodie("matt3");
							useGoodie("defense");
							Boss_buff()
							trash_boss()
							lootMob()
							CleanBagDOD()
							Memoscount()
					</waypoint>

				<waypoint x="2290" z="2357" y="401" type="TRAVEL">

							CleanBagDOD()
							Memoscount()				

				settings.profile.friends = {"Incomplete Bloody Beast"}			</waypoint>
	<!-- # 19 -->
				<waypoint x="2191" z="2520" y="401">fly()

Re: droping items based on gold worth

Posted: Mon Aug 06, 2012 12:56 am
by rock5
You can only sell from your bags so INV_AUTOSELL_FROMSLOT and INV_AUTOSELL_TOSLOT count 1 as being the first bag slot. The first bag slot for the inventory is 61 so you'll need to do something like this,

Code: Select all

         if item.SlotNumber - 60 >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 30 and
         settings.profile.options.INV_AUTOSELL_TOSLOT + 30 >= item.SlotNumber - 60 then
Edit: Wait that still doesn't look right. Why would you want to drop items 30 past INV_AUTOSELL_TOSLOT? Maybe you meant to do this.

Code: Select all

         if item.SlotNumber >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 60 and
         settings.profile.options.INV_AUTOSELL_TOSLOT + 60 >= item.SlotNumber then

Re: droping items based on gold worth

Posted: Mon Aug 06, 2012 1:16 am
by kuripot
waaaaaaaaaaaaaaaaa

Code: Select all

	function CleanBagDOD()
	   for i, item in pairs(inventory.BagSlot) do
		if item.SlotNumber - 60 >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 30 and
		settings.profile.options.INV_AUTOSELL_TOSLOT + 30 >= item.SlotNumber - 60 then

	         if item:isType("Materials") then
	            item:delete()
	         end
	         if item:isType("Arrows") then
	            item:delete()
	         end
	         if item:isType("Projectiles") then
	            item:delete()
	         end
	         if ( item:isType("Weapons") or item:isType("Armor") ) and (1000 > item.Worth and 5 > item.Quality)then
	            item:delete()
	         end
		if item:isType("Equipment Enhancement") then
	            item:delete()
	         end
		if 1000 > item.Worth and 5 > item.Quality then
	            item:delete()
	         end
		if item.Name  == "Wild Boar Meat" then
	            item:delete()
	         end 
		if item:isType("Potion") then
	            item:delete()
	         end          
	      end
	   end
	end  
i lost important item

Re: droping items based on gold worth

Posted: Mon Aug 06, 2012 1:19 am
by kuripot
my onload

Code: Select all

	loadProfile("Main")
	changeProfileOption("INV_AUTOSELL_FROMSLOT", 1)
	changeProfileOption("INV_AUTOSELL_TOSLOT", 30)
	settings.profile.friends = {"Incomplete Bloody Beast"}
	changeProfileOption("EGGPET_ENABLE_ASSIST", "true")
	changeProfileOption("INV_AUTOSELL_ENABLE", "true")
	dura = 0.9
	Magic_Tambourine = true
	Magic_Guitar = true
	__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
	changeProfileOption("AUTO_ELITE_FACTOR", 1000)
	changeProfileOption("HARVEST_DISTANCE", 50)
	-- 0 = white / 1 = green / 2 = blue / 3 = purple / 4 = orange / 5 = gold


i only use backpack I for selling

Re: droping items based on gold worth

Posted: Mon Aug 06, 2012 1:25 am
by rock5
I told you it doesn't look right? Or did you miss that edit?

Example: If you have INV_AUTOSELL_FROMSLOT = 1 and INV_AUTOSELL_TOSLOT = 30 because you only want to sell from the first bag then the code you have would drop from the second bag which doesn't make sense. The second code I wrote would sell from the first bag.

Re: droping items based on gold worth

Posted: Mon Aug 06, 2012 1:38 am
by kuripot
i miss your edit

now its working