This is a game I made which will scramble a word and you must guess the original word correctly.
Commands are:
[!@.]scram or [!@.]scramble to start the game
[!@.]guess (word here) to guess the word
[!@.]addword (words seperated by spaces) to add new words to the file
[!@.]remword (words seperated by spaces) deletes words from the file (must be an op to use this)
[!@.]endscram to end the current game
[!@.]scrampoints to view your current points or [!@.]scrampoints (name) to view that persons current points
[!@.]hint for a hint at the current word
Sorry I don't have a list of words to go with it.
on $*:TEXT:/^[!@.]scram(ble)?$/Si:#: {
if $($+(%,scram.scramword.,$chan),2) { .msg $chan Theres already a scramble game going! The current scrambled word is $qt(%scram.scramword. [ $+ [ $chan ] ]) }
else {
set $+(%,scram.origword.,$chan) $read(ScrambleWords.txt)
set $+(%,scram.scramword.,$chan) $scramble(%scram.origword. [ $+ [ $chan ] ])
.msg $chan Scrambled word is $qt(%scram.scramword. [ $+ [ $chan ] ]) $+ . To guess at what the word is type !guess (Your guess here)
}
}
on $*:TEXT:/^[!@.]guess/Si:#: {
if $($+(%,scram.scramword.,$chan),2) {
if ($2 != %scram.origword. [ $+ [ $chan ] ]) { .msg $chan Sorry that isn't right! Keep trying! }
else {
writeini Scramble.ini points $nick $iif($readini(Scramble.ini,points,$nick),$calc($readini(Scramble.ini,points,$nick) + 5),5)
.msg $chan That's correct! Great job $nick $+ ! You now have $readini(Scramble.ini,points,$nick) Points.
unset $+(%,scram.*.,$chan)
}
}
}
on $*:TEXT:/^[!@.]addwords?/Si:#: {
var %x = 1
while ($gettok($2-,%x,32)) {
if (!$read(ScrambleWords.txt,w,$gettok($2-,%x,32))) {
write ScrambleWords.txt $gettok($2-,%x,32)
var %added = %added $gettok($2-,%x,32)
}
inc %x
}
.msg $chan $iif(!%added,No new words added.,Words added: $replace(%added,$chr(32),$chr(44)))
}
on $*:TEXT:/^[!@.](rem(ove)?|del(ete)?)words?/Si:#: {
if ($nick isop $chan) {
var %x = 1
while ($gettok($2-,%x,32)) {
if ($read(ScrambleWords.txt,w,$gettok($2-,%x,32))) {
var %deleted = %deleted $gettok($2-,%x,32)
write $+(-dl,$readn) ScrambleWords.txt
}
inc %x
}
.msg $chan $iif(!%deleted,None of those words were in the file.,Words deleted: $replace(%deleted,$chr(32),$chr(44)))
}
else { .notice $nick Access denied. }
}
on $*:TEXT:/^[!@.](end|stop)scram(ble)?$/Si:#: {
if $($+(%,scram.scramword.,$chan),2) {
.msg $chan Ended the current game. Word was $qt(%scram.origword. [ $+ [ $chan ] ]) $+ . Better luck next time.
unset $+(%,scram.*.,$chan)
}
}
on $*:TEXT:/^[!@.]scrampoints?/Si:#: {
if (!$2) {
.msg $chan You have $iif($readini(Scramble.ini,points,$nick),$readini(Scramble.ini,points,$nick),0) points $nick $+ .
}
else {
.msg $chan $2 has $iif($readini(Scramble.ini,points,$2),$readini(Scramble.ini,points,$2),0) points.
}
}
on $*:TEXT:/^[!@.]hint$/Si:#: {
if $($+(%,scram.scramword.,$chan),2) {
.msg $chan The first two letters of the current word are $qt($left(%scram.origword. [ $+ [ $chan ] ],2))
}
}
alias scramble {
while ($len(%scrambled) < $len($1)) {
var %current = $r(1,$len($1))
if ($istok(%used,%current,32) == $false) {
var %scrambled = %scrambled $+ $mid($1,%current,1)
var %used = %used %current
}
}
return %scrambled
}
I don't know if you are still around but if you see this could you possibly add a !top10 option where scores are kept in a ini or hsh table i/e !top10 <1st place with a record of # points> !top10 which shows top 10 players with a !reset scores option that only the ops can do
plus if it's not to much trouble maybe make it !top10 daily weekly monthly kinda thing
yeah i don't understand, iput the
[!@.]scram or [!@.]scramble to start the game
[!@.]guess (word here) to guess the word
[!@.]addword (words seperated by spaces) to add new words to the file
......
into document and setings and save it named ScrambleWords.txt
than the script i put that in to remote
is that right way?
I am using this for my bot but it isn't deleting the words from its index when I ask it to delete it...also, how can I change it so that it gives me a random amount of points instead of 5 everytime? Also, I'm new so I probably won't get exactly what you write down...probably better to just send me the altered code.
on $*:TEXT:/^[!@.]remword/Si:#: {
var %d = $read(ScrambleWords.txt, w, $2)
if (( %d == $null )) { notice $nick That word is not in the list | halt }
write -ds $+ $2 ScrambleWords.txt $$2
msg # The word $2 has been removed.
}
It would look something like that :P
You might not want to use anything like that if you think it could cause trouble with people continually removing words but it helps to remove words that are not real words, but it\'s just a suggestion, you might want to incorporate a system where only people who\'s address is in another text file, a kind of \'moderator\' list, but again, just a suggestion.