Page 4 of 6

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 3:55 pm
by Sumdumguy
When I start the bot, there is no inventory scan anymore, i.e. the %-count. Also, selling still does not work for me :(

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 4:16 pm
by jduartedj
Have you updated to latest SVN version? r548?

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 4:23 pm
by Alkaiser
Argh... I've set INV_MAX_SLOTS back to 60, as leaving sell slots to 31 - 60 still sells from bag2. I'm still confused, but it works.

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 4:28 pm
by Sumdumguy
jduartedj wrote:Have you updated to latest SVN version? r548?
Yes I did. I turned off Server-side safe, deleted macro bsd. Bot works fine, runs around, kills stuff, i get my equipment repaired, but I can't sell stuff.
Maybe I'm missing some settings? but since I don't get the inventory scan, I don't think the problem are my profile.xml or the settings.lua.

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 4:34 pm
by jduartedj
Alkaiser wrote:Argh... I've set INV_MAX_SLOTS back to 60, as leaving sell slots to 31 - 60 still sells from bag2. I'm still confused, but it works.
Wasn't this deprecated? doesn't the bot assumed INV_MAX_SLOTS=180 always?

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 4:38 pm
by jduartedj
Sumdumguy wrote:
jduartedj wrote:Have you updated to latest SVN version? r548?
Yes I did. I turned off Server-side safe, deleted macro bsd. Bot works fine, runs around, kills stuff, i get my equipment repaired, but I can't sell stuff.
Maybe I'm missing some settings? but since I don't get the inventory scan, I don't think the problem are my profile.xml or the settings.lua.
Could you post your autosell options? both in settings and profile.

Not getting the inv. scan only means that it has been cached and no longer needs to be loaded, only updated.

Try turning autosell debug on and report what happens when you try to sell.

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:07 pm
by Rickster
allways when using an inventory function, like

inventory:itemTotalCount(0);

it returns the error:

"/micromacro/scripts/rom/classes/inventory.lua:799: bad argument #1 to
'lower' (string expected, got nil)"

I also get the same error, when using the unchanged millersfarm goldegg script.

any ideas?

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:26 pm
by Petzzz
try inventory:itemTotalCount(0,"bags")

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:29 pm
by jduartedj
it is an error in the update, try using a second argument like ("all","itemshop","magicbox","bags","bag1","bag2", etc). It's supposed to default to "bags" but somehow it doesn't.

try this:

Code: Select all

 inventory:itemTotalCount(0,"bags")

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:31 pm
by Rickster
Petzzz wrote:try inventory:itemTotalCount(0,"bags")
thank you. i´ll try that one.

next issue, when using

inventory:useItem(xxx);

it returns the same error:
"/micromacro/scripts/rom/classes/inventory.lua:799: bad argument #1 to
'lower' (string expected, got nil)"

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:33 pm
by jduartedj
An admin should replace the current beginning of CInventory:itemTotalCount [EDIT: and CInventory:findItem] with:

Code: Select all

	local first, last;
	
	if range == nil then
		first , last = 61, 240 -- default, search only bags
	else
	first, last = getInventoryRange(range) -- get bag slot range
	end
makes more sense... and doesn't produce errors.

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:35 pm
by jduartedj
Rickster wrote:
Petzzz wrote:try inventory:itemTotalCount(0,"bags")
thank you. i´ll try that one.

next issue, when using

inventory:useItem(xxx);

it returns the same error:
"/micromacro/scripts/rom/classes/inventory.lua:799: bad argument #1 to
'lower' (string expected, got nil)"
Same thing takes the same second argument.
BTW:given this, the same request for a commiter/admin to update Cinventory:itemTotalCount also applies for finditem.

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:38 pm
by Alkaiser
"bags" works? I don't see that listed in this function.

Code: Select all

function getInventoryRange(range)
	local rangeLower = string.lower(range)
	if rangeLower == "all" then
		return 1, 240
	elseif rangeLower == "itemshop" then
		return 1, 50
	elseif rangeLower == "magicbox" then
		return 51, 60
	elseif rangeLower == "bag1" then
		return 61, 90
	elseif rangeLower == "bag2" then
		return 91, 120
	elseif rangeLower == "bag3" then
		return 121, 150
	elseif rangeLower == "bag4" then
		return 151, 180
	elseif rangeLower == "bag5" then
		return 181, 210
	elseif rangeLower == "bag6" then
		return 211, 240
	end
end

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:45 pm
by jduartedj
Truly I didn't try it my self, I just quoted the SVN update comment:
SVN update r548 wrote:Changed: inventory:itemTotalCount can now specify a 2nd argument which bag ("all","itemshop","magicbox","bags","bag1","bag2", etc) defaults to "bags".
But All I did was update the code my self so that the supposedly "bags" is default by using the code I just posted before.

Admin or someone will be on it soon enough be patient.

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:46 pm
by Rickster
thanks jduartedj!

but, while
inventory:itemTotalCount(0,"bags")

works fine

inventory:useItem(mount,"bags");

doesn´t.
(-- mount set to "Infernalisches Albtraum-Reittier (30 Tage)" in another place)

does it work on your side?

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:51 pm
by Sumdumguy
jduartedj wrote: Could you post your autosell options? both in settings and profile.
Settings.lua:

Code: Select all

-- expert inventar
			INV_MAX_SLOTS = 120,	 			-- maximal slots to update in the inventory:update()
			INV_UPDATE_INTERVAL = 300,	 	-- full inventory update every x seconds (only used indirect atm)
			INV_AUTOSELL_ENABLE = true,	-- autosell items at merchant true|false
			INV_AUTOSELL_FROMSLOT = 31,		-- autosell from slot # 
			INV_AUTOSELL_TOSLOT = 120,		-- autosell to slot #
			INV_AUTOSELL_QUALITY = "white, green, blue",	-- itemcolors to sell
			INV_AUTOSELL_IGNORE = nil,		-- itemnames never so sell
			INV_AUTOSELL_NOSELL_DURA = 0,	-- durability > x will not sell, 0=sell all
			INV_AUTOSELL_STATS_NOSELL = nil,	-- stats (text search at right tooltip side) that will not be selled
			INV_AUTOSELL_STATS_SELL = nil,		-- stats (text search at right tooltip side) that will be selled, even if in nosell
It doesn't matter what I set INV_AUTOSELL_FROMSLOT = 31, to. 1, 31, 61, 42, nothing works.

profile.xml:

Code: Select all

<!-- Shopping options, how many of what do you want to keep in your inventory -->
		<option name="HEALING_POTION" value="10" />
		<option name="MANA_POTION" value="0" />
		<option name="ARROW_QUIVER" value="0" />
		<option name="THROWN_BAG" value="0" />
		<option name="POISON" value="0" />
the bot does buy the healing potions, but doesn't sell.
Not getting the inv. scan only means that it has been cached and no longer needs to be loaded, only updated.
Try turning autosell debug on and report what happens when you try to sell.
[/quote][/quote]

how do I do that?

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:52 pm
by jduartedj
Rickster wrote:thanks jduartedj!

but, while
inventory:itemTotalCount(0,"bags")

works fine

inventory:useItem(mount,"bags");

doesn´t.
(-- mount set to "Infernalisches Albtraum-Reittier (30 Tage)" in another place)

does it work on your side?

OOPS you'r right it DOESNT take a 2nd arg in use item.

The problem is finditem should default to "bags" too and it doesnt, and finditem is used in useitem.

try opening inventory.lua and replace:

Code: Select all

	local item = self:findItem(itemNameOrId)
by:

Code: Select all

	local item = self:findItem(itemNameOrId,"all")
in

Code: Select all

function CInventory:useItem(itemNameOrId)

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 5:59 pm
by jduartedj
Sumdumguy wrote: how do I do that?
First of all I recommend that you don't alter ANYTHING in settings.lua, since these are profile options you can set them in your profile using:

Code: Select all

<option name="INV_AUTOSELL_ENABLE"	value="true" />
and so on for every item.

also to answer your question:

Code: Select all

<option name="DEBUG_AUTOSELL"	value="true" />
put this on your profile (again you can do it in settings.lua but I don't recommend)

These values you posted seem to be OK. Do you get any errors trying to sell? try enabling debug and post back pls.

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 6:04 pm
by Sumdumguy
I assume the output will be in the micromacro console window?

Code: Select all

The macro is currently not running. Press the start key (ENTF) to begin.
You may use (ENDE) key to stop/pause the script.
Resumed.
OPENING LOCAL SKILLS DB!
RoM windows size is 1680x1028, upper left corner at 0,22
MACRO Test: ok
Ranged skill found: SCOUT_SHOT
[DEBUG] CPU Frequency 2642.402
Loaded waypoint path test.xml
No return path with default naming test_return.xml found.
We use the normal waypoint path test.xml now.
Clearing target.
Equipment update took: 2
Moving to waypoint #1, (1398, 23289)
Use 6: KNIGHT_ENHANCED_ARMO=>   <UNKNOWN> (1000/1000)
Use 5: KNIGHT_HOLY_SEAL    =>   <UNKNOWN> (1000/1000)
Equipment update took: 2
Moving to waypoint #2, (1439, 23281)
We try to find NPC Bartai: Shopping..........
Clearing target.
Equipment update took: 3
Moving to waypoint #3, (1460, 23256)
Equipment update took: 2
Moving to waypoint #4, (1619, 23082)
Stopping execution.

Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
So apparently...nothing is reported? Or should I restart the client or?

Re: SVN r544 for game version 3.0.7.2322

Posted: Sun Dec 19, 2010 6:12 pm
by jduartedj
oddly this helped me see you must have some other problem.

Code: Select all

Equipment update took: 2
this seems odd! it should do this... You must have some inventory setting wrong, have you got undmodified versions of inventory.lua, item.lua and address.lua updated to r548?