Phobia Add-On

By Anthrophobic on May 08, 2009

Anthrophobic and Alex{k}'s Phobia|Bot Script.

This snippet must not be ripped off or changed in ANY way.

This script uses the command !phobia to pull from a text file and define phobia's to users. There are many different ways to look up a phobia from the list. The image below will help explain that.

There is also a "myphobia" system, so that each user can set their fear to the nickname they are on. This will allow users to see their fear when joining the channel. Although, it does have a few bugs.

Get the text file here : http://www.hawkee.com/snippet/6120/

Image

;User Help Add-On
;Scriptor : Anthrophobic & Alex{K}
;Add On For Phobia|Bot
;Email : anthrophobic@conflictirc.net
;/server -m irc.conflictirc.net -j #HotPockets
;/server -m irc.torrentempire.com -j #Lobby

on 1:LOAD:{
  if (%phobia.load == $null) {
    echo -a Phobia script is now available, it has added popup menu's to help you set it up.
    set %phobia.load 1
  }
}
on 1:text:*:#:{
  if (%phobia.online == true) {
    if ($1 == !phobia) {
      if (%phobia.file == $null) { set %phobia.file definitions.txt }
      if (%phobia.words == $null) { set %phobia.words 14 }
      if (%phobia.brackets == $null) { set %phobia.brackets 4 }
      if (%phobia.match == $null) { set %phobia.match 7 }
      set %phobia.play * $+ $2- $+ *
      set %phobia $read(%phobia.file, w, %phobia.play)
      if (. isin %phobia) {
        set %phobia.desc $readn - 1
      }
      else {
        set %phobia.desc $readn + 1
      }

      if (!$read(%phobia.file, %phobia.desc)) {
        msg $chan %phobia.words $+ I can not find the definiton of $2-
      }
      else {

        if (!%phobia) {
          msg $chan %phobia.words Could not find the phobia you were looking for.
        }

        else {

          if ($len($2-) >= 5) {
            if ($2 ==  $remove(%phobia, ], [)) {
              msg $chan  %phobia.words The meaning of $+ %phobia.brackets $chr(91) $+ %phobia.match $+ $2- $+ %phobia.brackets $+ $chr(93) $+ %phobia.words is $+ %phobia.brackets $chr(91) $+ %phobia.match $+ $read(%phobia.file, %phobia.desc) $+ %phobia.brackets $+ $chr(93)
            }
            else {  
              msg $chan  %phobia.words Matched $+ %phobia.brackets $chr(91) $+ %phobia.match $+  $2- $+  %phobia.brackets $+ $chr(93) $+ %phobia.words with $+ %phobia.brackets $chr(91) $+ %phobia.match $+  $remove(%phobia, ], [) $+  %phobia.brackets $+ $chr(93) $+ %phobia.words which is $+ %phobia.brackets $chr(91) $+ %phobia.match $+ $remove($read(%phobia.file, %phobia.desc), [, ]) $+ %phobia.brackets $+ $chr(93)
            }
          }
          else {
            msg $chan %phobia.words Please use more then 5 characters when searching for a phobia.
          }
        }
      }
      if ($1 == !addphobia) {
        if (!$2) { msg $chan %phobia.words You need a title name like Zoophobia. }
        else {
          if ($2 == help) { msg $chan %phobia.words The !addphobia command is to add a phobia to the database, ie: !addphobia cheese the fear of cheese }
          else {
            if (!$3) { msg $chan %phobia.words You need a description like: Fear of animals. }
            else {
              set %new.phobia $2
              set %new.phobia.desc $3-
              set %phobia.play * $+ $2 $+ *
              set %phobia $read(%phobia.file, w, %phobia.play)
              if ($read(%phobia.file, w, %phobia.play) == $null) {
                write -i %phobia.file $chr(91) $+ $2 $+ $chr(93)
                write -i %phobia.file  $3-
                msg $chan %phobia.words Added %new.phobia to the database with description %new.phobia.desc
              }
              else {
                msg $chan %phobia.words That entry already exists and has been ignored.
              }
            }
          }
        }
      }
    }
  }
}
alias phobiacolors {
  set %phobia.words $1
  set %phobia.match $2
  set %phobia.brackets $3
}
alias phobia {
  if ($1 == on) { set %phobia.online true | echo -a %phobia.words Phobia Script %phobia.match v1 %phobia.words by %phobia.brackets Anthrophobic %phobia.words is now online. }
  if ($1 == off) { set %phobia.online false | echo -a %phobia.words Phobia Script %phobia.match v1 %phobia.words by %phobia.brackets Anthrophobic %phobia.words is now offline. }
  if ($1 == file) { set %phobia.file $2- | echo -a Phobia Definitions file set to $2- }
}
menu * {
  Phobia
  .Set Phobia Colors:phobiacolors $$?="Sentance color -Use Ctrl+K then the #, Blank sets default-:" $$?="Match color -Use Ctrl+K then the #- :" $$?="Bracket color -Use Ctrl+K then the #- :"
  .Turn on Phobia:phobia on
  .Turn off Phobia:phobia off
  .Set Definitions file:phobia file $$?="Please put in the full address to the definitions file(ie: C:/Program%20Files/mIRC/definitions.txt):"
}

Comments

Sign in to comment.
napa182   -  May 09, 2009

here is a quick socket you can edit it to do what you want or not this is just an example:

on $*:text:/@phobia\s(.+)/iS:#: { if (!$($+(%,phobflood,.,$nick),2)) { set -u3 $+(%,phobflood,.,$nick) on | if ($sock(phob)) .sockclose phob | set -u4 %phob.chan.look $chan $replace($regml(1),$chr(32),$chr(43)) | sockopen phob www.realfears.com 80 } }
on *:sockopen:phob: { sockwrite -nt $sockname GET $+(/search.php?p=,$gettok(%phob.chan.look,2,32)) HTTP/1.1 | sockwrite -nt $sockname Host: www.realfears.com | sockwrite -nt $sockname $crlf }
on *:sockread:phob: {
  var %phobs | sockread %phobs
  if ($regex(%phobs,/<p><b>(.+)<\/b> (.+)<\/p>/)) { msg $gettok(%phob.chan.look,1,32) $regml(1) $regml(2) }
}
 Respond  
Anthrophobic   -  May 08, 2009

Thanks Aucun and Napa, I will prob start trying to try more difficult scripts next.

 Respond  
Aucun50   -  May 08, 2009

This is nice but can go out of date fast i would do what napa said make a socket, if you don't know how there are many tutorials on the forums that might be handy.

 Respond  
Dodge   -  May 08, 2009

Nice. I've got postophobia and can't po

 Respond  
Anthrophobic   -  May 08, 2009

I do not know how to create a socket. o.0

 Respond  
napa182   -  May 08, 2009

nice snippet, but why not just socket to a Phobia search site rather then making a huge txt file?

 Respond  
Kirbeh_Pr0nz   -  May 08, 2009

I love it, works great :D
and i get a laugh out of it :P

 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.