Page 1 of 1

Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 11:14 am
by hagenleu
There is this addon: Bagcleanerseller.

Similar to micromaco autosell option but simpler: you set start and end bagslot, and, with shop open, appear a button, if pressed all the sellable item are selled (of course without the many options and controls of micromacro).

Now for me, and for all that farm only for money this is just enought, and waiting for the solution of the TABLE ID bug, Rock (or Lisa or someone skilled) can you give a look to this addon and see if there is the possibility to connect micromacro to it? (in the same way as micromacro is connected with Fusion addon).

In attached there is the addond and an immage of the button.

Tnx again for all your work

Hagenleu

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 11:31 am
by rock5
Looks a bit too complex to just figure out but basically you need to find the name of that button in the xml files then find what the "onclick" function is. Then you can just execute that function from the bot.

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 12:43 pm
by hagenleu
Ok, i find in BCS.xml the following:

Code: Select all

<OnClick>
	BCS.Fn.Seller.Sell_to_Vendor(this, key);
</OnClick>
and in bagseller.lua:

Code: Select all

----------------------------------------------------------
--														--
--				Sell-to-Vendor-Button					--
--														--
----------------------------------------------------------

	Sell_to_Vendor							= function()
-->
	----->>>>>><<<<<----- bagid uses slot# 61 to 240 ----->>>>>><<<<<-----
	-- sell all items within specified range according
	-- to the configurated rules in settings
	
	--hook PlaySoundByPath does not work, seems to be an interface call
	BCS.Hooked.InterfaceFXVolume = SYS_AudioSettings_InterfaceSFXVolumeSlider:GetValue();
	-- mute the interface
	InterfaceSFXVolumeSlider_SetValue(0);
	
	-- first remove GarbageItems back into bagpack  
	BCS.Fn.Bag.Remove_from_Garbagebag();
	
	BCS.Seller.BagPages = { [1]=true, [2]=true, [3]=false, [4]=false, [5]=false, [6]=false, };
	
	BCS.Seller.CurrentGained = 0;
	
	-- check whether rented BagPages are involved
	if BCS.BagSlots.BagSlotEnd > 60 then
		for i = 3, 6 do
			local isLet, letTime = GetBagPageLetTime(i);
			if letTime > -1 then -- rented
				BCS.Seller.BagPages[i] = true;
			end;
		end;
	end;
	
	--set StartSlot
	BCS.Seller.CurrentSlot = BCS.BagSlots.BagSlotStart;
	
	-- now set flag for update-event to sell one item per update
	BCS.Timer.SellInProgress = true;
	BCS.Timer.SellMsgSuppress = true;

--><--
	end, -- Sell_to_Vendor
	
	};
--[[	
BCS.Fn.Seller.Sell_to_Vendor()
--]]
--> end of BCS.Fn.Seller	<--	
The function to call is BCS.Fn.Seller.Sell_to_Vendor(this, key), so i can call it in the waypoint with a simple SendMacro or it is more complex? (but differently by the fusion, we don't have to calculate nothing, only call the function-press the button).

According to you, how can i go on?

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 12:59 pm
by lisa

Code: Select all

sendMacro("BCS.Fn.Seller.Sell_to_Vendor(this, key);")
once you have the addon configured using that code from the bot will make it sell.

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 1:02 pm
by rock5
The function doesn't seem to accept any arguments so try this.

Code: Select all

RoMScipt("BCS.Fn.Seller.Sell_to_Vendor()")

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 1:11 pm
by lisa
hmm code I posted works perfectly for me
Use MACRO: Executing RoMScript "BCS.Fn.Seller.Sell_to_Vendor(this, key);".
Current gold: 1290381
Profit: 2856
Elapsed time: 0.23450000000001 minutes.
Profit per hour: 730746.26865668
Clearing target.

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 1:24 pm
by hagenleu
Lol, unbelivable! it's work the first try!

That is the function and very simple to call :P

I use sendMacro("BCS.Fn.Seller.Sell_to_Vendor()") and work like a charm :P

Rock tnx anyway to give me the direction in witch search the right things!

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 5:42 pm
by kanta
lisa wrote:hmm code I posted works perfectly for me
Profit per hour: 730746.26865668
:shock: What are you farming to get so much profit???


If only this addon had a quality filter.....

P.S.
It should also be said that people will need to replace

Code: Select all

		player:merchant("Pancer")
with

Code: Select all

		player:target_NPC("Pancer")
		sendMacro("ChoiceOption(1);");
Took me a few moments to figure out why it wouldn't work.

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 10:22 pm
by rock5
lisa wrote:hmm code I posted works perfectly for me
Yes it would. "this" and "key" in that context would equal nil but it doesn't matter because they are not used in the function.
kanta wrote:P.S.
It should also be said that people will need to replace

Code: Select all

      player:merchant("Pancer")
with

Code: Select all

      player:target_NPC("Pancer")
      sendMacro("ChoiceOption(1);");
Took me a few moments to figure out why it wouldn't work.
So this is the code you were having trouble with? Try this instead to make sure you only sell if the store successfully opens.

Code: Select all

if player:openStore("Pancer") then
    -- your command to sell
end
Of course if it fails to open the store then it will return to farming with, usually for this script, a full inventory. So maybe you might to make sure sell like this.

Code: Select all

repeat
until player:openStore("Pancer")
-- your command to sell
Hope that helps.

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Fri Jun 03, 2011 11:43 pm
by kanta
I'd never get through this coding without you and Lisa :oops:

Thanks again :)

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Sat Jun 04, 2011 7:56 am
by lisa
kanta wrote:
lisa wrote:hmm code I posted works perfectly for me
Profit per hour: 730746.26865668
:shock: What are you farming to get so much profit???
try this 1 then

Code: Select all

Profit per hour: 9119087.7881317
Clearing target.
Yes it is an exact copy paste from MM window =)

Trick is the bot had only been running a minute or less, lol

Ohh yeah I use this as code for selling

Code: Select all

	yrest(100);
	player:target_NPC("Pancer")
	yrest(1000);
    sendMacro("ChoiceOption(1);");
	yrest(1000)
	sendMacro("BCS.Fn.Seller.Sell_to_Vendor(this, key);")
	player:rest(7)
	yrest(100); 
Generally 3 full bags so it can take the 7 seconds to sell it all. If you use less bags can just reduce the player:rest. I think though those few extra seconds makes sure your bags are empty for the next run.
This won't repair your items though.

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Sat Jun 04, 2011 11:48 am
by kanta
lisa wrote: Ohh yeah I use this as code for selling

Code: Select all

	yrest(100);
	player:target_NPC("Pancer")
	yrest(1000);
    sendMacro("ChoiceOption(1);");
	yrest(1000)
	sendMacro("BCS.Fn.Seller.Sell_to_Vendor(this, key);")
	player:rest(7)
	yrest(100); 
Generally 3 full bags so it can take the 7 seconds to sell it all. If you use less bags can just reduce the player:rest. I think though those few extra seconds makes sure your bags are empty for the next run.
This won't repair your items though.
I've been using yrest(18000). My connection sometimes gets laggy so I give it some extra time. It's still faster than the previous way. As for repairs, one of my addons takes care of that :) I've also started using the repeat code that Rock5 posted to make sure the shop opens and the junk gets sold, seems to be working very well.

Re: Bagcleanerseller, a temporary solution to TABLE ID bug?

Posted: Sat Jun 11, 2011 9:48 pm
by Tynos
Really nice addon!!!! It works perfect :D