Top

Definition script


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Jul 04, 2009
Last Updated  Jul 04, 2009
Tags  learn 

Introduction

Just put this in your remotes and then type !learn (topic) (definition)
type !del (word) to delete the definition and type !r (topic) for the bot to say the definition
I also made it so only certain people can add and delete the definitions. Just replace $nick1 $nick2 $nick3 with the 3 people you want. You can add more people though
Hope you like :-)

Grab the Code

on *:TEXT:!learn *:#: { if ($istok($nick1 $nick2 $nick3,$nick,32)) {
    if (!$3) {
      notice $nick You didn't specify the right parameters.
      notice $nick Syntax: !learn <topic>: <description>
    }
    else {
      hadd -m learn $strip($2) $3-
    msg $chan  $strip($2) : $3- }
  }
}
on *:TEXT:!r *:#: {
  if (!$2) {
    notice $nick You didn't specify the right parameters.
    notice $nick Syntax: !r <topic>
  }
  elseif (!$hget(learn,$strip($2))) {
    msg $chan No data was found for $2 $+ .
  }
  else {
    msg $chan  $strip($2) : $+  $hget(learn,$2)
  }
}
on *:TEXT:!del *:#: { if ($istok($nick1 $nick2 $nick3,$nick,32)) {
    if (!$2) {
      notice $nick You didn't specify the right parameters.
      notice $nick Syntax: !del <topic>
    }
    elseif (!$hget(learn,$strip($2))) {
      msg $chan No data was found for $strip($2) $+ .
    }
    else {
      notice $nick Removed Definition $strip($2) ( $+ $hget(learn,$strip($2)) $+ ) 
    hdel learn $strip($2) }
  }
}
alias viewlearn {
  window -a @Learn
  var %x = 1
  while (%x <= $hget(learn,0).item) {
    echo -g @Learn $hget(learn,%x).item $+ : $hget(learn,%x).data
    inc %x
  }
}
on *:EXIT: { hsave learn learn.txt }
on *:START: { 
  if (!$isfile(learn.txt)) {
    noop $input(The hash table for the learn bot could not be found.,uwo,Error!)
  }
  else {
    hmake learn 100
    hload learn learn.txt 
  }
}
 

Comments

  (0)  RSS

Commenting Options

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

  
Bottom