hkzorman/advanced_npc

Problem with actions argument of npc.add_schedule_entry method

Closed this issue · 2 comments

I believe the syntax is not correct, or maybe the API uses the same term actions to refer to two different things.

function npc.add_schedule_entry(self, schedule_type, date, time, check, actions)

1º case - actions is a table with some action aguments. In this case, the table must contain some values such as min_count and max_count for example.
2º case - actions is one of the arguments of the first case.

After all, what is the correct argument for actions? actions or actions?

Maybe it's the first case

-- Actions is an array of actions and tasks that the NPC

Yes @BrunoMine , actions in this case is the first link. You provide a Lua array which will be executed in order. This Lua array can contain:

  • An action
  • A task
  • A property change (which is executed immediately and doesn't wait for the actions/tasks timer, please look at this)
  • A schedule query/check (this is for advanced jobs which require constant looking around, like mining, farming, cutting trees, etc. and is still in progress. The farmer occupation uses it)