Top

Learn bot


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  4.8 (of 12 scores)
Date Added  Oct 25, 2008
Last Updated  Jun 04, 2009
Tags  bot  forget  hash  learn  mirc  remember  script  scripts  table 

Introduction

This was basically just a test to learn hash tables, and it worked great! So I figured I'd put it on here.

Load into your bots remotes (ALT+R).

As a "Learn bot", you can make it learn stuff and then recall back to information about the topic. Type !learn <topic> <description> to make the bot "learn" it. You can then recall the information by using !remember <topic>.

You can also use !forget <topic>, but you need access level 10 to the bot to use that. Type:
Code:
/auser 10 YOUR_NICKNAME
in your bots screen to set that.

Oh, and if you type /viewlearn in your bots mIRC, you can view a list of all topics and data that are currently stored within the learn bot.

Enjoy!

Grab the Code

on *:TEXT:!learn *:#: {
  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 Data $3- saved as topic: $strip($2)
  }
}
on *:TEXT:!remember *:#: {
  if (!$2) {
    notice $nick You didn't specify the right parameters.
    notice $nick Syntax: !remember <topic>
  }
  elseif (!$hget(learn,$strip($2))) {
    msg $chan No data was found for $2 $+ .
  }
  else {
    msg $chan Results for $strip($2) $+ : $hget(learn,$2)
  }
}
on 10:TEXT:!forget *:#: {
  if (!$2) {
    notice $nick You didn't specify the right parameters.
    notice $nick Syntax: !forget <topic>
  }
  elseif (!$hget(learn,$strip($2))) {
    msg $chan No data was found for $strip($2) $+ .
  }
  else {
    msg $chan Removed topic $strip($2) ( $+ $hget(learn,$strip($2)) $+ ) from the database.
    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

  (19)  RSS
^Neptune
Comments: 598
 
mIRC Snippet:  Learn bot
Posted on Oct 25, 2008 7:56 am
Small updates:

-The hash table will now carry over if you exit your mIRC.
-$strip has been used so colours won't have an effect (only in setting the description)
^Neptune
Comments: 598
 
mIRC Snippet:  Learn bot
Posted on Oct 25, 2008 9:45 am
Who rated 1. Honestly, what's the point? Everything works on this script. Kinda sad if you don't come up with an excuse.
Jace
Comments: 58
 
mIRC Snippet:  Learn bot
Posted on Oct 25, 2008 9:52 am
Umm its a reason not an excuse , excuse implys lieing;p and don't blame me i can't rate yet.If i could rate id give it a 5 or a 6 you still need to silence those notices and messages and add flood pros (EL FTW) and you need to check if the learn file exist and create it before you /hload if (!$hget(learn)) { hmake learn amount} and other then $strip-ing everything else i haven't tested it myself.`-.-ยด
Bullet_Dodger
Comments: 310
 
mIRC Snippet:  Learn bot
Posted on Oct 25, 2008 10:46 am
Very Good Script i will rate when i test
Lord-Harlot
Comments: 60
 
mIRC Snippet:  Learn bot
Posted on Oct 25, 2008 12:42 pm
Tis ok. 6/10

sure you can do more to it
napa182
Comments: 1,454
 
mIRC Snippet:  Learn bot
Posted on Oct 25, 2008 12:53 pm
abit pointless but it does'nt deserve a rate of 1 maybe 4/10 but not a 1
a careful warchild
Comments: 243
 
mIRC Snippet:  Learn bot
Posted on Oct 26, 2008 5:35 am
7/10 add $strip and i'll give you 8/10
jonesy44
Comments: 1,856
 
mIRC Snippet:  Learn bot
Posted on Oct 26, 2008 5:42 am
I think imma edit this code to make a retard bot which spouts out random bollocks for each person :]
a careful warchild
Comments: 243
 
mIRC Snippet:  Learn bot
Posted on Oct 26, 2008 6:06 am
lmao
Bullet_Dodger
Comments: 310
 
mIRC Snippet:  Learn bot
Posted on Oct 26, 2008 6:42 am
lolol
^Neptune
Comments: 598
 
mIRC Snippet:  Learn bot
Posted on Oct 26, 2008 8:13 am
Quote:
7/10 add $strip and i'll give you 8/10


Already been done in the latest update. :P
Eugenio
Comments: 1,193
 
mIRC Snippet:  Learn bot
Posted on Nov 13, 2008 3:34 pm
ROFL @ jonesy
Xpl0reR
Comments: 223
 
mIRC Snippet:  Learn bot
Posted on Dec 2, 2008 5:58 am
it would be nice to !remember with a wildcard.

like
!learn test This is a test

!remember testing
PATX
Comments: 389
 
mIRC Snippet:  Learn bot
Posted on Mar 13, 2009 9:32 pm
i have a script smaller than this one and it saves factoids as variables. also when i use this script the hash table does not carry over... anyway the script i came up with is http://www.hawkee.com/snippet/5853/ there. but now that script does not include a forget command so i amde another hash table one that is simpler than this also and when i saved it it worked :p that is somewhere on patx.pastebin.com lol anyway good script :: i must admit this was the first time i ound a working learn bot so i give i a 9 (would have given ten but i am having trouble with thats hash saving thing :p
a careful warchild
Comments: 243
 
mIRC Snippet:  Learn bot
Posted on Mar 25, 2009 12:17 pm
updated to 8/10 as i promised :) sorry for the late reply but i haven't been on hawkee in ages lol.
mr_president
Comments: 26
 
mIRC Snippet:  Learn bot
Posted on Jun 1, 2009 7:56 pm
can someone help me?
for me it always says,
"* /hload: no such table 'learn'"
jonesy44
Comments: 1,856
 
mIRC Snippet:  Learn bot
Posted on Jun 2, 2009 10:57 am
The script doesnt have an auto hash make unfortunately. run this command, mr_president and you should be ok from then on.

Code:
/hmake learn 1000
mr_president
Comments: 26
 
mIRC Snippet:  Learn bot
Posted on Jun 4, 2009 10:18 am
So, it deletes every thing every time is starts?
If thats the ase i think i like PATX one better that just sets varables.
It remembers them at restart.
^Neptune
Comments: 598
 
mIRC Snippet:  Learn bot
Posted on Jun 4, 2009 10:41 am
Totally forgot about that, was a noob at hash tables back here. Fixed.

Commenting Options

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

  
Bottom