you can make it use ini's like this an also make it channel specific an if you dont want it channel specific you can change the # to learn in the ini set up. just a fast remake no error checks added.
on $*:text:/^~(learn|forget|factoid)\s(\w+)\s?(\w.+)?/iS:#: {
if (!$($+(%,factoidflood,$nick),2)) {
set -u3 $+(%,factoidflood,$nick) on
if ($regml(1) == learn && $regml(3) && !$readini(learn.ini,-n,$regml(2),#)) { writeini -n learn.ini $regml(2) # $regml(3) | msg # the factoid has been saved. }
if ($regml(1) == forget && $readini(learn.ini,-n,$regml(2),#)) { remini learn.ini $regml(2) # | msg # the factoid $regml(2) has been deleted. }
if ($regml(1) == factoid && $readini(learn.ini,-n,$regml(2),#)) { msg # $readini(learn.ini,-n,$regml(2),#)) }
}
}