Why:
This work: game.player.print(game.player.selected.getitemcount())
but this doesn't: game.player.selected.removeitem({name="iron-gear-wheel",count=2}) when I print result I get 0 -> it mean no item removed
My cursor is above assembly machine mk2 which produces iron-gear-wheel.
In this assembly currently are: 0 iron plate and 3 iron-gear-wheel.
I wish to remove iron-gear-wheel from assembly machine... completely remove (delete), not move to inventory.
Is it possible to create new entity (assembly machine) and order it thru the script to craft some specific item?
Please help, need this to my 3rd mod
Question about entity
Question about entity
Lenovo Y580 8GB Ram GF660m 128GB SSD W7
Re: Question about entity
I have found this site in wiki: LINK
But this doesn't work:
remove - LuaEntity doesn't cantain readable property remove
clear - LuaEntity doesn't cantain readable property clear
This work:
getitemcount()
insert({name="name",count=x})
This work but...: - this method found here
game.player.selected.removeitem({name="name",count=x}) (and mouse over assembling machine or chest) - always return 0
when I use it on player inventory it work:
game.player.removeitem({name="name",count=x})
How to remove item from assembly machine? - > Solved -> game.player.selected.getinventory(2).remove({name="iron-gear-wheel",count=2})
But this doesn't work:
remove - LuaEntity doesn't cantain readable property remove
clear - LuaEntity doesn't cantain readable property clear
This work:
getitemcount()
insert({name="name",count=x})
This work but...: - this method found here
game.player.selected.removeitem({name="name",count=x}) (and mouse over assembling machine or chest) - always return 0
when I use it on player inventory it work:
game.player.removeitem({name="name",count=x})
How to remove item from assembly machine? - > Solved -> game.player.selected.getinventory(2).remove({name="iron-gear-wheel",count=2})
Lenovo Y580 8GB Ram GF660m 128GB SSD W7