JokeBot - By Assasin™ Very simple and Easy

By Assasin@lucidchat on Jun 14, 2012

It is a very simple joke bot that narrates jokes for you. Only problem is, this is not a socket and so cannot get a random joke online.. But still, its okay, you can add your own jokes to it. commands !newjoke - newjoke
!joke - narrate a random joke. !joke narrate a specific joke. !randomjoke - no need to ask...
!jokes to find total number of jokes... !jokeinfo to find out by who the joke was written and blabkabla
!findjoke to search for a joke with a specific word

You can ask me if you want to give it to anyone else....
You can also contact me at irc.lucidchat.net @ #Pokemon_Vortex, #Dragonball, #door-thirteen

on *:connect: {
  if ($network == *@lucidchat*) {
    window -k0 @commands
  }
}

on *:text:*:#: {

  ;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  ;    JokeBot        Made by Assasin -_
  ;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
;Adds a new joke:
  if (!newjoke == $1) {
    -p @commands ( $+ $time $+ ) $nick used $1 ( $+ $1- $+ )
    if ($2 != $null) {
      if ($numtok($2-,32) < 3) {
        msg $chan $nick $+ : Your joke has to be more than 3 words, otherwise its not a joke.
      }
      else {
        var %topic = $ini(jokes.ini,0) + 1
        writeini jokes.ini %topic joke $2-
        writeini jokes.ini %topic author $nick
        writeini jokes.ini %topic date $date
        writeini jokes.ini %topic time $time
        msg $chan Added new joke by $nick : $2-
      }
    }
    else {
      msg $chan $nick $+ : It's not funny joke if you dont input any text you know 3,4(:
    }
  }
  elseif (!fdeletejoke == $1) {
    -p @commands ( $+ $time $+ ) 4 $+ $nick used $1 ( $+ $1- $+ )
    if ($2 != $null) {
      if ($2 isnum) {
        if ($readini(jokes.ini, $2, author) != $null) {
          if ($nick >= 5) {
            writeini jokes.ini $2 joke $2 has been pushed down the window 
            msg $chan Joke $2 has been pushed down the window by $nick
          }
          else {
            msg $chan $nick $+ : You do not meet the required hostmask to use this command
          }
        }
        else {
          msg $chan $nick $+ : No such joke to delete bro 12,9(=
        }
      }
      else {
      msg $chan $nick $+ : Specify a number, ya fool!      }
    }
  }
;delete a joke:  
elseif (!deljoke == $1) {
    @commands ( $+ $time $+ ) $nick used $1 ( $+ $1- $+ )
    if ($2 != $null) {
      if ($2 isnum) {
        if ($readini(jokes.ini, $2, author) == $nick) {
          writeini jokes.ini $2 joke Sorry, joke no. $2 has been deleted by $nick because he/she didnt like it.
          msg $chan Sorry, Joke no. $2 has been deleted by $nick because he/she didnt like it.

        }
        else {
          msg $chan $nick $+ : You didnt submit that joke - Type !jokeinfo $2 to see who thought of it
        }
      }
      else {
        msg $chan $nick $+ : Didnt you read the instructions? Looks like your spectacles are dirty -- e.g: !deljoke 2
      }
    }
  }
  elseif (!joke == $1) {
    @commands ( $+ $time $+ ) $nick used $1 ( $+ $1- $+ )
    if ($2 != $null) {
      if ($readini(jokes.ini, $2, author) == $null) {
        msg $chan Have you forgotten the count? the numbers dont go that big $2
      }
      else {
        msg $chan joke $2 $+ : $readini(jokes.ini, n, $2, joke)
      }
    }
    else {
      msg $chan Random joke: $readini(jokes.ini, n, $rand(1,$ini(jokes.ini,0)), joke)
    }
  }
  elseif (!jokes == $1) {
    @commands ( $+ $time $+ ) $nick used $1
    if ($ini(jokes.ini,0) > 1) {
      msg $chan There are currently $ini(jokes.ini,0) jokes
    }
    else {
      msg $chan There is currently $ini(jokes.ini,0) joke
    }
  }
  elseif (!randomjoke == $1) {
    @commands $nick used $1
    msg $chan Random joke: $readini(jokes.ini, n, $rand(1,$ini(jokes.ini,0)), joke)
  }
  elseif (!jokeinfo == $1) {
    @commands ( $+ $time $+ ) $nick used $1 ( $+ $1- $+ )
    if ($2 != $null) {
      if ($readini(jokes.ini, $2, author) == $null) {
        msg $chan There is no joke $2
      }
      else {
        msg $chan Joke no. $2 was stored in $chan on $readini(jokes.ini, $2, date) at $readini(jokes.ini, $2, time) by $readini(jokes.ini, $2, author)
      }
    }
    else {
      msg $chan Please specify a joke no. you'd like to look up the info for.
    }
  }
  elseif (!findjoke == $1) {
    @commands ( $+ $time $+ ) $nick used $1 ( $+ $1- $+ )
    var %x = 0
    while (%x <= $ini(jokes.ini,0)) {
      if ($2- isin $readini(jokes.ini, %x, joke)) {
        set %jokes %jokes + %x
      }
      inc %x
    }
    if ($replace($replace(%jokes, +, |), |, $null) == $null) {
      msg $chan " $+ $2- $+ " was not found in any jokes
      unset %jokes
    }
    else {
      msg $chan " $+ $2- $+ " was found in joke(s): $replace(%jokes, +, |) $chr($asc(|))
      unset %jokes
    }
  }
}

Comments

Sign in to comment.
Assasin@lucidchat   -  Jun 26, 2012

hey thnx, though ive run outta ideas of wat to make... its my summer holidays, and i plan to get a few good scripts? any ideas? im not really good with sockets though

 Respond  
m40295   -  Jun 16, 2012

this helps with a diffrent project thank looks great will check it out

great snippit for learning

 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.