Page 2 of 2
Re: harvest & co
Posted: Mon Jan 27, 2014 10:41 am
by Danni

I can't read that message, cause that's not english
but my guess is, that some code in your LOAD does not work.
wait
Re: harvest & co
Posted: Mon Jan 27, 2014 10:52 am
by Danni
change
Code: Select all
function findMyItem()
local itemhere = false
repeat
item = player:findNearestNameOrId(120431) -- Whatever the Name or Id is for the item you want to use
if item and 50 > distance(item,player) then
player:target_Object(120431)
itemhere = true
into
Code: Select all
function findMyItem()
local itemhere = false
repeat
item = player:findNearestNameOrId(120431) -- Whatever the Name or Id is for the item you want to use
if item and 50 > distance(item,player) then
player:target_Object(120431)
itemhere = true
end
Re: harvest & co
Posted: Mon Jan 27, 2014 11:07 am
by Miworax
it dont work

dont know that error error message in english, but something is wrong with the waypointlist.lua, he cant run the lua codes or something like that
Re: harvest & co
Posted: Mon Jan 27, 2014 1:18 pm
by Miworax
maybe someone else has an idea?
Re: harvest & co
Posted: Mon Jan 27, 2014 1:39 pm
by Bill D Cat
You didn't include my entire function. "repeat" without the "until" line or the final "end" to close the function will each cause an error.
Code: Select all
function findMyItem()
local itemhere = false
repeat
item = player:findNearestNameOrId(xxxxxx) -- Whatever the Name or Id is for the item you want to use
if item and 50 > distance(item,player) then
player:target_Object(item.Id)
itemhere = true
else
yrest(5000)
end
until itemhere == true
end
Re: harvest & co
Posted: Mon Jan 27, 2014 1:49 pm
by Miworax
and then in the waypoint part i must write "findMyItem()" , right ?
Re: harvest & co
Posted: Mon Jan 27, 2014 1:50 pm
by Bill D Cat
That would be correct.
Re: harvest & co
Posted: Mon Jan 27, 2014 3:21 pm
by Miworax
9:19pm - ...rs/Angrod/Desktop/Rom/scripts/rom/classes/player.lua:3610: bad argum
ent #1 to 'pairs' (table expected, got nil)
that comes if he is at the first "findMyItem()</waypoint>"
Re: harvest & co
Posted: Mon Jan 27, 2014 3:37 pm
by Bill D Cat
Code: Select all
/scripts/rom/classes/player.lua:3610
That line of code is right in the middle of the function:
Code: Select all
-- auto interact with a merchant
function CPlayer:merchant(_npcname, _option, _evalfunc)
So I have no idea what this would have to do with the function that I wrote for you.
Re: harvest & co
Posted: Mon Jan 27, 2014 11:32 pm
by rock5
I'll go out on a limb here and assume Mirowax is using a modified version of player.lua. That's why the error number doesn't line up with a "pairs" command. Most likely then the error is happening in the findNearestNameOrId function as that is what is used in Bill D Cats code. Which leads me to the conclusion that Mirowax used the code exactly as written, ie. he left xxxxxx unchanged. That would cause a "pairs" error.
Re: harvest & co
Posted: Tue Jan 28, 2014 8:09 am
by Miworax
my english istn so good that i can understand this

Re: harvest & co
Posted: Tue Jan 28, 2014 10:00 am
by rock5
Did you remember to change xxxxxx to 120431?
Re: harvest & co
Posted: Tue Jan 28, 2014 10:25 am
by Miworax
let me check and try some minutes
Re: harvest & co
Posted: Tue Jan 28, 2014 3:21 pm
by Miworax
yeah, it work, thanks all
