on 1:TEXT:*:#: {
; its just one letter
if ($len($1-) == 1) {
if ($1 isin $picked) { /msg $chan The letter $1 was already said. }
else {
/set %hm.picked $addtok(%hm.picked, $1, 44)
/hm.guess $chan $1
}
}
}
; Here are our fake vars for now to give some idea as to how it would work
; %hm.answer online
; %hm.guessed ---i-e
; %hm.picket aei
; Syntax: /hm.guess Channel Letter
alias hm.guess {
; unset the temporary guessed var
/unset %temp
; cycle through each letter individually
/set %a 1
while (%a <= $len(%hm.answer)) {
if ($mid(%hm.guessed, %a, 1) == -) {
if ($mid(%hm.answer, %a, 1) == $2) { /set %temp $+(%temp,$2) }
else { /set %temp $+(%temp,-) }
}
else if ($mid(%hm.guessed, %a, 1) == $chr(32)) { /set %temp $+(%temp,.) }
else { /set %temp $+(%temp,$mid(%hm.guessed, %a, 1)) }
; increase loop var (-u0 means kill the variable after executing it)
/inc -u0 %a
}
; Now, replace the guessed with the temp variable (also convert all the .'s to spaces)
/set %hm.guessed $replace(%temp, ., $chr(32))
/unset %temp
; announce result to the users
/msg $1 Current Word: %hm.guessed
}