mIRC Home    About    Download    Register    News    Help

Print Thread
#96971 07/09/04 04:55 AM
Joined: Jun 2004
Posts: 87
B
Babel fish
OP Offline
Babel fish
B
Joined: Jun 2004
Posts: 87
on *:input:*: {
if (/* !iswm $1) { say $replace($1-,$deltok($read(c:\bigger\scripts\acroynym.txt,w,* $+ $1- $+ *),2-,32),$deltok($read(c:\bigger\scripts\acroynym.txt,w,* $+ $1- $+ *),1,32)) | halt }
}
ok how do i make this so it shows throughout the sentence like wow that was funny laughs out loud<lol> but not the <> and still not that was laughs out loudly <lolly>

Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
KingTomatoe has a beautiful hash table script of this Ill try to remember the link

Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
nm


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Create a text file acros.txt and put it in your main mIRC folder. The text file should be ordered like this:


[hashtable]
lol=laughing out loud
lmao=laughing my ass off
...


Then: Start -> Run -> Wordpad -> Paste code into Wordpad -> Copy/paste from wordpad to mIRC Scripts Editor (alt+r) into tab "Remote"

Code:
#acronyms on
on *:START: loadacros
 [color:red]  [/color] 
on *:INPUT:*:{
  if /* !iswm $1 &amp;&amp; !$ctrlenter &amp;&amp; !$inpaste {
    haltdef
    msg $active $acronym($$1-)
  }
}
#acronyms end
 [color:red]  [/color] 
alias acronym {
  var %a = $1, %b = 1
  while $hfind(acros,$lower($1),%b,R) {
    .echo -q $regsub(%a,/(?&lt;=^|\s) $+ $v1 $+ (?=\s|$)/gi,$hget(acros,$v1),%a)
    inc %b
  }
  return %a
}
 [color:red]  [/color] 
alias addacro {
  if !$2 { echo -a You have to specify a translation for the item: $1 | return }
  if !$hget(acros) { loadacros }
  if $hget(acros,$1) { hdel acros $1 }
  hadd acros $1 $2-
  hsave -oi acros acros.txt
  echo -a Added acronym: $1 with translation: $2-
}
 [color:red]  [/color] 
alias delacro {
  if !$1 { echo -a You must specify an acronym | return }
  if !$hget(acros) { loadacros }
  if !$hget(acros,$1) { echo -a There is no such acronym: $1 | return }
  hdel acros $1
  hsave -oi acros acros.txt
  echo -a Deleted acronym: $1 
}
 [color:red]  [/color] 
alias loadacros {
  if $hget(acros) { hfree acros }
  hmake acros
  hload -i acros acros.txt
}
 

As you can see I added 2 aliases that allow you to add/delete/overwrite acronyms. You can also manually add/delete/edit the acronyms in the acros.txt file, but then they are not updated in the hash table yet. Then you should type /loadacros, which will update the acronyms hash table.

Enjoy

Last edited by FiberOPtics; 07/09/04 10:59 AM.

Gone.

Link Copied to Clipboard