how would i?
Posted: Sat Feb 18, 2012 11:57 am
how would i check and see if bags 1-3 are full. then when i get the bot to the npc. how would i make it sell everything in bags 1-3?
you need to change profile optionsGolbez wrote:how would i make it sell everything in bags 1-3?
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="1" /> <!-- 1 = bag 1 slot 1 -->
<option name="INV_AUTOSELL_TOSLOT" value="60" /> <!-- 30 = last slot bag 1 -->
Golbez wrote:how would i check and see if bags 1-3 are full
Code: Select all
if inventory:itemTotalCount(0) == 0 thenthen i just make it interact with the npc and it will sell everything?lisa wrote:you need to change profile optionsGolbez wrote:how would i make it sell everything in bags 1-3?
set autosell to true and
change the fromslot and toslot according.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="1" /> <!-- 1 = bag 1 slot 1 --> <option name="INV_AUTOSELL_TOSLOT" value="60" /> <!-- 30 = last slot bag 1 -->Golbez wrote:how would i check and see if bags 1-3 are fullthis code checks if all slots are full within the range of the autosell fromslot and toslot.Code: Select all
if inventory:itemTotalCount(0) == 0 then
Code: Select all
player:merchant("npc_name")Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
changeProfileOption("INV_AUTOSELL_ENABLE", true)
changeProfileOption("INV_AUTOSELL_FROMSLOT", 1) -- bag 1
changeProfileOption("INV_AUTOSELL_TOSLOT", 90) -- bag 3
</onLoad>
<!-- # 1 --><waypoint x="-3947" z="4177" y="1"> </waypoint>
<!-- # 2 --><waypoint x="-4095" z="3967" y="-4"> </waypoint>
<!-- # 3 --><waypoint x="-4152" z="3701" y="-2"> </waypoint>
<!-- # 4 --><waypoint x="-4509" z="3601" y="12"> </waypoint>
<!-- # 5 --><waypoint x="-4732" z="3590" y="11"> </waypoint>
yrest(99);
if inventory:itemTotalCount(0) >= 90 then
printf("Move To Npc to empty bags")
<!-- # 1 --><waypoint x="-4947" z="3455" y="0"> </waypoint>
<!-- # 2 --><waypoint x="-5036" z="3399" y="-4"> </waypoint>
<!-- # 3 --><waypoint x="-5126" z="3337" y="-110"> </waypoint>
<!-- # 4 --><waypoint x="-5100" z="3276" y="-108"> </waypoint>
yrest(99); player:merchant("Kenen Maift"); yrest(99);
<!-- # 5 --><waypoint x="-5119" z="3312" y="-110"> </waypoint>
<!-- # 6 --><waypoint x="-5127" z="3362" y="-112"> </waypoint>
<!-- # 7 --><waypoint x="-5362" z="3394" y="-114"> </waypoint>
<!-- # 8 --><waypoint x="-5361" z="3597" y="-107"> </waypoint>
<!-- # 9 --><waypoint x="-5359" z="3742" y="-65"> </waypoint>
<!-- # 10 --><waypoint x="-5347" z="3842" y="-43"> </waypoint>
<!-- # 11 --><waypoint x="-5316" z="3974" y="-28"> </waypoint>
<!-- # 12 --><waypoint x="-5248" z="4099" y="-19"> </waypoint>
<!-- # 13 --><waypoint x="-5121" z="4073" y="0"> </waypoint>
else
printf("Bags do not need to be emptied yet")
end
<!-- # 6 --><waypoint x="-4850" z="3710" y="7"> </waypoint>
<!-- # 7 --><waypoint x="-4952" z="3808" y="5"> </waypoint>
<!-- # 8 --><waypoint x="-4973" z="3994" y="1"> </waypoint>
<!-- # 9 --><waypoint x="-4823" z="4077" y="-1"> </waypoint>
<!-- # 10 --><waypoint x="-4609" z="4049" y="4"> </waypoint>
<!-- # 11 --><waypoint x="-4513" z="4272" y="1"> </waypoint>
<!-- # 12 --><waypoint x="-4466" z="4495" y="-6"> </waypoint>
<!-- # 13 --><waypoint x="-4449" z="4723" y="4"> </waypoint>
<!-- # 14 --><waypoint x="-4074" z="4629" y="-8"> </waypoint>
<!-- # 15 --><waypoint x="-4103" z="4385" y="-8"> </waypoint>
</waypoints>Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
changeProfileOption("INV_AUTOSELL_ENABLE", true)
changeProfileOption("INV_AUTOSELL_FROMSLOT", 1) -- bag 1
changeProfileOption("INV_AUTOSELL_TOSLOT", 90) -- bag 3
</onLoad>
<!-- # 1 --><waypoint x="-3947" z="4177" y="1" tag="start"> </waypoint>
<!-- # 2 --><waypoint x="-4095" z="3967" y="-4"> </waypoint>
<!-- # 3 --><waypoint x="-4152" z="3701" y="-2"> </waypoint>
<!-- # 4 --><waypoint x="-4509" z="3601" y="12"> </waypoint>
<!-- # 5 --><waypoint x="-4732" z="3590" y="11"> </waypoint>
yrest(99);
if inventory:itemTotalCount(0) >= 90 then
printf("Move To Npc to empty bags")
__WPL:setWaypointIndex(__WPL:findWaypointTag("to merchant"))
else
printf("Bags do not need to be emptied yet")
end
<!-- # 6 --><waypoint x="-4850" z="3710" y="7" tag="continue"> </waypoint>
<!-- # 7 --><waypoint x="-4952" z="3808" y="5"> </waypoint>
<!-- # 8 --><waypoint x="-4973" z="3994" y="1"> </waypoint>
<!-- # 9 --><waypoint x="-4823" z="4077" y="-1"> </waypoint>
<!-- # 10 --><waypoint x="-4609" z="4049" y="4"> </waypoint>
<!-- # 11 --><waypoint x="-4513" z="4272" y="1"> </waypoint>
<!-- # 12 --><waypoint x="-4466" z="4495" y="-6"> </waypoint>
<!-- # 13 --><waypoint x="-4449" z="4723" y="4"> </waypoint>
<!-- # 14 --><waypoint x="-4074" z="4629" y="-8"> </waypoint>
<!-- # 15 --><waypoint x="-4103" z="4385" y="-8">
__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
</waypoint>
<!-- # 1 --><waypoint x="-4947" z="3455" y="0" tag="to merchant"> </waypoint>
<!-- # 2 --><waypoint x="-5036" z="3399" y="-4"> </waypoint>
<!-- # 3 --><waypoint x="-5126" z="3337" y="-110"> </waypoint>
<!-- # 4 --><waypoint x="-5100" z="3276" y="-108"> </waypoint>
yrest(99); player:merchant("Kenen Maift"); yrest(99);
<!-- # 5 --><waypoint x="-5119" z="3312" y="-110"> </waypoint>
<!-- # 6 --><waypoint x="-5127" z="3362" y="-112"> </waypoint>
<!-- # 7 --><waypoint x="-5362" z="3394" y="-114"> </waypoint>
<!-- # 8 --><waypoint x="-5361" z="3597" y="-107"> </waypoint>
<!-- # 9 --><waypoint x="-5359" z="3742" y="-65"> </waypoint>
<!-- # 10 --><waypoint x="-5347" z="3842" y="-43"> </waypoint>
<!-- # 11 --><waypoint x="-5316" z="3974" y="-28"> </waypoint>
<!-- # 12 --><waypoint x="-5248" z="4099" y="-19"> </waypoint>
<!-- # 13 --><waypoint x="-5121" z="4073" y="0">
__WPL:setWaypointIndex(__WPL:findWaypointTag("continue"))
</waypoint>
</waypoints>Code: Select all
<!-- # 5 --><waypoint x="-4732" z="3590" y="11">
yrest(99);
if inventory:itemTotalCount(0) >= 90 then
printf("Move To Npc to empty bags")
__WPL:setWaypointIndex(__WPL:findWaypointTag("to merchant"))
else
printf("Bags do not need to be emptied yet")
end
</waypoint>Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
changeProfileOption("INV_AUTOSELL_ENABLE", true)
changeProfileOption("INV_AUTOSELL_FROMSLOT", 1) -- bag 1
changeProfileOption("INV_AUTOSELL_TOSLOT", 90) -- bag 3
</onLoad>
<!-- # 1 --><waypoint x="-3947" z="4177" y="1" tag="start"> </waypoint>
<!-- # 2 --><waypoint x="-4095" z="3967" y="-4"> </waypoint>
<!-- # 3 --><waypoint x="-4152" z="3701" y="-2"> </waypoint>
<!-- # 4 --><waypoint x="-4509" z="3601" y="12"> </waypoint>
<!-- # 5 --><waypoint x="-4732" z="3590" y="11">
yrest(99);
if inventory:itemTotalCount(0) >= 90 then
printf("Move To Npc to empty bags")
__WPL:setWaypointIndex(__WPL:findWaypointTag("to merchant"))
else
printf("Bags do not need to be emptied yet")
end
</waypoint>
<!-- # 6 --><waypoint x="-4850" z="3710" y="7" tag="continue"> </waypoint>
<!-- # 7 --><waypoint x="-4952" z="3808" y="5"> </waypoint>
<!-- # 8 --><waypoint x="-4973" z="3994" y="1"> </waypoint>
<!-- # 9 --><waypoint x="-4823" z="4077" y="-1"> </waypoint>
<!-- # 10 --><waypoint x="-4609" z="4049" y="4"> </waypoint>
<!-- # 11 --><waypoint x="-4513" z="4272" y="1"> </waypoint>
<!-- # 12 --><waypoint x="-4466" z="4495" y="-6"> </waypoint>
<!-- # 13 --><waypoint x="-4449" z="4723" y="4"> </waypoint>
<!-- # 14 --><waypoint x="-4074" z="4629" y="-8"> </waypoint>
<!-- # 15 --><waypoint x="-4103" z="4385" y="-8">
__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
</waypoint>
<!-- # 1 --><waypoint x="-4947" z="3455" y="0" tag="to merchant"> </waypoint>
<!-- # 2 --><waypoint x="-5036" z="3399" y="-4"> </waypoint>
<!-- # 3 --><waypoint x="-5126" z="3337" y="-110"> </waypoint>
<!-- # 4 --><waypoint x="-5100" z="3276" y="-108">
yrest(1000)
player:merchant("Kenen Maift")
yrest(100)
printf("Bags emptied")
</waypoint>
<!-- # 5 --><waypoint x="-5119" z="3312" y="-110"> </waypoint>
<!-- # 6 --><waypoint x="-5127" z="3362" y="-112"> </waypoint>
<!-- # 7 --><waypoint x="-5362" z="3394" y="-114"> </waypoint>
<!-- # 8 --><waypoint x="-5361" z="3597" y="-107"> </waypoint>
<!-- # 9 --><waypoint x="-5359" z="3742" y="-65"> </waypoint>
<!-- # 10 --><waypoint x="-5347" z="3842" y="-43"> </waypoint>
<!-- # 11 --><waypoint x="-5316" z="3974" y="-28"> </waypoint>
<!-- # 12 --><waypoint x="-5248" z="4099" y="-19"> </waypoint>
<!-- # 13 --><waypoint x="-5121" z="4073" y="0">
__WPL:setWaypointIndex(__WPL:findWaypointTag("continue"))
</waypoint>
</waypoints>Hm.. On second thought, this should be.Golbez wrote:if inventory:itemTotalCount(0) >= 90 then
Code: Select all
if 10 >= inventory:itemTotalCount(0) thenrock5 wrote:Hm.. On second thought, this should be.Golbez wrote:if inventory:itemTotalCount(0) >= 90 thenCode: Select all
if 10 >= inventory:itemTotalCount(0) then
I don't understand. How can it "work alot better" if it "does it every time"? It should only go to the merchant when there are 10 or less spaces left. What is it doing?Golbez wrote:this works alot betteronly problem now is. it seems like it does it every time
That's not so easy. To drop an item you just find it in your inventory then doGolbez wrote:need to throw out all these chupura bloods i keep getting. i only wanna keep 100 on me...
Code: Select all
item:delete()Code: Select all
if inventory:itemTotalCount(bloodId) > 100 then
inventory:findItem(bloodId):delete()
endCode: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- # 1 --><waypoint x="-15146" z="40247" y="601 tag=farm">
if( 5 > inventory:itemTotalCount(0) ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("npc"));
end
</waypoint>
<!-- # 2 --><waypoint x="-14949" z="40041" y="579"> </waypoint>
<!-- # 3 --><waypoint x="-14821" z="40015" y="595"> </waypoint>
<!-- # 4 --><waypoint x="-14644" z="40026" y="600"> </waypoint>
<!-- # 5 --><waypoint x="-14625" z="40235" y="620"> </waypoint>
<!-- # 6 --><waypoint x="-14832" z="40056" y="592"> </waypoint>
<!-- # 7 --><waypoint x="-14963" z="40070" y="579"> </waypoint>
<!-- # 8 --><waypoint x="-15184" z="40271" y="602"> </waypoint>
<!-- # 9 --><waypoint x="-15302" z="40192" y="612"> </waypoint>
<!-- # 10 --><waypoint x="-15295" z="40027" y="613"> </waypoint>
<!-- # 11 --><waypoint x="-15101" z="40120" y="577"> </waypoint>
<!-- # 12 --><waypoint x="-15170" z="40250" y="600"> </waypoint>
<!-- # 1 --><waypoint x="-15133" z="40284" y="598" tag="npc"> </waypoint>
<!-- # 2 --><waypoint x="-15290" z="40211" y="614"> player:mount(); </waypoint>
<!-- # 3 --><waypoint x="-15445" z="40125" y="602"> </waypoint>
<!-- # 4 --><waypoint x="-15553" z="40000" y="602"> </waypoint>
<!-- # 5 --><waypoint x="-15628" z="39895" y="606"> </waypoint>
<!-- # 6 --><waypoint x="-15607" z="39813" y="605"> </waypoint>
<!-- # 7 --><waypoint x="-15567" z="39817" y="606"> player:merchant("Fadiya Royil");
</waypoint>
<!-- # 9 --><waypoint x="-15613" z="39815" y="605"> </waypoint>
<!-- # 10 --><waypoint x="-15613" z="39929" y="606"> </waypoint>
<!-- # 11 --><waypoint x="-15519" z="40013" y="604"> </waypoint>
<!-- # 12 --><waypoint x="-15476" z="40121" y="597"> </waypoint>
<!-- # 13 --><waypoint x="-15401" z="40166" y="610"> </waypoint>
<!-- # 14 --><waypoint x="-15252" z="40190" y="612"> </waypoint>
<!-- # 15 --><waypoint x="-15146" z="40252" y="601">_WPL:setWaypointIndex(__WPL:findWaypointTag("farm")) </waypoint>
</waypoints>Code: Select all
distance(x1, z1, y1, x2, z2, y2) abron1 wrote:attempt to perform arithmetic on local 'y2' (a string value)
there is your issue, missing 2 "<!-- # 1 --><waypoint x="-15146" z="40247" y="601 tag=farm">
Code: Select all
<!-- # 1 --><waypoint x="-15146" z="40247" y="601" tag="farm">
rock5 wrote:How much space is in your bag when it goes to the merchant? How much stuff is in your bags to start off with? Also can we have another look at how your code looks now?
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
changeProfileOption("INV_AUTOSELL_ENABLE", true)
changeProfileOption("INV_AUTOSELL_FROMSLOT", 1) -- bag 1
changeProfileOption("INV_AUTOSELL_TOSLOT", 60) -- bag 2
</onLoad>
<!-- # 1 --><waypoint x="-3947" z="4177" y="1" tag="start"> </waypoint>
<!-- # 2 --><waypoint x="-4095" z="3967" y="-4"> </waypoint>
<!-- # 3 --><waypoint x="-4152" z="3701" y="-2"> </waypoint>
<!-- # 4 --><waypoint x="-4509" z="3601" y="12"> </waypoint>
<!-- # 5 --><waypoint x="-4732" z="3590" y="11">
yrest(99);
if 90 >= inventory:itemTotalCount(0) then
printf("Move To Npc to empty bags")
__WPL:setWaypointIndex(__WPL:findWaypointTag("to merchant"))
else
printf("Bags do not need to be emptied yet")
end
</waypoint>
<!-- # 6 --><waypoint x="-4850" z="3710" y="7" tag="continue"> </waypoint>
<!-- # 7 --><waypoint x="-4952" z="3808" y="5"> </waypoint>
<!-- # 8 --><waypoint x="-4973" z="3994" y="1"> </waypoint>
<!-- # 9 --><waypoint x="-4823" z="4077" y="-1"> </waypoint>
<!-- # 10 --><waypoint x="-4609" z="4049" y="4"> </waypoint>
<!-- # 11 --><waypoint x="-4513" z="4272" y="1"> </waypoint>
<!-- # 12 --><waypoint x="-4466" z="4495" y="-6"> </waypoint>
<!-- # 13 --><waypoint x="-4449" z="4723" y="4"> </waypoint>
<!-- # 14 --><waypoint x="-4074" z="4629" y="-8"> </waypoint>
<!-- # 15 --><waypoint x="-4103" z="4385" y="-8">
__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
</waypoint>
<!-- # 1 --><waypoint x="-4947" z="3455" y="0" tag="to merchant"> </waypoint>
<!-- # 2 --><waypoint x="-5036" z="3399" y="-4"> </waypoint>
<!-- # 3 --><waypoint x="-5126" z="3337" y="-110"> </waypoint>
<!-- # 4 --><waypoint x="-5100" z="3276" y="-108">
yrest(1000)
player:merchant("Kenen Maift")
yrest(100)
if inventory:itemTotalCount(206757) > 100 then
inventory:findItem(206757):delete()
printf("Dropped Extra Blood")
end
yrest(100)
if inventory:itemTotalCount(206405) > 100 then
inventory:findItem(206405):delete()
printf("Dropped Extra Meat")
end
printf("Bags emptied")
</waypoint>
<!-- # 5 --><waypoint x="-5119" z="3312" y="-110"> </waypoint>
<!-- # 6 --><waypoint x="-5127" z="3362" y="-112"> </waypoint>
<!-- # 7 --><waypoint x="-5362" z="3394" y="-114"> </waypoint>
<!-- # 8 --><waypoint x="-5361" z="3597" y="-107"> </waypoint>
<!-- # 9 --><waypoint x="-5359" z="3742" y="-65"> </waypoint>
<!-- # 10 --><waypoint x="-5347" z="3842" y="-43"> </waypoint>
<!-- # 11 --><waypoint x="-5316" z="3974" y="-28"> </waypoint>
<!-- # 12 --><waypoint x="-5248" z="4099" y="-19"> </waypoint>
<!-- # 13 --><waypoint x="-5121" z="4073" y="0">
__WPL:setWaypointIndex(__WPL:findWaypointTag("continue"))
</waypoint>
</waypoints>I thought you had changed this to what I said. You did reply to that post.Golbez wrote:if 90 >= inventory:itemTotalCount(0) then
Code: Select all
if 10 >= inventory:itemTotalCount(0) then