How can i controll my NPC's in my RPG?

The games uses a main loop that waits for user input, then redraws the screen and other SUB's and then continues the loop.