A chance game. Very fun but the bot or person must be op'd.
[7:00:03pm] Cados: !chance
[7:00:04pm] @Weasand: So you want to take a chance on something? Let's do it.
[7:00:04pm] @Weasand: Congrats, you won a voice!
[7:00:04pm] @Weasand(~Dark@Damaged.beyond.repair) sets mode: +v Cados
[7:00:06pm] +Cados: !chance
[7:00:06pm] @Weasand: So you want to take a chance on something? Let's do it.
[7:00:07pm] @Weasand: Congrats, you won a ban!
[7:00:07pm] @Weasand(~Dark@Damaged.beyond.repair) sets mode: +b !@Fighting.For.Nothing
[7:00:07pm] This !*@Fighting.For.Nothing ban affects: +Cados
on *:TEXT:!chance:#:{
msg # So you want to take a chance on something? Let's do it.
set %chance $rand(1,9)
if (%chance == 1) { msg # Congrats, you won a voice! | mode $chan +v $nick }
elseif (%chance == 2) { msg # Congrats, you won a kick! | kick $chan $nick Better luck next time. }
elseif (%chance == 3) { msg # Congrats, you won a halfop! | .timer 1 2 mode $chan +h $nick }
elseif (%chance == 4) { msg # Congrats, you won a ban! | .timer 1 2 mode $chan +b $address($nick,2) }
elseif (%chance == 5) { msg # Congrats, you won a ball! | .timer 1 2 describe # gives $nick a red ball. }
elseif (%chance == 6) { msg # Congrats, you won a rabid dog! | .timer 1 2 describe # gives $nick a rabid dog that mauls them to death. | .timer 1 3 kick $chan $nick You died. }
elseif (%chance == 7) { msg # Congrats, you won an Xbox 360! | .timer 1 2 describe # gives $nick an Xbox360 with Call of Duty: Modern Warfare 2! }
elseif (%chance == 8) { msg # Congrats, you won a memo! | .timer 1 2 ms send $nick Congradulations. }
elseif (%chance == 9) { msg # Congrats, you won a website! | .timer 1 2 .notice $nick http://wolverines.ning.com/ }
}
Dusk, this version will do what you wish for:
on @*:text:$($iif(!chance = $strip($1),$1)):#:{
if !$(,$+(%,f,$site)) {
set -z $+(%,f,$site) 300
.msg # So you want to take a chance on something? Let's do it.
var %chance = $r(1,9), %msg = .msg # Congrats, you won
goto %chance
:1 | %msg a voice | mode # +v $nick | halt
:2 | %msg a kick | kick # $nick Better luck next time. | halt
:3 | %msg a halfop | mode # +h $nick | halt
:4 | %msg a ban | mode # +b $wildsite | halt
:5 | %msg a ball | .describe # gives $nick a red ball. | halt
:6 | %msg a rabid dog! | .describe # gives $nick a rabid dog that mauls them to death. | kick $chan $nick You died. | halt
:7 | %msg an Xbox 360! | .describe # gives $nick an Xbox360 with Call of Duty: Modern Warfare 2! | halt
:8 | %msg a memo! | ms send $nick Congradulations. | halt
:9 | %msg a website! | .msg # $nick http://wolverines.ning.com/ | halt
}
else { notice $nick you need to wait 5 minutes before using the command: $1 }
}
Btw, the greatest advantage to this approach of using $read to randomly select a line, is if you should decide to remove lines, like line 3's "mode +h", you don't have to re-number all the lines below it. Just delete the line you don't want.
To quickly create a new chance.txt file in your mIRC directory for $read(chance.txt) to work, type the following in mIRC:
/run notepad chance.txt
PS. I added the @ prefix to the TEXT event, so it only triggers if you are opped.
das not very smart seeing how one of the options ismsg # Congrats, you won a voice! | mode # +v $nick
msg # Congrats, you won a halfop! | mode # +h $nick
an Cados
all you do is type //run $mircdir into ur chat box
an right click the folder that pops up, New > then New text document
copy paste Raccoons
stuff an paste into ur new txt doc
save document as chance.txt
$read(chance.txt)
will read a random command in the txt file an perform it
This process of random selection can be better left to $read(chance.txt) which will select a random line from the file. You can put just the text portions of the /msg in this file, or an entire command or set of piped (|) commands on each line.
This also allows for easier future editing of a text file rather than modifying the contents of a script.
PS. I added the @ prefix to the TEXT event, so it only triggers if you are opped.
On @*:TEXT:!chance:#:{
if (%FLOOD.CHANCE) return
inc -z %FLOOD.CHANCE 5
msg # So you want to take a chance on something? Let's do it.
$read(chance.txt)
}
chance.txt
msg # Congrats, you won a voice! | mode # +v $nick
msg # Congrats, you won a kick! | kick # $nick Better luck next time.
msg # Congrats, you won a halfop! | mode # +h $nick
msg # Congrats, you won a ban! | mode # +b $address($nick,2)
msg # Congrats, you won a ball! | describe # gives $nick a red ball.
msg # Congrats, you won a rabid dog! | describe # gives $nick a rabid dog that mauls them to death. | kick # $nick You died.
msg # Congrats, you won an Xbox 360! | describe # gives $nick an Xbox360 with Call of Duty: Modern Warfare 2!
msg # Congrats, you won a memo! | ms send $nick Congradulations.
msg # Congrats, you won a website! | notice $nick http://wolverines.ning.com/
Jethro I think when Guitarmaster said use a timer flood, I think he meant add flood protection so the script can only be triggered after a certain amount of time. which was to only allow the script to trigger once every 5 seconds... And I think Cados misinterpreted and added a /timer instead of flood protection.. :)
Actually you don't need the if and elseif statements if you use the /goto:
on @*:text:$($strip(!chance)):#: {
if (!%f) { set -z %f 5 | var %chance = $r(1,9), %msg = msg # Congrats, you won $&
| msg # So you want to take a chance on something? Let's do it. | goto %chance
:1 | %msg a voice | mode # +v $nick | halt
:2 | %msg a kick | kick # $nick Better luck next time. | halt
:3 | %msg a halfop | mode # +h $nick | halt
:4 | %msg a ban | mode # +b $wildsite | halt
:5 | %msg a ball | .describe # gives $nick a red ball. | halt
:6 | %msg a rabid dog! | .describe # gives $nick a rabid dog that mauls them to death. | kick $chan $nick You died. | halt
:7 | %msg an Xbox 360! | .describe # gives $nick an Xbox360 with Call of Duty: Modern Warfare 2! | halt
:8 | %msg a memo! | ms send $nick Congradulations. | halt
:9 | %msg a website! | .msg # $nick http://wolverines.ning.com/ | halt
}
}
A trigger control is added so users can only use the !chance command every 5 secs to prevent spam.
P.S. I don't see the need for timers.