I have a small NPC script I wrote a while back.
Admins may type any of the following commands:
/spawnNPC Name - Spawns a bot with the specified name
/deleteNPC Name - Deletes the named bot
/exploreNPC Name - Tells the named bot to explore
/stopNPC Name - Stops the named bot from exploring/looking
/fetchNPC Name - Fetches the named bot to you
/lookNPC Name - Tells the named bot to look at you
/followNPC Name - Tells the named bot to follow you
I can give if you want, or if you still plan on writing your own script, here is exploring functions.
function AIPlayer::randomMove(%npc)
{
%loc = vectorAdd(%npc.getPosition(),getRandom(-25,25) SPC getRandom(-25,25) SPC 0);
%npc.setMoveDestination(%loc);
%npc.setAimLocation(%loc);
%npc.explore = schedule(2000,0,'NPCexplore',%npc);
}
function NPCexplore(%npc)
{
if(isObject(%npc))
{
%npc.stop();
%npc.randomMove();
}
}