| View previous topic :: View next topic |
| Author |
Message |
anarchopunk Voice
Joined: 27 Nov 2006 Posts: 5
|
Posted: Tue Nov 28, 2006 6:21 am Post subject: spin.tcl |
|
|
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: |
### 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
|
|
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Nov 28, 2006 6:28 am Post subject: |
|
|
| What do you mean by, used by the last nick only? |
|
| Back to top |
|
 |
anarchopunk Voice
Joined: 27 Nov 2006 Posts: 5
|
Posted: Tue Nov 28, 2006 6:43 am Post subject: |
|
|
<&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. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Nov 28, 2006 3:47 pm Post subject: |
|
|
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.. |
|
| Back to top |
|
 |
anarchopunk Voice
Joined: 27 Nov 2006 Posts: 5
|
Posted: Wed Nov 29, 2006 8:31 am Post subject: |
|
|
| well .. if it will point to someone who is idle, i still have the !last_nick option to reset it.. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Nov 30, 2006 7:03 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
ZEXEL Halfop

Joined: 27 Jun 2006 Posts: 45
|
Posted: Fri Dec 01, 2006 10:29 am Post subject: Hot! |
|
|
yo... thank you very much...  _________________ .:[ Knowledge Is The Power ]:. |
|
| Back to top |
|
 |
anarchopunk Voice
Joined: 27 Nov 2006 Posts: 5
|
Posted: Sun Dec 03, 2006 9:30 am Post subject: |
|
|
| 10x . |
|
| Back to top |
|
 |
|