Simple InfoBot v2.0.1

By sk68 on Sep 18, 2009

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 in the bot's mIRC

Commands: All users -

is > <&CodeNinja> sk68Bot, google is http://www.google.com <&sk68Bot> Ok, CodeNinja what is ? > <&CodeNinja> sk68Bot, what is google? <&sk68Bot> google is http://www.google.com Admins - lock > <&CodeNinja> sk68Bot, lock google <&sk68Bot> 'google' has been locked unlock > <&CodeNinja> sk68Bot, unlock google <&sk68Bot> 'google' has been unlocked del > <&CodeNinja> sk68Bot, del google <&sk68Bot> google deleted **UPDATES** **v2.0** Total rewrite from scratch * Fixed bugs with admin commands not working * Changed commands to regex * Various housekeeping **v2.0.1** * A little housekeeping ```mirc on *:START:{ hmake infobot 100 if ($isfile(infobot.hsh)) { hload infobot infobot.hsh } } on *:EXIT:{ hsave infobot infobot.hsh } on *:TEXT:*:#:{ if ($regex($1-,$+(/^,$me,([:,])?) what is (.+)\?$/Si)) { var %info $left($4-,-1) if ($info(%info).exists) { msg # $iif(%info == $nick,You are,%info is) $info(%info) } else { msg # %info doesn't exist! } } elseif ($regex(infoadd,$1-,$+(/^,$me) $+ ([:,])? (.+) is (.+)/Si)) { if ($info($regml(2)).exists) { msg # $regml(2) already exists! } else { info add $regml(infoadd,2) $regml(infoadd,3) msg # Ok, $nick } } elseif ($regex($1-,$+(/^,$me) $+ ([:,])? (del(ete)?|forget|remove)/Si) && $isadmin($nick)) { if (!$info($3-).exists) { msg # $3- doesn't exist! } elseif ($info($3-).locked) { msg # $3- is locked! } else { info del $3- msg # $3- was deleted } } elseif ($regex($1-,$+(/^,$me) $+ ([:,])? lock/Si) && $isadmin($nick)) { if (!$info($3-).exists) { msg # $3- doesn't exist! } elseif ($gettok($info($3-),-1,32) === LOCK) { msg # $3- is already locked! } else { info lock $3- msg # $3- has been locked } } elseif ($regex($1-,$+(/^,$me) $+ ([:,])? unlock/Si) && $isadmin($nick)) { if (!$info($3-).exists)) { msg # $3- doesn't exist! } elseif ($gettok($info($3-),-1,32) !=== LOCK) { msg # $3- isn't locked! } } } alias -l info { if ($isid) { noop $regsub($1,/\s/g,[sp],%arg) if ($prop == exists) { return $iif($hget(infobot,%arg) != $null,1,0) } elseif ($prop == locked) { return $iif($hget(infobot,$+(%info,.lock)),1,0) } elseif (!$prop) { return $hget(infobot,%info) } } else { if ($infobotdebug) { echo -s string $1 ; $2 ; $3 ; $4- } noop $regsub($2,/\s/g,[sp],%info) if ($1 == add) { hadd $iif($infobotdebug,-sm,-m) infobot %info $3- } elseif ($1 == del) { hdel $iif($infobotdebug,-s) infobot %info } elseif ($1 == edit) { hadd $iif($infobotdebug,-sm,-m) infobot %info $3- } elseif ($1 == lock) { hadd $iif($infobotdebug,-sm,-m) infobot $+(%info,.lock) 1 } elseif ($1 == unlock) { hdel $iif($infobotdebug,-s) infobot $+(%,info,.lock),2) } } } alias -l isadmin { echo -s $level($address($1,5)) return $iif($level($address($1,5)) == admin,1,0) } alias -l infobotdebug return 0 ```

Comments

Sign in to comment.
sk68   -  Nov 12, 2010

Updated

More
 Respond  
SkyBytes   -  Oct 09, 2010

Yay :D

More
 Respond  
sk68   -  Oct 09, 2010

UPDATE! This is my first time using regex at this level, so pointers would be appriciated

More
 Respond  
sk68   -  Oct 05, 2010

OKI! This bad boy is gonna get a complete overhaul, everything is being redesigned and rewritten, hopefully that will fix all the bugs people have been having, stick around for updates :D

More
 Respond  
sk68   -  Feb 21, 2010

do any errors come up in the status window? or does it not react at all?

More
 Respond  
`Dean   -  Feb 12, 2010

Nice script, but when I type this: [01:46] <@`Dean_> [eH], del www.google.com

nothing happens. =p

More
 Respond  
sk68   -  Feb 11, 2010

technically your mIRC found the bug >_>

More
 Respond  
Shiny   -  Feb 11, 2010

I found the Bug :)

More
 Respond  
sk68   -  Feb 11, 2010

minor bug fix

More
 Respond  
DarkCoder   -  Dec 21, 2009

hairy monkey nuts :) its good.

More
 Respond  
Vesperia   -  Oct 04, 2009

Nice. I liked it a lot.

More
 Respond  
sk68   -  Sep 20, 2009

didnt think about that :S

done :D

More
 Respond  
Xpl0reR   -  Sep 20, 2009

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.

More
 Respond  
sk68   -  Sep 19, 2009

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

More
 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.