Code: Select all
bind pub - !spin my:spin
proc my:spin {nick host handle channel text} {
switch -- [rand 6] {
"1" {
# your stuff here
}
"2" {
# your stuff here
}
"3" {
# your stuff here
}
"4" {
# your stuff here
}
"5" {
# your stuff here
}
"6" {
# your stuff here
}
}
}
Code: Select all
set numbers "1 2 3 4 5 6"
switch -- [lindex $numbers [rand [llength $numbers]]] {
Heh.. I think he meant more along the lines of changing your "1" { .. "2" ..caesar wrote:Oups, yes, you are right. Umm..
Instead of [rand 6] should be:
This should do fine.. My appologies for my previous mistake.Code: Select all
set numbers "1 2 3 4 5 6" switch -- [lindex $numbers [rand [llength $numbers]]] {
Code: Select all
switch -- [expr [rand 6] + 1] {
Kaarel wrote:Ok, but I need more help, I like to when somebody spins the bot says something like this
$nick spins the wheel
Where it will point nobody knows ....
Round and round it goes .....
Tick Tick Tick .....
Tick Tick .....
Tick .....
$nick gets free kick
Code: Select all
putserv "PRIVMSG <target> :<message>"
Code: Select all
bind pub - !spin my:spin
proc my:spin {nick host handle channel text} {
set numbers "1 2 3 4 5 6"
switch -- [lindex $numbers [rand [llength $numbers]]] {
"1" {
putserv "MSG $chan :$nick spins the wheel "
putserv "MSG $chan :Where it will point nobody knows .... "
putserv "MSG $chan :Round and round it goes ..... "
putserv "MSG $chan :Tick Tick Tick ..... "
putserv "MSG $chan :Tick Tick ..... "
putserv "MSG $chan :Tick "
putserv "MSG $chan : And $nick gets a free kick out of here "
}
"2" {
# your stuff here
}
"3" {
# your stuff here
}
"4" {
# your stuff here
}
"5" {
# your stuff here
}
"6" {
# your stuff here
}
}
}
I suggest moving the standard messages out of the switch statement since those messages will be sent no matter (I guess).Kaarel wrote:is that right for start
...
And how and where I put the code that kick the person
user wrote:I suggest moving the standard messages out of the switch statement since those messages will be sent no matter (I guess).Kaarel wrote:is that right for start
...
And how and where I put the code that kick the person
Put the kick below the message in the execution body of the switch (where your messages are right now)
Kaarel wrote:Can you edit my code, I can`t underestand you right
Code: Select all
proc my:spin {nick host handle channel text} {
putserv "MSG $chan :$nick spins the wheel"
putserv "MSG $chan :Where it will point nobody knows ...."
putserv "MSG $chan :Round and round it goes ....."
putserv "MSG $chan :Tick Tick Tick ....."
putserv "MSG $chan :Tick Tick ....."
putserv "MSG $chan :Tick "
switch [rand 2] {
"0" {
putserv "MSG $chan :And $nick gets a free kick out of here"
putserv "KICK $chan $nick :Congratulations!"
}
"1" {
putserv "MSG $chan :And $nick gets a free message (this one)"
}
# etc
}
}
Code: Select all
bind pub - !spin my:spin
proc my:spin {nick host handle channel text} {
putserv "PRIVMSG $chan :$nick spins the wheel "
putserv "PRIVMSG $chan :Where it will point nobody knows .... "
putserv "PRIVMSG $chan :Round and round it goes ..... "
putserv "PRIVMSG $chan :Tick Tick Tick ..... "
putserv "PRIVMSG $chan :Tick Tick ..... "
putserv "PRIVMSG $chan :Tick "
switch -- [expr [rand 6] + 1] {
"1" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
}
putserv "PRIVMSG $chan :And $nick gets a free kick out of here "
putserv "KICK $chan $nick :Your free kick!"
}
"2" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
}
putserv "MODE $chan +b *!*@[lindex [split $host @] 1]"
}
"3" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
}
set mask "*!*@[lindex [split $host @] 1]"
newchanban $chan $mask $::botnick "Here is your prise.. 10 mintes ban!" 10
}
"4" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
}
if {![isop $nick $chan]} {
putserv "PRIVMSG $chan :And $nick gets op in here.."
}
}
"5" {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not oped here so I can't give you your prise.."
}
if {[isop $nick $chan]} {
putserv "PRIVMSG $chan :One deop comming up!"
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.."
}
if {[isvoice $nick $chan]} {
putserv "PRIVMSG $chan :One deop comming up!"
putserv "MODE $chan -v $nick"
}
}
}
}