gift command

By macs-rock on Dec 01, 2010

!gift DG DG heres a gift from macs , Enjoy :) ```mirc on 1:TEXT:*!gift*:#:{ msg $chan $2 heres a gift from $nick $+ , Enjoy :) } also for a control channel on 1:TEXT:*!gift*:#:{ msg $chan $2 heres a gift from $nick $+ , Enjoy :) msg #your-control-channel-name !gift command used by $nick on $chan gift was to $2 } ```

Comments

Sign in to comment.
macs-rock   -  Dec 28, 2010

apple person you ok?

 Respond  
ZirixZero   -  Dec 20, 2010

:(

 Respond  
Jethro   -  Dec 19, 2010

ZirixZero, you code has a few things to be aware of:

  1. Your !gift trigger will process if no $2 is specified as to whom the sender is.

  2. 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."

  3. You didn't use $+ . to separate $nick and the period. You'll get an error saying there is no such "$nick." identifier.

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.

 Respond  
ZirixZero   -  Dec 19, 2010

For a simpler script,

on *:text:!gift*:#:/say $2 here's a gift from $nick. Enjoy :)
 Respond  
macs-rock   -  Dec 11, 2010

yeh darkgamer it was you =D

 Respond  
macs-rock   -  Dec 11, 2010

ty guys

 Respond  
Jethro   -  Dec 09, 2010
alias -l Gift {
  goto $r(1,4)
  :1 | return Tree | halt
  :2 | return $nick(#,$r(1,$nick(#,0))) | halt
  :3 | return Cookie! | halt
  :4 | return coal | halt
}

it's even smaller than having the if checks.

 Respond  
GuitarMasterx7   -  Dec 09, 2010

oh yea ur right =[ lolz

 Respond  
Jethro   -  Dec 09, 2010

Alias is good, but your example didn't require one...:P In fact, having an alias like that is as going the extra mile for nothing. In addition, the halt in each if condition was not necessary, unless you used the goto command.

 Respond  
GuitarMasterx7   -  Dec 09, 2010

i like my alias D:!

 Respond  
Jethro   -  Dec 09, 2010

You might want to exclude the client that runs the code from being randomized:

:resume 
$iif($nick(#,$r(1,$nick(#,0))) = $me,goto resume,$&
describe # gives $nick a $gettok($v1 Tree Cookie Coal,$r(1,4),32))
 Respond  
Sorasyn   -  Dec 08, 2010

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.

 Respond  
DarkGamer120   -  Dec 04, 2010

:P its me that he give me the gift, i am DG :P

 Respond  
Jethro   -  Dec 03, 2010

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

 Respond  
GuitarMasterx7   -  Dec 03, 2010

lolz whoops D:
i have two comp classes
Digital Design, and Web Design
they get kinda boring after you finish your work so i jus check Hawkee forums lolz

 Respond  
Bielie   -  Dec 03, 2010
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.

 Respond  
Bielie   -  Dec 03, 2010

unset the var aswell o_O

 Respond  
Jethro   -  Dec 02, 2010

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)
  }
}
 Respond  
GuitarMasterx7   -  Dec 02, 2010

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 }
}
 Respond  
H3xable   -  Dec 01, 2010

what is the point of this anyways?

 Respond  
Dark|   -  Dec 01, 2010

You could make this isnt a real gift. snippet
like have gift.txt and they can put stuff in the file and itll pick a random one

 Respond  
napa182   -  Dec 01, 2010

well the crappy thing about wildcard is it can trigger in mid sentence ie: hey the trigger is !gift name here ok
also it would be a good thing to check if $2 is said and if $2 is a nick in the channel.

 Respond  
blackvenomm666   -  Dec 01, 2010

he's using the wildcard to strip it which he shouldnt

 Respond  
napa182   -  Dec 01, 2010

o.0 lolwut

maybe add color striping an flood protections to it

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.