Top

Bot dictionary


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  4.3 (of 4 scores)
Date Added  Sep 15, 2007
Last Updated  Sep 22, 2007
Tags  bot  dictionary  word 

Introduction

A dictionary I made for my bot. It's pretty simple to use:

!addef (word) (definition)
!deldef (word)
!editdef (word) (definition)
!viewdictionary
!define (word)

Please type: /set %myowner (owner) in the bot's mirc so that it will respond to you.

Grab the Code

; Dictionary
; by simplicity
 
on *:LOAD:{ 
 echo $color(info) -a Setup for bot owner..
 set %myowner $?="enter the nick you wish to set as the owner for this script"
}
 
on *:TEXT:*:#:{ 
  if ($nick iswm %myowner) { 
    ;dictionary 
    if ($1 iswm !addef) && ($2-3) { 
      while (!$readini(bot.ini,words,$2)) { 
        writeini -n bot.ini words $2 $3-
        notice $nick Word $2 has been added!
        halt
      }
      if ($readini(bot.ini,words,$2)) { notice $nick Definition $+(',$2,') is in the dictionary! | halt }
    }
    if ($1 iswm !deldef) && ($2) { 
      while ($readini(bot.ini,words,$2)) { 
        remini bot.ini words $2 
        notice $nick Word $2 has been deleted.
        halt
      }
      if (!$readini(bot.ini,words,$2)) { notice $nick Definition $+(',$2,') in the dictionary! | halt }
    }
    if ($1 iswm !editdef) && ($2-3) { 
      while ($readini(bot.ini,words,$2)) { 
        writeini -n bot.ini words $2 $3-
        notice $nick Word $2 has been edited.
        halt
      }
      if (!$readini(bot.ini,words,$2)) { notice $nick Definition $+(',$2,') isn't in the dictionary! | halt }
    } 
    if ($1 iswm !viewdictionary) { run bot.ini } 
    if ($1 iswm !define) && ($2) { 
      while ($readini(bot.ini,words,$2)) { 
        msg $chan Definition for word $+($2,:) $readini(bot.ini,words,$2)
        halt
      }
      if (!$readini(bot.ini,words,$2)) { notice $nick Definition $+(',$2,') isn't in the dictionary! | halt }
    } 
  }
}
 

Comments

  (12)  RSS
ZiX
Comments: 51
 
mIRC Snippet:  Bot dictionary
Posted on Sep 17, 2007 12:01 am
hmm nice
ermansanidhya
Comments: 42
 
mIRC Snippet:  Bot dictionary
Posted on Sep 20, 2007 1:48 am
look interisting i will try it
Cazz
Comments: 40
 
mIRC Snippet:  Bot dictionary
Posted on Sep 22, 2007 2:38 pm
hmmm...
very nice but maybe you could add
an "on *:LOAD:" and have it ask for the owner name.

simplicity
Comments: 17
 
mIRC Snippet:  Bot dictionary
Posted on Sep 22, 2007 2:43 pm
Done.
juuruichki
Comments: 9
 
mIRC Snippet:  Bot dictionary
Posted on Jan 1, 2008 5:06 am
is there any way i can add more than one owner jic other people want to use it also?
juuruichki
Comments: 9
 
mIRC Snippet:  Bot dictionary
Posted on Jan 1, 2008 5:12 am
and another thing (idk if you noticed it) if you type * <text> it adds the first word in your text to the dictionary then the following text as the definition
mountaindew
Comments: 1,826
 
mIRC Snippet:  Bot dictionary
Posted on Jan 1, 2008 6:21 pm
why "if ($nick [b]iswm] %myowner) {" ?

someone could simply use a similar nick to the owner and delete every word ... and for the other if's, u should use ==

for the if $2-3, u only need if $3 because if there is a $3, there's automatically a $2

and rather than using while, use if and else

and rather than halting, put a . in front of the command (.notice $nick ...)
Rebellious
Comments: 64
 
mIRC Snippet:  Bot dictionary
Posted on Jan 1, 2008 8:30 pm
Quote:
why "if ($nick [b]iswm] %myowner) {" ?

someone could simply use a similar nick to the owner and delete every word ... and for the other if's, u should use ==


No, not really. It would have to use $+(*,%myowner,*) or something similar to match the nick. Just %myowner would make the script make sure it was positively %myowner.

Try it using something like this:
Code:
alias testnick {
  if ($1 iswm Rebellious) { echo -a Match! }
  else { echo -a No match! }
}


/testnick Rebellious would return Match! while /testnick Rebellious1 would return No match!

But yes, this snippet has a LOT of room for improvement.
mountaindew
Comments: 1,826
 
mIRC Snippet:  Bot dictionary
Posted on Jan 1, 2008 8:40 pm
but im saying, "bell" iswm rebellious

so if ur nick was bell, you'd have power ;)
Rebellious
Comments: 64
 
mIRC Snippet:  Bot dictionary
Posted on Jan 1, 2008 8:43 pm
Well, try it out. /testnick bell and see what you get. ;)
mountaindew
Comments: 1,826
 
mIRC Snippet:  Bot dictionary
Posted on Jan 1, 2008 9:28 pm
oh wait, i think im wrong

(im on my wii so i cant do the alias)

but i think the nick would have to be *bell* , which i dont thin, u can do :P
Ghost-writer
Comments: 255
 
mIRC Snippet:  Bot dictionary
Posted on Aug 13, 2009 1:01 am
wtf just do variables if ( $nick == %owner ) { no need for the iswm :X and good script!

Commenting Options

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

  
Bottom