Hangman script - 20/04/06 04:32 PM
Hello! I'm planning to make a hangman script....
Everything's ok so far.. now when someone does !hangman letter, it should replace "-" with the letter if it exists.. and I got stuck here....
In fact, I tried to get the position of the letter using $pos.. but I failed... can somebody help?
Thanks in advance.
Regards,
Chadi.
Code:
set %hangman.temp $read(hangman.txt) set %hangman.hint $gettok(%hangman.temp,1,42) set %hangman.answer $gettok(%hangman.temp,2,42) var %tmp, %test = $regsub(%hangman.answer,/[1-9a-zA-Z]/gi,-,%tmp) set %hangman.answer2 %tmp
Everything's ok so far.. now when someone does !hangman letter, it should replace "-" with the letter if it exists.. and I got stuck here....
In fact, I tried to get the position of the letter using $pos.. but I failed... can somebody help?
Thanks in advance.
Regards,
Chadi.