ZirixZero, you code has a few things to be aware of:
Your !gift trigger will process if no $2 is specified as to whom the sender is.
The command /say cannnot be used in an event remotely. Use /msg $chan instead, or else you'll get an error saying "you're not on a channel."
Finally, this will make the best of your example:
on *:text:!gift*:#:/msg $chan Here's a gift from $iif($2,$2,$me) $+ . Enjoy :)
Though a trigger protection is also suggested so you can be best protected if one attempts to flood you.
When you offer a suggestion, make sure it's well thought out before submitting it.
ppl really think this is jus a pastebin >_>
Just because it's not the code we're used to, and/or expect from users doesn't mean they're using it as a pastebin. It's also rather bugging to see people use aliases for code that is better off with the main event but decide to complicate it by adding aliases.
$gettok($nick(#,$r(1,$nick(#,0))) Tree Cookie Coal,$r(1,4),32)
Perfectly acceptable alternative to a 7 line alias.
Bielie, looks like your have been font of using regex quit a bit as a mass production, so to speak. You should perhaps add a \b after the word gift. Your $2- willl not have control codes stripped. So if someone uses control codes in $2-, and your mirc does not have incoming message stripped, your example will have the control code shown in $2-. And that will look rather odd. :P
on $*:TEXT:/^[!.@]gift/Si:#:{
if ($2- == $null) { describe $chan Gives $nick a $read(gifts.txt) | return }
else { describe $chan Gives $2 a $read(gifts.txt) | return }
.ignore -u3 $nick
}
This is my shorter version of this script.
Type:
/write gifts.txt Balloon
or anything else to add things to santa's gift list. Add atleast one though.
Guitar, I think you should concentrate on your schoolwork...:P You were being absentminded. You have two regexes, in case you didn't notice. This is my take on your example:
on $*:text:/^[!.]gift$/Si:#:{
if !%f {
inc -u5 %f
.describe # Gives $nick a $replace($r(1,4),1,Tree,2,$nick(#,$r(1,$nick(#,0))),3,Cookie!,4,coal)
}
}
what is the point of this anyways?
ppl really think this is jus a pastebin >_>
lets try out my failed attempt
at making this any less lammme...
[cant test it im in school =[ ]
on $*:text:/^[!.]gift/Si:#:{
if $regex($1,/^[.!]gift$/Si) {
if !%f
inc -u5 %f
.describe # Gives $nick a $Gift
}
}
alias -l Gift {
var %x = $r(1,4)
if %x = 1 { return Tree | halt }
if %x = 2 { return $nick(#,$r(1,$nick(#,0))) | halt }
if %x = 3 { return Cookie! | halt }
if %x = 4 { return coal | halt }
}