Top

Simple InfoBot script


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  6.5 (of 2 scores)
Date Added  Sep 18, 2009
Last Updated  Feb 11, 2010
Tags  bot  infobot  mirc 

Description

Its not winning any awards but it will (at a very basic level) store factoids sort of like an infobot, key word in the title being 'simple' ;)

to allow a user to use the del,lock, and unlock commands type /auser -a admin <nick/mask> in the bot's mIRC

Commands:
All users -
<botnick> <name> is <reply>
Quote:

<&CodeNinja> sk68Bot, google is http://www.google.com
<&sk68Bot> Ok, CodeNinja

<botnick> what is <name>
Quote:

<&CodeNinja> sk68Bot, what is google?
<&sk68Bot> google is http://www.google.com

Admins -
<botname> lock <name>
Quote:
<&CodeNinja> sk68Bot, lock google
<&sk68Bot> 'google' has been locked

<botname> unlock <name>
Quote:
<&CodeNinja> sk68Bot, unlock google
<&sk68Bot> 'google' has been unlocked

<botname> del <name>
Quote:
<&CodeNinja> sk68Bot, del google
<&sk68Bot> google deleted

Grab the Code

on *:LOAD: hmake infobot 100
on *:START:{ hmake infobot 100
  if ($isfile(infobot.hsh)) hload infobot infobot.hsh
}
on *:EXIT:{ hsave infobot infobot.hsh
}
on *:TEXT:*:#:{ if ($left($1,$len($me)) == $me) { if ($2-3 == what is) { infofind $chan $4- | halt }
    elseif ($istok($3-,is,32)) { var %is.pos = $findtok($1-,is,32)
      if (!$hget(infobot,$replace($gettok($1-,2 - $calc(%is.pos - 1),32),$chr(32),[sp]))) || (!$istok(%locked,$gettok($1-,2 - $calc(%is.pos - 1),32),32)) {
        hadd -m infobot $replace($gettok($1-,2 - $calc(%is.pos - 1),32),$chr(32),[sp]) $gettok($1-,$calc(%is.pos + 1) -,32)
        msg # Ok, $nick
        halt
      }
      else msg # $+(',$gettok($1-,2 - $calc(%is.pos - 1),32),') is locked!
    }
    elseif ($2 == del) && ($level($nick) == admin) { if ($hget(infobot,$replace($3-,$chr(32),[sp]))) {
        if (!$istok(%locked,$3-,44)) { 
          hdel infobot $replace($3-,$chr(32),[sp])
          msg # $3- deleted
        }
        else msg # $3- is locked!
      }
      else { msg # $+(',$3-,') does not exsist! }
    }
    elseif ($2 == lock) && ($level($nick) == admin) { if ($hget(infobot,$replace($3-,$chr(32),[sp]))) {
        set %locked $addtok(%locked,$3-,44)
        msg # $+(',$3-,') has been locked
      }
      else msg # $+(',$3-,') does not exsist!
    }
    elseif ($2 == unlock) && ($level($nick) == admin) { if ($istok(%locked,$3-,44)) { 
        set %locked $remtok(%locked,$3-,44)
        msg # $+(',$3-,') has been unlocked
      }
      else msg # $+(',$3-,') is not locked!
    }
  }
}
alias infofind { var %term = $remove($replace($2-,$chr(32),[sp]),?)
  if ($hget(infobot,%term)) { 
    msg $1 $remove($2-,?) is $hget(infobot,%term)
  }
  else { msg $1 I dont know what $+(',$remove($2-,?),') is!
  }
}
 

Comments

  (10)  RSS
sk68
Comments: 69
 
mIRC Snippet:  Simple InfoBot script
Posted on Sep 19, 2009 6:04 pm
is there a rule Im not aware of that says no one is allowed to comment on my scripts? at least tell me it sucks O_O
Xpl0reR
Comments: 227
 
mIRC Snippet:  Simple InfoBot script
Posted on Sep 20, 2009 12:25 am
maybe you could put the commands in the subject, or add a command to the bot that will put the commands in the channel or via /notice.
sk68
Comments: 69
 
mIRC Snippet:  Simple InfoBot script
Posted on Sep 20, 2009 8:36 am
didnt think about that :S

done :D
Vesperia
Comments: 26
 
mIRC Snippet:  Simple InfoBot script
Posted on Oct 4, 2009 2:37 pm
Nice. I liked it a lot.
DarkCoder
Comments: 33
 
mIRC Snippet:  Simple InfoBot script
Posted on Dec 21, 2009 3:19 pm
hairy monkey nuts :) its good.
sk68
Comments: 69
 
mIRC Snippet:  Simple InfoBot script
Posted on Feb 11, 2010 12:58 pm
minor bug fix
Shiny
Comments: 11
 
mIRC Snippet:  Simple InfoBot script
Posted on Feb 11, 2010 2:37 pm
I found the Bug :)
sk68
Comments: 69
 
mIRC Snippet:  Simple InfoBot script
Posted on Feb 11, 2010 3:55 pm
technically your mIRC found the bug >_>
`Dean
Comments: 17
 
mIRC Snippet:  Simple InfoBot script
Posted on Feb 12, 2010 1:46 am
Nice script, but when I type this: [01:46] <@`Dean_> [eH], del www.google.com

nothing happens. =p
sk68
Comments: 69
 
mIRC Snippet:  Simple InfoBot script
Posted on Feb 21, 2010 9:34 am
do any errors come up in the status window? or does it not react at all?

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom