This is a script made by me.
USE FOR A BOT
This took awhile, i've been studying and reading help sections, and finally remembered "variable".
$Rand was an idea by a friend, when i had tech difficulties.
So finally, i present you with THIS glorious script
Change the channels, Change # to your channel, or to $chan (means every chan)
change the text lines,
Anything!
You can find me at Purplesurge, Channel? #kirby
(yes i liek kirby)
~~Mtn64
;Made by mtn64, Fun to you!
on 1:TEXT:*!Rand*:$chan:{
Var %random = $rand(1,15)
msg $chan You have entered the Random actions or lines.
If (%random == 1.) .timer 1 2 msg $chan You have died with no funeral or apperance
If (%random == 2.) .timer 1 2 msg $chan You have fallen off a cliff
If (%random == 3.) .timer 1 2 msg $chan You were stabbed, injured, but lived.
If (%random == 4.) .timer 1 2 msg $chan $nick was bullied into giving Money to $me
If (%random == 5.) .timer 1 2 msg $chan If you have laid your hands on a knife before, you have died.
If (%random == 6.) .timer 1 2 msg $chan $nick was scared by clowns!
If (%random == 7.) .timer 1 2 msg $chan $nick has failed life... Please press play
If (%random == 8.) .timer 1 2 msg $chan $me has fallen off a cliff, and $nick has broke $me 's fall
If (%random == 9.) .timer 1 2 msg $chan $nick has been lynched
If (%random == 10.) .timer 1 2 msg $chan hold it spah! don't touch that sentry! $nick has killed $me
If (%random == 11.) .timer 1 2 msg $chan Kirby kirby kirby's the one!
If (%random == 12.) .timer 1 2 msg $chan $nick has saved $me from a car accident, but $nick died after.
If (%random == 13.) .timer 1 2 msg $chan $nick loves being purple!
If (%random == 14.) .timer 1 2 msg $chan When your with me baby the skies are all blue, for all my life!
If (%random == 15.) .timer 1 2 msg $chan i call this one, the camp fire song song.
This is non-regex version of using a one-line text trigger:
on *:TEXT:$($iif(!rand == $strip($1),$1)):#:{
this is not the same as blackvenom's example, since $1 returns the full line of text when used in the matchtext portion. i mentioned this before on the forums
Yes, I understand.
The example demonstrated above only works for a single command.
You won't want to tokenize 32 $strip($1) and then if ($1 == venom) { just for one trigger, will you? It makes sense if you have more than one trigger to initiate.
But then again, for one command, you can just enclose it with $strip() without tokenize 32 $strip()
@matcou
on *:TEXT:*:#:{
tokenize 32 $strip($1-)
if ($1 == !rand) {
yes it will check the if statement but for those who are not good at regex. and need it stripped but it is
not a good idea to have it in the text event such as !rand because it will trigger no matter where it is said seeing how it is wildcarded. the way i did it is a easy way to do it and it works perfectly as it is meant to not to mention it allows you to easily strip incoming text of color bold etcetc without setting it in your mirc options to strip all if you don't want it to strip all. there is nothing wrong with doing it that way. it also will allow you to easily combine several diff scripts that use the on text event for your bot so you don't have a lot of files so it can be condenced into one on text.
SReject didn't put a halt or return at the end of each goto statement. This will display multiple random messages once triggered.
If you decide not to put a halt or return, you must use an alias to call from it. And yes, as Matcou said, the first message should've gone on top of the goto command.
The error check is not necessary based on the code construction.
on $*:TEXT:/^[!.@]Rand/Si:#:{
var %t = $+(.timerRandMsg:,$chan) 1 2 msg $chan
msg $chan You have entered the Random actions or lines.
goto $rand(1,15)
:1 | %t You have died with no funeral or apperance | return
:2 | %t You have fallen off a cliff | return
:3 | %t You were stabbed, injured, but lived. | return
:4 | %t $nick was bullied into giving Money to $me | return
:5 | %t If you have laid your hands on a knife before, you have died. | return
:6 | %t $nick was scared by clowns! | return
:7 | %t $nick has failed life... Please press play | return
:8 | %t $me has fallen off a cliff, and $nick has broke $me 's fall | return
:9 | %t $nick has been lynched | return
:10 | %t hold it spah! don't touch that sentry! $nick has killed $me | return
:11 | %t Kirby kirby kirby's the one! | return
:12 | %t $nick has saved $me from a car accident, but $nick died after. | return
:13 | %t $nick loves being purple! | return
:14 | %t When your with me baby the skies are all blue, for all my life! | return
:15 | %t i call this one, the camp fire song song. | return
}
}
Sorry, I was preoccupied when I did the first version. it should be fixed now
keeping it at mostly how you have it
on *:TEXT:*:#:{
tokenize 32 $strip($1-)
if ($1 == !rand) {
Var %random = $rand(1,15)
msg $chan You have entered the Random actions or lines.
If (%random == 1) .timer 1 2 msg $chan You have died with no funeral or apperance
If (%random == 2) .timer 1 2 msg $chan You have fallen off a cliff
If (%random == 3) .timer 1 2 msg $chan You were stabbed, injured, but lived.
If (%random == 4) .timer 1 2 msg $chan $nick was bullied into giving Money to $me
If (%random == 5) .timer 1 2 msg $chan If you have laid your hands on a knife before, you have died.
If (%random == 6) .timer 1 2 msg $chan $nick was scared by clowns!
If (%random == 7) .timer 1 2 msg $chan $nick has failed life... Please press play
If (%random == 8) .timer 1 2 msg $chan $me has fallen off a cliff, and $nick has broke $me 's fall
If (%random == 9) .timer 1 2 msg $chan $nick has been lynched
If (%random == 10) .timer 1 2 msg $chan hold it spah! don't touch that sentry! $nick has killed $me
If (%random == 11) .timer 1 2 msg $chan Kirby kirby kirby's the one!
If (%random == 12) .timer 1 2 msg $chan $nick has saved $me from a car accident, but $nick died after.
If (%random == 13) .timer 1 2 msg $chan $nick loves being purple!
If (%random == 14) .timer 1 2 msg $chan When your with me baby the skies are all blue, for all my life!
If (%random == 15) .timer 1 2 msg $chan i call this one, the camp fire song song.
}
}
on *:text:$($iif(!rand == $strip($1),$1)):#:{
if (!%f) { inc -u5 %f
.msg # You have entered the Random actions or lines.
tokenize 124 You have died with no funeral or apperance|$&
You have fallen off a cliff|$&
You were stabbed, injured, but lived.|$&
$+ $nick was bullied into giving Money to $me $+ |$&
$(,if) you have laid your hands on a knife before, you have died.|$&
$+ $nick was scared by clowns!|$&
$+ $nick has failed life... Please press play|$&
$+ $me has fallen off a cliff, and $nick has broke $me 's fall|$&
$+ $nick has been lynched|$&
hold it spah! don't touch that sentry! $nick has killed $me $+ |$&
Kirby kirby kirby's the one!|$&
$+ $nick has saved $me from a car accident, but $nick died after.|$&
$+ $nick loves being purple!|$&
When your with me baby the skies are all blue, for all my life!|$&
i call this one, the camp fire song song.
.timerrand 1 2 .msg # $($+($,$rand(1,$0)),2)
}
}
Edit: just realized your case 15 will message #kirby. I believe you meant to put $chan
^^ hopefully i did the code thing right
Yes,thanks for pointing that out.
8ball thing, i know, I had no ideas what %variable and $rand was, so i decided to make one of these.
Next i shall be learning on how to point a random person out(hopefully it goes quick!) =D
you have on your on text event
on 1:TEXT:*!Rand*:$chan:{
few things wrong one you have it as a wildcard also you have $chan instead of #
maybe be do
on $*:TEXT:/^!Rand$/iS:#:{
then you hve the == numb. ie: 1.
you can fix that by taking out he . or by doing
Var %random = $+($r(1,15),.)
maybe add a flood pro to it as well
ie:
on $*:TEXT:/^!Rand$/iS:#:{
if (!%f) { inc -u5 %f
you should also name your timers as someone my have a timer just called timer an it can over write it.
but yes another 8-ball variant type snippet. =/
eh whatever.....3/10
I believe you are missing a closing bracket.
I also do not think the "%random == N." should have the period.
The way your on text is set up right now will trigger the script if "!rand" is anywhere in the message. If you want it to trigger on the message "!rand" only then remove the asterisks (they are wildcards)
You can optimize your code in many different ways, one being the use of text files (.txt) and the $read() function. Even if you do not use it for this specific snippet, it is good to know (/help $read).
Off topic: you mispelled appearance in your code.
Edit: just realized your case 15 will message #kirby. I believe you meant to put $chan