Question Part: It's not a great script, but it's my first time using regex I guess. Basically just type something with a question mark in it and it says a message!
! Part: Say something with a ! in it and it will say a message!
on $*:TEXT:/.*\?/:#: { msg $chan Have you tried www.google.com yet? }
on $*:TEXT:/.*\!/:#: { msg $chan Don't get too excited! }
Spammer!!! /me kicks Bielie silly like a spam smered between two slices of bread.
Biellie, you can combine those two text events into this:
on $*:text:/(\B[!?]\B|[!.]add)/iS:#:{
if (!%spam) { inc -u4 %spam
if ($istok(!add|.add,$regml(1),124)) && (!$2) {
notice $nick Please provide a line to add!
}
elseif ($istok(! ?,$regml(1),32)) {
notice $nick $iif($isfile(text.txt),$read(text.txt),text.txt is not found!)
}
else {
notice $nick Added $+(",$2-,") to the list.
write text.txt $2-
}
}
}
Might want to add a check to see if the text.txt exists or not...along with a trigger control so you don't get spammed upon spamming. lol
In the end its just some annoying spam script.... :) But i will make this script advanced for you ;)
U should use $read(text.txt) and give it more options to say.
This is how to do it quikly as possible:
Step 1: /write text.txt
Step 2: /run text.txt
Step 3: Write down lines you want to say on the trigger.
Step 4: Save the file with: File -> Save
Now you change your script. (I also added a !add option to add lines without opening the file.)
Change it like this: (Used the first part of Jethro_)
on $*:text:/([!?])/S:#:{
;;Change this line in to the floodcontrol bellow;;
notice $nick $read(text.txt)
return
}
}
on $*:text:/^[!.]add/S:#:{
if ($nick != $me) { notice $nick You have no rights to use this command.
return
}
elseif ($2- == $null) { notice $nick Please provide a line to add.
return
}
else { notice $nick Added " $+ $2- $+ " to the list.
write text.txt $2-
halt
}
}
You might wanna add a floodcontrol.
Can be done like this: (COPY IT IN THE CODE ABOVE)
It puts a 3 second delay for the channel the trigger was asked in.
if (%flood [ $+ [ $chan ] ]) { return }
set -eu3 %flood [ $+ [ $chan ] ] $true
Wrote it like this so "GoldFish" can understand it hopefully...