ToadKing

ToadKing

Joined
Apr 03, 2008

Activity Stream

ToadKing commented on a Page, Unique Auto Voicer  -  Apr 06, 2008

Works like a charm! Thanks a million and keep up the good work.

 Respond  
ToadKing commented on a Page, Op Commands / scramblegame / fun commands  -  Apr 05, 2008

The word scramble game is great - once some minor editing is done. You did not have to include all that extra code with general op commands/slaps/kicks, etc. If anyone wants to add just the scramble game (which is fun), all they need is

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
}

}

Two other points: In your introduction above you list !addword <---to add words, when in the script itself it looks for--> !addwords

Anyone else can simply go (in XP) to their C:\Docs and Settings\USERNAME\App Data\Mirc and open the ScrambleWords.txt and add their own words. IF YOU DO: you can only have one word per line!! Hyphenated words work fine, but if you use 2 words (i.e., \'hot dog\') your mirc will lock up when you try to play a game.

All in all, it\'s a fun game - great work!

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.