[MRC]Simple Random Quote IRC Bot

Results 1 to 3 of 3
  1. #1
    Account Upgraded | Title Enabled! shadow-xx is offline
    MemberRank
    Jan 2007 Join Date
    MegatonLocation
    804Posts

    [MRC]Simple Random Quote IRC Bot

    Each time the bot receives something it will count points
    till the amount of points is equal or more then the amount
    of points in the variable %talkreq once it reached that amount
    it will output a random quote from a text file called quotes.txt

    Note : It only responds on a text message.

    Commands :
    !nick - Changes the nick of the bot
    !viewrand - Shows the amount of points the bot has
    !setvar %<variablename> <value> - Sets a value

    How to use :
    1 - Put it in your mirc remotes
    2 - Add a variable called %access_<your nick> and set it to 255
    3 - Add a variable called %ralkreq and set it to 100

    Code:
    on *:TEXT:!nick*:#: {
      if (%access_ [ $+ [ $nick ] ] == 255) {  
        nick $2
      }
      else {
        /notice $nick you dont have access to use this command.
      }
    }
    on *:TEXT:!viewrand*:#: {
      if (%access_ [ $+ [ $nick ] ] == 255) { 
        msg $chan %randtalk_ [ $+ [ $chan ] ]
      }
      else {
        /notice $nick you dont have access to use this command.
      }
    }
    on *:TEXT:!setvar*:#: {
      if (%access_ [ $+ [ $nick ] ] == 255) {  
        set $2 $3
        /notice $nick The variable $2 has been set to $3
      }
      else {
        /notice $nick you dont have access to use this command.
      }
    }
    on *:TEXT:*:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,10)
      }
      if (%talkreq <= %randtalk_ [ $+ [ $chan ] ]) {
        msg $chan $read(quote.txt)
        set %randtalk_ [ $+ [ $chan ] ] 0
      }
    }
    on *:JOIN:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,20)
      }
    }
    on *:PART:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
      }
    }
    on *:PING:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
      }
    }
    on *:QUIT:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
      }
    }
    on *:VOICE:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
      }
    }
    on *:OP:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
      }
    }
    on *:KICK:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
      }
    }
    on *:ME:#: {
      while ($rand(1,5) != 2) {
        inc %randtalk_ [ $+ [ $chan ] ] $rand(1,5)
      }
    }


  2. #2
    Account Upgraded | Title Enabled! IQstim is offline
    MemberRank
    Jan 2009 Join Date
    632Posts

    Re: [MRC]Simple Random Quote IRC Bot

    You've got some interesting thoughts!

    Anything related to bots I'm interested on!

  3. #3
    Account Upgraded | Title Enabled! shadow-xx is offline
    MemberRank
    Jan 2007 Join Date
    MegatonLocation
    804Posts

    Re: [MRC]Simple Random Quote IRC Bot

    Quote Originally Posted by IQstim View Post
    You've got some interesting thoughts!

    Anything related to bots I'm interested on!
    Been trying to make one in perl that works
    but got some problems gona try to figure it out once
    i learn some more perl:)

    This one needs a running mIRC client to work



Advertisement