Thank you Script

By Oddball on Jan 22, 2010

This is just a simple script that allows users to thank op's and other users who help them out in a channel or what not. It doesn't have any importance or anything like that just helps the channel owner keep track of who is helping out. I know some things could be added to help it out but this was a quick and easy write. All you have to do is load into your remotes. I also came across the idea of how to write this script when I seen DaDealer's point script: http://www.hawkee.com/snippet/5241/ that is a very useful script. Thanks DaDealer.

on *:text:!thankyou*:#: {
  if ($2 == $nick) {
    msg $chan Pat yourself on the back, but I am not adding a thanks to your record.
    halt
  }
  else {
    set %a $address($2,2)
    set %c $chan
    inc %thanks. [ $+ [ %a ] ] [ $+ [ %c ] ]
    notice $2 you currently have %thanks. [ $+ [ %a ] ] [ $+ [ %c ] ]
  }
  msg $chan A thank you has been added to $2 's record.
}
on *:text:!checkthanks:#: {
  set %d $address($nick,2)
  set %c3 $chan
  notice $nick you currently have %thanks. [ $+ [ %d ] ] [ $+ [ %c3 ] ]
  unset -s %d
}

on *:text:!checkthanks*:#:{
  set %d3 $address($2,2)
  notice $nick $2- currently has %thanks. [ $+ [ %d3 ] ] [ $+ [ %c3 ] ]
  unset -s %d3
}

Comments

Sign in to comment.
FordLawnmower   -  May 05, 2010

@Oddball You forgot to unset %a,%c and %c3.
For temporary variables like this, it is much better to use /var than /set.
This way you don't have to unset them.
You also didn't set a channel variable in the last On Text event so it just uses %c3 from the last match to the second On Text event. You should really combine those two events.

 Respond  
Oddball   -  May 05, 2010

Thank you for the corrections though.

 Respond  
Oddball   -  May 05, 2010

As I stated, this script does not have much of a meaning, did not need to be perfect just something I needed and thought I would share. It is odd... take a look at the creator. :-)

 Respond  
Souljaa   -  Feb 10, 2010

Jethro_, ya pretty much wrapped this one up. :P

 Respond  
Jethro   -  Jan 22, 2010

After digesting some more with my brain juice, I think I sorta got what this script's intention is...That "oddity" still got the best of me...

 Respond  
Jethro   -  Jan 22, 2010

But don't you think that is rather odd. Let's say I place this script into a bot called Ghost-writer, and then I have to enter: !thankyou Jethro_ for Ghost-writer to thank me for it? Should it make more sense if I thank Ghost-writer instead of me? Or what about:

on *:text:!thankyou*:#: {
  if ($2 == $nick) { msg # $1 $2 }
  elseif ($2 == $me) { msg # $1 $2 }
}

Now you can either thank both of us. But it's still odd, thanks to you, Oddball...

 Respond  
Ghost-writer   -  Jan 22, 2010

jehtro, its so you cant give it to yourself, and it notices the person you give a thank you to. I was confused with that at first also.

 Respond  
Jethro   -  Jan 22, 2010

The only thing is, if you use hash tables, you have to hsave and hload 'em, or everything the script counts is going to be lost.

Did I miss out on something? Why $2 == $nick?

 Respond  
Ghost-writer   -  Jan 22, 2010

Hash table could be used, would be much cleaner than these variables. But after making this i think a $readini could be used more efficiently :P.

on $*:TEXT:/^[.!@]ThankYou/Si:#: {
  if ($2 == $nick) { msg $chan Pat yourself on the back $nick $+ , but i am not adding a thanks to your record. }
  else {
    hinc -m Thanks $+ $chan $address($2,2)
    notice $2 Your thanks has been increased by $nick $+ . You now has $hget(Thanks $+ $chan,$address($2,2))
    msg $chan A thank you has been added to $2 $+ 's record.
  }
}
on $*:TEXT:/^[.!@]CheckThank/Si:#: {
  if (!$timer(floodthank $+ $nick)) {
    .timerfloodthank $+ $nick 1 6 noop
    notice $nick You currently have $hget(Thanks $+ $chan,$iif($2,$v1,$nick))
  }
}
 Respond  
Jethro   -  Jan 22, 2010

yeah I agree.

 Respond  
knoeki   -  Jan 22, 2010

I'd also suggest using .ini files to store this rather than variables.

 Respond  
Meta   -  Jan 22, 2010

Actually, GrimReaper, $+ isn't needed for that, because you can attach characters to the end of $N identifiers (eg. $1... $2, $3abcdefg) (this excludes hyphens unless you do something like "$1-1-" or "$1--")

It doesn't work like that for any other identifier though. (that I know of...)

Edit... Didn't realize there was a space between those until just now...

Oddball, in this line: "msg $chan A thank you has been added to $2 's record."

You should be able to attach the 's to the $2 to make it $2's, and it should work.

 Respond  
Jethro   -  Jan 22, 2010

I think you mistook $2 == $me for $nick. Your current code will result in someone says his or her own nick for the running client to be able to say thanks to themselves instead of the "op." You should also make your text match for some other possibilities of sending their thankfulness by using regex:> on $*:TEXT:/!(thanx|thx|thanks?( |you|u))/iS:#: {
if ($2 == $me) {
.msg $chan Pat yourself on the back, but I am not adding a thanks to your record.
}The halt is not needed, and your other two text events can be combined into one.

 Respond  
GrimReaper   -  Jan 22, 2010

where you have

msg $chan A thank you has been added to $2 's record.

you should make it

msg $chan A thank you has been added to $2 $+ 's record.

That will bring $2 and 's together to form 's

 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.