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.

spin.tcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
a
anarchopunk
Voice
Posts: 5
Joined: Mon Nov 27, 2006 7:53 am

spin.tcl

Post by anarchopunk »

i need a lil help here. what should i do to to make the !spin be used by the last nick only? what code should i put in cuz i cant figure it out. tks

Code: Select all

###  This Script Not Belong To Me But I Do Some Changes.
###  Now The Spin The Bottle Have A Random Message.
###  Anyone Can Add Easily The Options Of The Random Message That Want.
###
###     Written By Sergios K. sergios_k@hotmail.com
###
###
###   Testing
###    Platforms : Linux 2.2.16   TCL v8.3
###                Eggdrop v1.6.0
###                Eggdrop v1.6.6
###         And : SunOS 5.8      TCL v8.3
###                Eggdrop v1.5.4
###
###  Description : IRC Game,the famous game Spin The Bottle (night at beatch,that was my job,lol)
###
###   Future Plans : Send in suggestions.
###
### Author Contact :     Email - sergios_k@hotmail.com
###                      Email - sergios@zeus.dynip.com
###                   Home Page - http://zeus.dynip.com/programs
###                     IRC - Nick: Sergios
###                   Support Channels: #Parea @GRNet (nini.irc.gr)
###                   #Help @ZeusNet (patra.dynip.com)
###
###
###                  History : 07/29/2001 - First Release
###
###    This Script Belong To moonwolf, just i do change into random message.
###    Flames/suggestions/invitations to dinner:
###    moonwolf on IRC                    moonwolf@wolflair.demon.co.uk
###    BOTNET: moonwolf@phelan            wolf@spodbox.ehche.ac.uk
###
###    Oh, BTW, right now the last_nick function doesn't work.  Anyone tell
###    me why please?   Also working on stopping more than one person
###    spinning it at a time.  Suggestions for that also appreciated.  k.
###
###    Modified a bit by dhbrown [chocolat@undernet]. I think "last_nick"
###    works now...
###    Adapted for 1.0 by Robey
###

###    spin_bunny:   Coded by moonwolf with input from Sloot. Reworked by chocolat
###             to eliminate bot, self, last_nick kissing. Incorporates
###             previous "init_bunny" code.

###
### Define last_nick to be $botnick if not yet defined...
###
if {![info exists last_nick]} {set last_nick $botnick}

proc spin_bunny {nick uhost handle chan args} {
  global botnick last_nick
  global rep
#
#  Define last_nick = $botnick if last_nick now gone from channel
#
  if {![onchan $last_nick $chan]} {set last_nick $botnick}
  set mylist [chanlist $chan]
#
# Remove the bot from the list (life's too short to kiss bots!)
#
  set wb [lsearch $mylist $botnick]
  set mylist [lreplace $mylist $wb $wb]
#
# Remove the invoking nick from the list
#
  set wn [lsearch $mylist $nick]
  set mylist [lreplace $mylist $wn $wn]
#
# If our first time thru, last_nick = $botnick, so we're done.
# Else, remove last person kissed from the list too.
#
  if {$last_nick != $botnick} {
    set wl [lsearch $mylist $last_nick]
    set mylist [lreplace $mylist $wl $wl]
  }
#
# Pick one of the remaining people at random. Make sure
# we're not just playing with ourselves... :)
#
  set mylength [llength $mylist]
  if {$mylength == 0} {
  putserv "PRIVMSG $chan :Well, $nick, there's no one new to kiss! :("
  return 0
  }
  set myindex [rand $mylength]
  set result [lindex $mylist $myindex]
  set rep {
  "kiss"
  "hugs"
  "kiss into mouth of"
  "do anything that want"
  "go close of"
  "kiss on the cheak to"
  "explain what do you feel for"
}
#
# Build the suspense up somewhat
#
  putserv "PRIVMSG $chan :$nick spins the bottle ....."
  putserv "PRIVMSG $chan :Where it will point nobody knows ...."
  putserv "PRIVMSG $chan :Round and round it goes ....."
  putserv "PRIVMSG $chan :Round and round it goes ....."
  putserv "PRIVMSG $chan :and it slows and comes to a stop ..."
  putserv "PRIVMSG $chan :pointing at ..... $result!!!!"
  putserv "PRIVMSG $chan :Now $nick you must [lindex $rep [rand [llength $rep]]] $result!!!"
#
# Now define last_nick for future spins...
#
  set last_nick $result
  return 1
}
#
# Bind the command public so anyone can do it. (on any channel)
#
bind pubm - "*!spin*" spin_bunny
bind pubm - "*!spin*" spin_bunny
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

What do you mean by, used by the last nick only?
a
anarchopunk
Voice
Posts: 5
Joined: Mon Nov 27, 2006 7:53 am

Post by anarchopunk »

<&anarchopunk> !spin
<@Junkie> anarchopunk spins the bottle .....
....
<@Junkie> pointing at ..... testing!!!!
<&anarchopunk> !spin
<@Junkie> anarchopunk spins the bottle .....
....
<@Junkie> pointing at ..... kage!!!!


I mean that the next person after i !spin the bottle should only spin if it is testing, not another person.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

What happens if it points at someone who's idle? Then you'd have to rehash to unset the "last person"

I don't think that's a mod I'd wanna do, although I did some other mods to clean up the script..

Maybe someone else will..
a
anarchopunk
Voice
Posts: 5
Joined: Mon Nov 27, 2006 7:53 am

Post by anarchopunk »

well .. if it will point to someone who is idle, i still have the !last_nick option to reset it..
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I posted a copy of the mods I've done to this spin.tcl script here:
http://members.dandy.net/~fbn/spin.tcl.txt

Changes:
- added spinignore list, spinchans, spinning flag (to prevent multiple spins), proper english, indentation, etc.
User avatar
ZEXEL
Halfop
Posts: 45
Joined: Tue Jun 27, 2006 10:47 pm
Contact:

Hot!

Post by ZEXEL »

yo... thank you very much... :wink:
.:[ Knowledge Is The Power ]:.
a
anarchopunk
Voice
Posts: 5
Joined: Mon Nov 27, 2006 7:53 am

Post by anarchopunk »

10x .
Post Reply