(chr(1)."ACTION")) { return; } $token=strtolower(array_shift($parts)); if (in_array($token,$verbs)==False) { return; } $token=array_pop($parts); if ($token<>($bot_nick.chr(1))) { return; } $token=strtolower(array_pop($parts)); if (in_array($token,$prepositions)==False) { return; } while (count($parts)>1) { $token=strtolower(array_pop($parts)); if (in_array($token,$prepositions)==False) { $parts[]=$token; break; } } $item=trim(implode(" ",$parts)); if ($item=="") { return; } $last_timestamp=get_bucket("<>"); if ($last_timestamp<>"") { if (($timestamp-$last_timestamp)>",$timestamp); if (file_exists($fn)==True) { $inventory=json_decode(file_get_contents($fn),True); if ($inventory==Null) { privmsg("error reading inventory file. inventory reset"); $inventory=array(); } } else { $inventory=array(); } if (in_array($item,$inventory)==True) { privmsg("item already exists in inventory"); return; } $inventory[]=$item; if (file_put_contents($fn,json_encode($inventory,JSON_PRETTY_PRINT))===False) { privmsg("error writing inventory file"); return; } privmsg(chr(1)."ACTION is now carrying ".$item.chr(1)); ##################################################################################################### ?>