I'm still testing this as it was just thrown together in a few minutes to combat todays massive chatserver instability and the following massive spamming.
Use at your own risk etc, but it works for me.
Bot.php, function inc_buddy
Find
<?php
	/*
	Buddy logging on/off
	*/
	function inc_buddy($args)
	{
		$user = $this -> aoc -> get_uname($args[0]);
		$mem = $this -> is_member($user);
		$end = "";
		if (!$mem)
		{
?>
Change to:
<?php
	/*
	Buddy logging on/off
	*/
	function inc_buddy($args)
	{
		$user = $this -> aoc -> get_uname($args[0]);
		$mem = $this -> is_member($user);
		// Make sure we only cache members and guests to prevent any issues with !is and anything else that might do buddy actions on non members.
		if ($mem)
		{
			// Buddy logging on
			if ($args[1] == 1)
			{
				// Do we have a logon for a user already logged on?
				if (isset($this -> glob["online"][$user]))
				{
					$this -> log("BUDDY", "ERROR", $user . " logged on despite of already being marked as logged on!!");
					return;
				}
				else
				{
					// Enter the user into the online buddy list
					$this -> glob["online"][$user] = $user;
				}
			}
			else
			{
				// Do we have a logoff without a prior login?
				if (!isset($this -> glob["online"][$user]))
				{
					$this -> log("BUDDY", "ERROR", $user . " logged off with no prior logon!!");
					return;
				}
				else
				{
					unset($this -> glob["online"][$user]);
				}
			}
		}
		
		$end = "";
		if (!$mem)
		{
?>
Depending on what version of the bot you run, find the actual bot function near the top with all the variable declarations.
Make sure the following line appears:
		$this -> glob = array();