I think the problem comes from if you have a bot field "isbot" or not.
I added a check in the program for bots.
Code:
CREATE TABLE `botinventory` (
`npctypeid` int(11) NOT NULL default '0',
`botslotid` int(11) default NULL,
`itemid` int(11) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `botleader` (
`botid` int(11) NOT NULL default '0',
`leaderid` int(11) default NULL,
PRIMARY KEY (`botid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE npc_types add `isbot` tinyint(4) NOT NULL;
GeorgeS