Then how did you manage to run the script? Did you source it directly from the forum?Kaarel wrote:I dont use text editor
user wrote:Then how did you manage to run the script? Did you source it directly from the forum?Kaarel wrote:I dont use text editor
Code: Select all
set my(chan) ""
bind pub - !spin my:spin
proc my:spin {nick uhost handle channel text} {
global botnick my
set chan [string tolower $channel]
putserv "MSG $chan :$nick spins the wheel ... Round and round it goes ... Where it will point nobody knows ..."
putserv "MSG $chan :Tick Tick ... Tick Tick ... Who will the wheel pick?"
switch -- [expr [rand 7] + 1] {
"1" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
} else {
putserv "PRIVMSG $chan :The wheel spins until the last Tick, and with that"
putserv "KICK $chan $nick :You get a free kick!"
}
}
"2" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
} else {
putserv "PRIVMSG $chan :The wheel will land on the one that gets a ban"
putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
}
}
"3" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
} else {
putserv "PRIVMSG $chan :You have a little time on your hands"
set mask "*!*@[lindex [split $uhost @] 1]"
newchanban $chan $mask $::botnick "Because you just recieved a 10 minute ban!" 10
}
}
"4" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
} else {
putserv "PRIVMSG $chan :You are on your way to the top, because you were just made a OP"
putserv "MODE $chan +o $nick"
}
}
"5" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
} else {
putserv "PRIVMSG $chan :I hope you were not on top, because you just lost your OPs"
putserv "MODE $chan -o $nick"
}
}
"6" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
} else {
putserv "PRIVMSG $chan :It is what you fear - you just lost your voice in here"
putserv "MODE $chan -v $nick"
}
}
"7" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
} else {
putserv "PRIVMSG $chan :If it's hard to know what you type, you are in luck, a -v bites"
putserv "MODE $chan +v $nick"
}
}
}
}
Even though notepad is the worst text editor ever it has several encodings to choose from iirc. Did you by any chance save it as something else than ANSI/pure text/whatever they call it?Kaarel wrote:I copy+paste that into notepad, save it, restarted the bot, but till
<Botman> [19:37] Tcl error [my:spin]: invalid command name "? "
Code: Select all
putserv "MSG $chan :$nick spins the wheel ... Round and round it goes ... Where it will point nobody knows ..."
putserv "MSG $chan :Tick Tick ... Tick Tick ... Who will the wheel pick?"
Code: Select all
putserv "PRIVMSG $chan :$nick spins the wheel ... Round and round it goes ... Where it will point nobody knows ..."
putserv "PRIVMSG $chan :Tick Tick ... Tick Tick ... Who will the wheel pick?"
Code: Select all
proc my:spin {nick uhost handle channel text} {
Code: Select all
proc my:spin {nick uhost handle chan text} {
Code: Select all
######################################################################
# SPIN #
# spin.v1.3.tcl #
######################################################################
# #
# - OP commands - !s on will enable spin #
# !s off will disable spin #
# #
# - commands - !spin spins wheel #
# #
# Channel you want to run the !Spin game on. 1 room ONLY
# ex. set spin_chan "#egg_game_players"
set spin_chan ""
# Set the minimum number of seconds between spins
# ex. set s_protect_seconds 7
set s_protect_seconds 7
######################################################################
# There Are No User Settings Below this Point #
# #
# Don't edit anything below unless you know what you are doing #
######################################################################
set spin_chan [string tolower $spin_chan]
set s_master_mode 1
set smode 1
set sgmode 1
set $sbbreason "Because you just recieved a 10 minute ban!"
######################################################################
# Main Script #
######################################################################
bind pub - !spin my:spin
proc my:spin {nick uhost handle channel text} {
global botnick spin_chan s_master_mode smode sgmode s_protect_seconds sbbreason
if {[$s_master_mode == "0"]} {return 0}
set chan [string tolower $channel]
if {![$chan == $spin_chan]} {return 0}
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not OPed here so I can not Spin"
return 0
}
if {[$smode == "0"]} {return 0}
set smode "0"
utimer $s_protect_seconds spin:floodpro
putserv "PRIVMSG $chan :$nick spins the wheel ... Round and round it goes ... Where it will point nobody knows ..."
putserv "PRIVMSG $chan :Tick Tick ... Tick Tick ... What will the wheel pick?"
switch -- [expr [rand 6] + 1] {
"1" {
putserv "PRIVMSG $chan :The wheel spins until the last Tick, and with that"
putserv "KICK $chan $nick :You get a free kick!"
}
"2" {
putserv "PRIVMSG $chan :The wheel will land on the one that gets a ban"
putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
}
"3" {
putserv "PRIVMSG $chan :You have a little time on your hands"
set mask "*!*@[lindex [split $uhost @] 1]"
newchanban $chan $mask $::botnick $sbbreason 10
}
"4" {
putserv "PRIVMSG $chan :You are on your way to the top, because you were just made a OP"
putserv "MODE $chan +o $nick"
}
"5" {
putserv "PRIVMSG $chan :I hope you were not on top, because you just lost your OPs"
putserv "MODE $chan -o $nick"
}
"6" {
putserv "PRIVMSG $chan :If it's hard for us to know what you typed, it is what you fear - you just lost your voice in here"
putserv "MODE $chan -v $nick"
}
}
}
proc spin:floodpro {} {
global smode
set smode "1"
}
######################################################################
# Master shut-off Switch #
######################################################################
# Master shut-off switch, available to ANY OP in Channel
bind pub -|- "!s on" enable:spin
bind pub -|- "!s off" disable:spin
proc enable:spin {nick uhost handle channel} {
global spin_chan s_master_mode
if {![string tolower $channel == $spin_chan]} {return 0}
if {[isop $nick $spin_chan]} {
set s_master_mode "1"
puthelp "PRIVMSG $spin_chan :The Spin game has been unlocked, Type: !spin to play"
}
return 0
}
proc disable:spin {nick uhost handle channel} {
global spin_chan s_master_mode
if {![string tolower $channel == $spin_chan]} {return 0}
if {[isop $nick $spin_chan]} {
set s_master_mode "0"
puthelp "PRIVMSG $spin_chan :The Spin game has been locked in OFF mode"
}
return 0
}
######################################################################
############################### EOF ##################################
Code: Select all
set spin_chan "#"
set s_protect_seconds 7
set spin_chan [string tolower $spin_chan]
set s_master_mode 1
set smode 1
set sgmode 1
bind pub - !spin pub:spin
proc pub:spin {nick uhost handle channel text} {
global botnick spin_chan s_master_mode smode sgmode s_protect_seconds
if {$s_master_mode == 0} {return 0}
set chan [string tolower $channel]
if {$chan != $spin_chan} {return 0}
if {[botisop $chan]== 0} {
putserv "PRIVMSG $chan :I'm not OPed here so I can not Spin"
return 0
}
if {$smode == "0"} {return 0}
set smode "0"
utimer $s_protect_seconds spin:floodpro
putserv "PRIVMSG $chan :$nick takes a chance...good luck"
switch -- [expr [rand 6] + 1] {
"1" {
putserv "PRIVMSG $chan :you are a winner"
}
"2" {
putserv "PRIVMSG $chan :now thats has to hurt"
putserv "KICK $chan $nick :now did that hurt?"
}
"3" {
putserv "PRIVMSG $chan :you are a winner"
}
"4" {
putserv "PRIVMSG $chan :did you hear something?, because i dident :-)"
putserv "KICK $chan $nick :will you ever learn?"
}
"5" {
putserv "PRIVMSG $chan :you are the weakest link good bye"
putserv "KICK $chan $nick :lol you fell for that old trick"
}
"6" {
putserv "PRIVMSG $chan :Wow a winner have another go :-)"
}
}
}
proc spin:floodpro {} {
global smode
set smode "1"
}
# Master shut-off switch, available to ANY OP in Channel
bind pub -|- !spin_on enable:spin
bind pub -|- !spin_off disable:spin
proc enable:spin {nick uhost handle channel text} {
global spin_chan s_master_mode
if {([string tolower $channel] == $spin_chan) && ([isop $nick $spin_chan] == 1)} {
set s_master_mode 1
puthelp "PRIVMSG $spin_chan :The Spin game has been unlocked, Type: !spin to play"
}
return 0
}
proc disable:spin {nick uhost handle channel text} {
global spin_chan s_master_mode
if {[string tolower $channel] != $spin_chan} {return 0}
if {[isop $nick $spin_chan]} {
set s_master_mode "0"
puthelp "PRIVMSG $spin_chan :The Spin game has been locked in OFF mode"
}
return 0
}