This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Scramble

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Amr
Halfop
Posts: 94
Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt

Scramble

Post by Amr »

guys , any good scramble game tcl around?
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

Post by Torrevado »

User avatar
Amr
Halfop
Posts: 94
Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt

Post by Amr »

I mean new released one
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

have you checked my scramble version? :) It's a bit dusty but should do the trick.
Once the game is over, the king and the pawn go back in the same box.
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

Post by Torrevado »

@caesar:

I'd like to show answers also on correctly guessed answers. Is there a way to call a variable from another process? ($word).

Code: Select all

# From what file are the words that will be scrambed? 
set scramblefile "scramble.txt" 

# How many seconds to play a scrambled word? 
set ssecs 60 

# Show the answer if nobody got the answer? 
# 0 for NO and 1 for YES. 
set sanswer 0 

### Done with configurations, do not edit past here unless you know TCL. ### 

# binds # 
bind pub o !scramble pub:scramble 

# messages # 
set scongrats { 
  "Well done" 
  "Nice going" 
  "Way to go" 
  "You got it" 
  "That's the way" 
  "Show 'em how it's done" 
  "Check out the big brain on" 
} 

set snonegotit { 
  "Nobody got it right." 
  "Hello? Anybody home?" 
  "You're going to have to try harder!" 
  "Are these too tough for you?" 
  "Am I alone here or what?" 
} 

# scramble # 
proc pub:scramble {nick uhost hand chan text} { 
  if {![file exists $::scramblefile]} { 
    putserv "PRIVMSG $chan :\002Error\002: $::scramblefile dose not exist." 
    return 
  } 

  set sstarted 0 
  foreach bla [utimers] { 
    if {[string match "nobody:gotit*" [lindex $bla 1]]} { 
      set sstarted 1 
    } 
  } 
  if {$sstarted == 1} { 
    putserv "PRIVMSG $chan :HEY! One word at a time!" 
    return 
  } 
  set file [open "$::scramblefile" r] 
  set data [split [read $file] "\n"] 
  close $file 
  set word [lindex $data [rand [llength $data]]] 
  putserv "PRIVMSG $chan :[scramble $word]" 


  # stuff # 
  bind pub - $word pub:gotit 
  utimer $::ssecs [list nobody:gotit $word $chan] 
} 

# got it! # 
proc pub:gotit {nick uhost hand chan text} { 
  putserv "PRIVMSG $chan :[lindex $::scongrats [rand [llength $::scongrats]]] $nick.." 

  # clean # 
  foreach bla [utimers] { 
    if {[string match "nobody:gotit*" [lindex $bla 1]]} { 
      killutimer [lindex $bla 2] 
    } 
  } 
  unbind pub - $::lastbind pub:gotit 
} 

# loosers! # 
proc nobody:gotit {word chan} { 
  if {$::sanswer == 1} { 
    putserv "PRIVMSG $chan :The answer was \002$word\002.. [lindex $::snonegotit [rand [llength $::snonegotit]]]" 
    unbind pub - $word pub:gotit 
    return 
  } 
  putserv "PRIVMSG $chan :[lindex $::snonegotit [rand [llength $::snonegotit]]]" 
  unbind pub - $word pub:gotit 
} 

# scramble proc by stdragon @ forum.egghelp.org 
proc scramble {word} { 
  set letters [split $word ""] 
  set newword "" 
  while {[llength $letters]} { 
    set i [rand [llength $letters]] 
    append newword [lindex $letters $i] 
    set letters [lreplace $letters $i $i] 
  } 
  return $newword 
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I'm going to re-make in a 'namespace' so any variables that is used to not interfere with other scripts you may have loaded. Will reply in a few hours as I'm at work right now. :)
Once the game is over, the king and the pawn go back in the same box.
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

WScrabble 1.10
Presentation

WScrabble is an automatic "robot" or "bot" designed to entertain an IRC chatroom by offering people to play to a Scrabble/Anagrams game.

Like in the Scrabble game or on TV, 10 letters are drawn randomly : Players must then compose the longest word possible using these letters.

The player who found the longest wins points, with a bonus if the word uses all letters. As in the WQuizz script, the bot stores the score of each players and can display a ranklist of the 3 or 10 best players of the week or the year.

Usage

WScrabble is not a mIRC script but a small standalone Windows program in console-mode. It is however highly-configurable, through the file "WScrabble.ini" which you will have to modify before first use.

That way, you will be able to change as you like :

IRC connection settings (including password)
colors and texts displayed
number of letters drawn
the dictionnary of valid words
the letters distribution (to alter the frequency of each letters)

This is a a good scrabble bot how ever it is unfortunate that it hasnt been developed for eggdrop and runs as a seperate application

http://wiz0u.free.fr/wscrabble/index_en.php

Maybe some one could come up with something that will work as equaly as good as this application the developer has no intensions of doing it for eggdrop which is a shame
Post Reply