-.-Hangman V1.0-.-

By SL on Jul 25, 2004

Ok 1st of all this is not my code...I edited it...It is Josiah's code and I got his permition to edit it

How it works is you msg the bot !hangman

And check in the room ehich you specified

;coded : Josiah
;edited : SL
;snippit : -.-Hangman V1.0-.-
;server : irc.4everlost.co.za
;room : #slc
;webpage : http://slchat.50megs.com/Home.htm
;Date codded : 25/07/2004
alias hc1 { return 07,0 }
alias hc2 { return 06,0 }
on *:Text:!*:*:{ do.hang $1- }
on *:Input:#:{ if ((.* iswm $1) || (!* iswm $1)) { do.hang ! $+ $right($1-,-1) } }
alias do.hang {
  if (($1 == !hangman) && (!$hget(hangman))) {
    hmake hangman 10
    hadd hangman word $3-
    hadd hangman chan $2
    hadd hangman man $iif($2 ison $chan, $2, $nick($2, $rand(1,$nick($2,0))))
    hmsg $msg.hang.start
  }
  if (!$hget(hangman)) { return }
  if ($1 == !hang) {
    if (($2 !isalpha) || ($len($2) != 1)) {
      hmsg $hc1 $+ You gotta pick a letter moron.
      return 
    }
    elseif ($hget(hangman,Picked. $+ $2)) {
      hmsg $hc1 $+ Idiot... Try picking a letter that somebody else hasn't picked.
      return
    }
    else {
      hadd hangman Picked. $+ $2 1
      if ($2 isin $hget(hangman,word)) { 
        hmsg $msg.hang.right
        hang.checkwin
      }
      else { 
        var %hang.part = $hang.part
        hmsg $msg.hang.wrong(%hang.part)
      }
    }
  }
}
alias hang.part {
  hadd hangman wrong $calc($hget(hangman, wrong) + 1)
  if ($hang.partname($hget(hangman, wrong)) == hanging) {
    hmsg $msg.hang.dead
    hfree hangman
    halt
  }
  return $hang.partname($hget(hangman, wrong))
}
alias hang.checkwin {
  if ($hang.got != $hget(hangman,word)) { return }
  hmsg $msg.hang.save
  hfree hangman
  halt
}
alias hang.partname { return $gettok(a head;a neck;torso;arms;hands;legs;feet;hanging, $1, $asc(;)) }
alias hang.got {
  var %i = 1,%hang.got = $hget(hangman, word)
  unset %hang.left
  while (%i <= 26) {
    if (!$hget(hangman, Picked. $+ $chr($calc(96 + %i)))) { 
      %hang.got = $replace(%hang.got, $chr($calc(96 + %i)), @) 
      set -u120 %hang.left %hang.left $+ $chr($calc(96 + %i)) 
    }
    inc %i
  }
  return %hang.got
}
alias hmsg { msg $$hget(hangman,chan) $1- }
alias msg.hang.clue { return $hc1 $+ Current clue: $hc2 $+ $hang.got $hc1 $+ Letters remaining: $hc2 $+ %hang.left }
alias msg.hang.save { return $hc2 $+ $hget(hangman,man) $+ $hc1 is saved! You're the best channelmates a person could want. }
alias msg.hang.dead { return $hc2 $+ $hget(hangman,man) $+ $hc1 is DEAD! You all suck. Word: $hc2 $+ $hget(hangman,word) }
alias msg.hang.wrong { return $hc1 $+ Smooth gimp! One step closer to dead. You just got $hc2 $+ $hget(hangman, man) $+ $hc1 $+ : $+ $hc2 $1 $+ $hc1 $+ ! $msg.hang.clue }
alias msg.hang.right { return $hc1 $+ Well done, $hc2 $+ $nick $+ $hc1 $+ ! You picked a winning letter. $msg.hang.clue }
alias msg.hang.start { return $hc1 $+ Get ready for some hangman... We are hanging $hc2 $+ $hget(hangman,man) $+ $hc1 $+ , unless you can prevent it. $hc2 $+ !hang <letter> $+ $hc1 to guess a letter. $msg.hang.clue }

Comments

Sign in to comment.
CadetAndrew   -  May 27, 2009

It seems like this only works once....

 Respond  
SL   -  Aug 15, 2004

mmm, I\'l get working on it soon, or try, I\'m currantly occupied with a server that I am creating and I do not check posts regularry

 Respond  
airharm   -  Aug 03, 2004

ok i got this to work. I was just wondering if you could add a statistics thing.. like in ranks the person to die the most, and stuff. Is it possible? Please do it, it\'ll make it more interesting, hehe

 Respond  
airharm   -  Aug 03, 2004

and u messed up in the beginning... its supposed to be on :Text:!:#:{ do.hang $1- }

 Respond  
airharm   -  Aug 03, 2004

word/sentence whatever it is, how does the persont that is being hanged choose it, or someother way? from the txt file? It doesn\'t start when somebody typed !hangman

 Respond  
airharm   -  Aug 03, 2004

The game doesn\'t even start anymore, and how do i choose a word? I am noob sorry :(

 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.