Use strtok_r rather than strtok
Do not send network frame when character position does not change
Avoid race-condition on searching for a new file to create
Fix npc creation.