on *:text:*:#: {
if ($1 == ?) {
var %text = $2- =>
%text = $read(learnt.txt, w, %text $+ *)
;if "this entry*" is found at the beginning of a line,
if (%text) {
var %split=> = $calc($findtok(%text,=>,1,32) +1)
msg $chan hmm, $gettok(%text,%split=> $+ -,32)
}
}
if ($1 == !learn) {
if ($findtok($2-,is,1,32)) {
var %text = $2-
%text = $reptok(%text,is,=>,1,32)
write learnt.txt %text
;write this to a file: this entry => that info
;after it's done writing verify that the data did write to the file and if so have it tell you "ok".
if ($read(learnt.txt,w,%text)) { msg $chan ok }
else { msg $chan I pooped my pants }
}
}
}
[11:11:23] <brandon> !learn this bathroom is full
[11:11:23] <@Scorpwanna> ok
[11:11:28] <brandon> ? this bathroom
[11:11:28] <@Scorpwanna> hmm, full
[11:12:14] <brandon> !learn whoa whoa whoa whoa Lois this is not my drinking glass!
[11:12:14] <@Scorpwanna> ok
[11:12:27] <brandon> ? whoa whoa whoa whoa Lois this
[11:12:27] <@Scorpwanna> hmm, not my drinking glass!
Course this is just a sample. It will have flaws, but that's for you to figure out
.