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.

can any one change this great irc game script to TCL script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
4mirc
Voice
Posts: 37
Joined: Fri May 16, 2008 11:11 pm
Contact:

can any one change this great irc game script to TCL script

Post by 4mirc »

hello all

i have irc game script and i need to make it work in Eggdrop bot

i know all will love this game coz its good and funny

this is the mirc script code

Code: Select all

on *:text:!wnick:#: {
  if (%qnick.game-status != on) {
    set %qnick.game-status on
    set %qnick.game-nick $qnickrand($chan)
    set %qnick.game-last-nick %qnick.game-nick
    if (!%qnick.game-games) { set %qnick.game-games 1 }
    if (%qnick.game-games) { inc %qnick.game-games }
    /msg $chan 7W14nick-Gam7E 7N14ew Nic7K 12( $+ Game N°: $+ %qnick.game-games $+ 12) 7T14o Stop this nic7K9:4 !wstop
    /nscrammble %qnick.game-nick $chan
    set %qnick.game-start $ctime
  }
  else {
    if (!%floo-time) {
      set -u15 %floo-time ok
      /nscrammble %qnick.game-nick $chan
    }
  }
}    
alias qnickrand {
  var %qnick.game-nick1 = $nick($1,$r(1,$nick($1,0)))
  while ( %qnick.game-nick1 = %qnick.game-last-nick ) {
    set %qnick.game-nick1 $nick($1,$r(1,$nick($1,0)))
  }
  return %qnick.game-nick1
}
alias nscrammble {
  /msg $2 7W14nick-Gam7e  12( $+ Game N°: $+ %qnick.game-games $+ 12) 7U14nscramble this NickNam7E9: $misturecs(%qnick.game-nick)
} 
on *:text:%qnick.game-nick:#: {
  if (%qnick.game-status == on) {
    /msg $chan 7[4 $nick 7] 7W14inns the gam7E 12( $+ Game N°: $+ %qnick.game-games $+ 12) 7T14imeGam7E9: $duration($calc($ctime - %qnick.game-start)) 7T14he nickname wa7S:4 %qnick.game-nick  
    /msg $chan 7W14nick-Gam7e 7T14o new gam7E4 !wnick 
    set %qnick.game-status off
    unset %qnick.game-nick
  }
}
on *:text:!wstop:#: {
  if (%qnick.game-status == on) {
    /msg $chan 7W14nick-Gam7e 12( $+ Game N°: $+ %qnick.game-games $+ 12) 7T14imeGam7E9: 9 $duration($calc($ctime - %qnick.game-start)) 7S14toped!!7!
    /msg $chan 7W14nick-Gam7e  7N14oOne get it right!!! The Scrambled nickname wa7S9:4 %qnick.game-nick 
    set %qnick.game-status off
    unset %qnick.game-nick
    /msg $chan 7W14nick-Gam7e  7T14o a new scrambled nick Typ7E9:4 !wnick
  }
}
;# yeahss you never seen this!!!     #
;# Becouse this on IS MINE ONE :pPpP #
alias misturecs {
  var %trrr = $lower($1)
  var %trr = $len($1)
  var %trr1 = 1
  while (%trr1 <= %trr) {
    var %trr2 = %trr2 $+ $mid(%trrr,%trr1,1) $+ .
    inc %trr1
  } 
  var %tra = %trr2
  var %tr = $numtok(%trr2,46)
  var %tr1 = 1
  var %tr2 = %tr
  while (%tr1 <= %tr) {
    set %tr3  $rand(1,%tr2)
    var %trr12 = $remove(%tra,.)
    var %tr4 = %tr4 $+ $mid(%trr12,%tr3,1) 
    var %tra = $deltok(%tra,%tr3,46)
    dec %tr2
    inc %tr1
  }
  return %tr4
}
;############ The End :)~ ##################
when any user type this on the channel !wnick

the bot will choose nick from the channel and u need to know which nick is that

example :

Code: Select all

[08:45:58‹pm›] ‹!AnR› !wnick
[08:45:59‹pm›] (@Game-Bot) Wnick-GamE New NicK (Game N°:3) To Stop this nicK: !wstop
[08:46:00‹pm›] (@Game-Bot) Wnick-Game (Game N°:3) Unscramble this NickNamE: snro1pac
[08:46:04‹pm›] (@Dex) Scorp1an
[08:46:05‹pm›] (@Game-Bot) [ Dex ] Winns the gamE (Game N°:3) TimeGamE: 6secs The nickname waS: Scorp1an 
[08:46:05‹pm›] (@Game-Bot) Wnick-Game To new gamE !wnick
can any one help me in this game :(

Thanks for all
User avatar
4mirc
Voice
Posts: 37
Joined: Fri May 16, 2008 11:11 pm
Contact:

Post by 4mirc »

hello again

if my request in wrong section tell me to ask in other place

is it allowed to put irc script to make it tcl or not ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Have you found your topic moved to Junk Yard? The role of the The 'Script Requests' section of this forum doesn't create any obligations to anyone.

From the output it seems to be some sort of nick scrambling game. Here some hints on how this can be done.

Code: Select all

# scramble proc by stdragon
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
}
With this code you scramble a word, in your case the nickname you randomly pick from the channel. To pick one use something like:

Code: Select all

set users [chanlist $channel]
set user [lindex $users [rand [llength $users]]]
and to scramble that randomly picked nickname do:

Code: Select all

set scrambled_nick [scramble $user]
Once the game is over, the king and the pawn go back in the same box.
User avatar
4mirc
Voice
Posts: 37
Joined: Fri May 16, 2008 11:11 pm
Contact:

Post by 4mirc »

thx caesar for the reply

but sorry i guess its hard to me to make it coz i can understand tcl codes

if u or any one can make full tcl script that would good

thanks alot
Post Reply