Not completely sure if the entire script works, but here.
Commands:
/acroadd [acronym] [meaning]
/acrodel [acronym] [meaning]
/acrostart (This is only if for some reason the files don't load on start.)
I got some of the code from http://www.mirc.net/tutorial/hash[1064732500].php
This is my first hash table script thing, lol.
Positive feedback only.
;Got some of the script from http://www.mirc.net/tutorial/hash[1064732500].php since I referred to that while learning hash.
;The majority of the on input I got from the above link :(
;Easy stuff?
on *:load: {
if (!$isfile(Acronyms.hsh)) { echo -s Type /acrostart to "install" the script. | halt }
echo -s Acronym file previously loaded. will use that..
hload acro Acronym.hsh
}
alias acrostart {
if (!$isfile(Acronyms.hsh)) {
.hmake acro 10
.hadd acro brb Be Right Back!!
.hadd acro bbl Be Back Later!!
.hadd acro gtg Got To Go!!
.hadd acro afk Away From Keyboard!!
echo -s Acronym system installed. Type /acrocommands to get a list of commands.
halt
}
else {
echo -s File already exists!
halt
}
}
alias acrocommands {
echo -s 7/acroadd [acronym] [what the acronym stands for] 1To add a new acronym.
echo -s 7/acrodel [acronym] [value]1 To delete an existing acronym
}
alias acroadd {
if ($hget(acro,$strip($2-))) { echo -s $1 already exists! | halt }
.hadd acro $strip($1) $strip($2-)
echo -s Acronym $strip($1) added with the value $strip($2-) $+ .
.hsave acro Acronyms.hsh
}
alias acrodel {
echo -s acro $2 deleted.
.hdel acro $strip($1) $strip(2-)
.hsave acro Acronyms.hsh
}
alias acronym.init {
.hadd acro brb Be Right Back!!
.hadd acro bbl Be Back Later!!
.hadd acro gtg Got To Go!!
.hadd acro afk Away From Keyboard!!
}
on *:start: {
.hmake acro 10
if ($isfile(Acronyms.hsh)) {
.hload acro Acronyms.hsh
}
else {
acronym.init
.hsave -o acro Acronyms.hsh
}
}
on *:exit: {
.hsave -o acro Acronyms.hsh
.hfree acro
}
;Now for the complicated stuff?
on *:input:*: {
if ($left($1, 1) !isin $+(/,$readini($mircini, text, commandchar))) {
var %w = 1
var %text
var %acro = ~<acro>~
while ($gettok($1-, %w, 32)) {
var %word = $ifmatch
if ($hget(acro, %word) != $null) { var %text = %text $replace(%acro, <acro>, $ifmatch) }
else var %text = %text %word
inc %w
}
msg $active %text
halt
}
}
It isn't his script though, lol. I gave credit where it was due (the on input part)
this is ripped, its from a tutorial on another website i saw, and I KNOW ITS THIS ONE.
ripping is lame.
Not true. at all. Ripping is claiming code that is not yours.
I got some of the code from http://www.mirc.net/tutorial/hash[1064732500].php
I obviously GAVE THE URL TO THAT VERY TUTORIAL AND GAVE IT CREDIT ON WHAT I GOT FROM IT
and..
At least 25% of the code must be written by you.
The majority of the code is mine. Even using code fro the tutorial I CLEARLY STATED I USED I edited that a bit as well. credit is given to who it belongs as well as over 25% of the code being written by me.
Maybe you'll think and actually read the introduction AND THE FIRST TWO LINES OF THE CODE before you go off saying I ripped.
This script should've clearly noted 'By the courtesy of KingTomato, I hereby present you his script with some modification of my idea. All credits go to the original author.'
Why would I give the owner of the tutorial credit for something that is primarily mine? Again...I already gave him credit when it was due.
original is best, don't go taking ideas, anyways, you should work in my Hash Protection then you wouldn't lose your hash on restart