Jump to content
chain

JinxBot

Recommended Posts

  • Administrators

'm a major newb to perl and mIRC scripting, and likely will be for a while as I'm mostly just blundering through things and learning as I go rather than actively studying how to work the language. So, I know there will be some inefficiencies with this snippet, and maybe even a bug or two (hopefully nothing too serious...I've used it for a while, never had troubles), so if you find anything and have a solution I'd love if you'd point them out to me.

Anyway, what this script is is just sort of a piece of fun for an IRC channel your bot is an op of. When active, the script will play out a classic piece of childhood whimsy and "jinx" anyone who says something directly after another person says the same thing. It sets channel mode to +m and removes voice from the second person, announcing to the channel that this person has been uncreative enough in his or her responses that they have been JINXED until someone says his or her name. It's simple, but my channel finds it to be a highly amusing fountain of guilt-free trolling, and since I've never seen a snippet that does anything similar I thought I'd share it with the world.

To activate JinxBot, type !jinx on (any user can do this, because it is just a fun script and even in my smartassed channel no one has been able to take advantage of it). To deactivate (again, anyone is eligible) type !jinx off, or really, any second word other than "on".

The main issues are that if someone has a long name or a nick that contains a status message, people will need to type the whole thing in order for them to be unjinxed, and, if you consider it an issue (it's easy to work around, but I left it in there for added fun), ops that obviously don't need +v are still given the JINX message. The main issue involving a limit to which variables in a message could unjinx a user has been fixed, however, with the help of a couple benevolent fellow Hawkee members. Huzzah!

At the top of the snippet is a couple lines that just ensure that everyone in your channel will have +v when JinxBot goes off. It may be more efficient to simply edit the script so that it voices everyone in the channel and devoices the unlucky victim, especially if you're an obsessive-compulsive owner who doesn't like +s all over your channel when mode is not +m, but I figured that I shouldn't add anything in there that I don't fully understand yet. May edit the snippet later when I do 😉 . If you don't need the auto-voice snippet, just crop it off, obviously.

Oh, and as you can see, I took the concession of ensuring it does not interfere with IRC Trivia, which by nature will have lots of repeated phrases and words. Jinxbot reactivates soon after Trivia ends.

Mess with the script, distribute it, do what you want with it. It's simple stuff, and although it'd be nice, I don't expect to be lauded or credited for writing it.

 

**AUTOVOICE**

ON *:JOIN:#:{
mode $chan +v $nick }

**TRIVIA COMPATIBILITY**

on *:TEXT:!trivia*:#:{
  if (%setting == on) {
    set %setting off
    msg $chan Breathe easy; JinxBot is now off.
    if (!$2) {
      set %timer 600
    }
    else {
      set %timer $2 * 60
    }
     msg $chan %timer until reactivation.
    .timer 1 %timer set %setting on
    .timer 1 %timer msg $chan Look out!  Jinxbot is now on!
  }
}

**JINXBOT SCRIPT**

on *:TEXT:!jinx*:#:{
  set %setting $2
  if (reset == %setting) {
    unset %one
    set %jinxed rtsl
    msg $chan JinxBot has been reset.
    set %setting on
  }
  if (on == %setting) {
    msg $chan Look out!  JinxBot is now on!
  }
  else {
    msg $chan Breathe easy; JinxBot is now off.
  }
}

on *:TEXT:*:#:{
  if (on == %setting) {
    if ($1- == %one) && ($nick != %nick) {
      msg $chan 4 $1-  - JINX!  $nick cannot speak until someone says his/her name!
      mode $chan +m
      mode $chan +v %jinxed
      mode $chan -v $nick 
      set %jinxed $nick
      set %one $1-
    }
    if ($istok($1-,%jinxed,32)) {
      mode $chan +v %jinxed
      msg $chan The jinx on %jinxed has been lifted!
      set %jinxed rtsl
      set %one $1-
    }
  }
  set %one $1-
  set %nick $nick
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...