Page 1 of 1

sell bags

Posted: Sun Sep 14, 2014 5:11 am
by Maxalu
Hi

i have downloaded latly a wpt file with this sell scrpit it has a config on the begining

Code: Select all

	<!-- FUNCTION SELL PNJ -->
		function selling()
				if sellright == true
					then
						player:openStore(117127)
						if sellbag1 == true
							then RoMScript("Sellslots1()")
							yrest(1000)
						end
						if sellbag2 == true
							then RoMScript("Sellslots2()")
							yrest(1000)
						end
						if sellbag3 == true
							then RoMScript("Sellslots3()")
							yrest(1000)
						end
						if sellbag4 == true
							then RoMScript("Sellslots4()")
							yrest(1000)
						end
						if sellbag5 == true
							then RoMScript("Sellslots5()")
							yrest(1000)
						end
						if sellbag6 == true
							then RoMScript("Sellslots6()")
							yrest(1000)
						end
					Mcountround()
		
					if End == 1
						then
							player:sleep();								
					end
			else
				Rightbag = Rightbag+1;
				if End == 1
					then
						player:sleep();								
				end
			end		
		end		
i want 2 create another wpt file that uses this sell comand but thous Mcountround() and Rightbag are not needed. My question is how to edit this sell code and how 2 make the bot sell items when my bags are full with it?

Re: sell bags

Posted: Sun Sep 14, 2014 6:00 am
by rock5
So you don't want to use the bot sell function but just want to use those Sellslotsn() functions from the addon? Did you try just deleting those lines with Mcountround() and Rightbag in them?

Re: sell bags

Posted: Sun Sep 14, 2014 8:30 am
by Maxalu
rock5 wrote:So you don't want to use the bot sell function but just want to use those Sellslotsn() functions from the addon? Did you try just deleting those lines with Mcountround() and Rightbag in them?
yes i want 2 use the function. I did delet the lines its sell items if I execute just the sell script. The bot don't know when 2 go 2 the merchant, it does not count how many free space is left, the previous script had the Mcountround() and Rightbag conected 2 the sell function.

Re: sell bags

Posted: Sun Sep 14, 2014 9:49 am
by rock5
I don't know what those 2 functions do but if you want to check how many free spaces you have left you can use inventory:itemTotalCount(0).

Example: to sell if bag free space is less than 5 use:

Code: Select all

   function selling()
      if 5 > inventory:itemTotalCount(0) then
            if sellright == true
               then
                  player:openStore(117127)
                  if sellbag1 == true
 etc...
Maxalu wrote:The bot don't know when 2 go 2 the merchant
You can use itemTotalCount for that too. At the correct waypoint use something like

Code: Select all

if 5 > inventory:itemTotalCount(0) then
    __WPL:setWaypointIndex(__WPL:findWaypointTag("back to merchant")
end
Or load another waypoint file that takes you back to the npc. That would probably be easier.