mIRC Home    About    Download    Register    News    Help

Print Thread
#65091 24/12/03 06:57 AM
Joined: Nov 2003
Posts: 9
F
f00ge Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Nov 2003
Posts: 9
We all know what "bbl", "brb" etc. stand for.

But I'd still like it to actually say Be back later. And Be right back.

I know you can do an alias /brb /say Be right back.

But how can I avod having to use the "/" key - thus, only typing "brb"?

Very long time ago, I had some custom mIRC version, that had that. I just
typed lol, and it said "Laughing out loud" in the channel.

I guess it's easy, if you know how. smile

#65092 24/12/03 07:13 AM
Joined: Dec 2003
Posts: 10
J
Pikka bird
Offline
Pikka bird
J
Joined: Dec 2003
Posts: 10
There are 2 ways you can do this, both using on INPUT.

on ^*:INPUT:*:{
if ($left($1,1) != /) {
msg $active $replace($1-,lol,Laughing Out Loud,brb,Be Right Back,wb,Welcome Back)
haltdef
}
}

you can add to that code, after Welcome Back you can put ,rofl,Rolling On The Floor Laughing)

or, you can use this:

on ^*:INPUT:*:{
if ($left($1,1) != /) {
if ($1 == lol) { msg $active Laughing Out Loud $2- | halt }
if ($1 == brb) { msg $active Be Right Back $2- | halt }
if ($1 == wb) { msg $active Welcome Back $2- | halt }
haltdef
}
}
you can also add to this, by inserting another line under the wb line.

Hope this helps.

#65093 24/12/03 07:54 AM
Joined: Dec 2003
Posts: 1
S
Mostly harmless
Offline
Mostly harmless
S
Joined: Dec 2003
Posts: 1
on 1:INPUT:*:{
if ($left($1,1) != /) {
if ($1 == lol) { msg $active Laughing Out Loud $2- | halt }
if ($1 == brb) { msg $active Be Right Back $2- | halt }
if ($1 == wb) { msg $active Welcome Back $2- | halt }
haltdef
}
msg $active $1-
}

note the bold section, this is required to keep your mirc passing on all the text, not only teh lines starting with lol or brb or wb.


#65094 24/12/03 08:00 AM
Joined: Nov 2003
Posts: 84
S
Babel fish
Offline
Babel fish
S
Joined: Nov 2003
Posts: 84
why not do if (lol isin $1-)
What would be a better script imo


chat.irchat.tv
#Help #Trivia #Scripts
Co-Admin @ IRChat.tv
#65095 24/12/03 08:07 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
lolipop

Code:
; initialize the first few acronyms
alias acronym.init {
  ; add the values to our table
  [color:red]/hadd acronym afk Away From Keyboard
  /hadd acronym brb Be Right Back
  /hadd acronym gtg Got To Go
  /hadd acronym lol Laughing Out Loud
  /hadd acronym ttyl Talk To You Later[/color]
}

; Intiilize the table
on *:START: {
  ; create the hash table of 100 items (size of 10)
  /hmake acronym 10
  ; Load our hash file if it's there, other wise initialize the hash table
  if ($isFile(acronyms.hsh)) {
    ; file exists, now we load it
    /hload acronym acronyms.hsh
  }
  else {
    ; the file does not exist.  Now we initialize, and save
    /acronym.init
    /hsave -o acronym acronyms.hsh
  }
}

; Save the table
on *:EXIT: {
  ; save our table on exit
  /hsave -o acronym acronyms.hsh
  ; clear the used memory
  /hfree acronym
}

; replace acronyms with their proper meaning
on *:INPUT:#: {
  ; first make sure the text entered isn't a command
  if ($left($1, 1) !isin $+(/,$readini($mircini, text, commandchar))) {
    ; search for words to replace
    var %w = 1              | ; current word we're comparing
    var %text               | ; current message
    var %acro = [<acronym>] | ; the design you want your acronym to take
    ; loop through each word looking through a match
    while ($gettok($1-, %w, 32) != $null) { | ; we include != $null incase the user types a 0
      var %word = $ifmatch
      ; find the word in our table
      if ($hget(acronym, %word) != $null) var %text = %text $replace(%acro, <acronym>, $ifmatch)
      else var %text = %text %word
      ; Increase Counter Variable
      /inc %w
    }
    ; send the message to the channel
    /msg $chan %text
    ; stop the "double talk"
    /halt
  }
}


Save that to a .mrc file, and before you load it, set the acronyms you want in the red potion. Add a new line per acronym you'd like.


-KingTomato
#65096 24/12/03 08:10 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
by the way, if you want to learn about hash tables, or want to know more about this script, I wrote a tutorial on hash tables, that uses this script as a demo on mirc.net ( http://www.mirc.net/projects.php?go=1064732500&get_desc=1 ).


-KingTomato
#65097 24/12/03 08:18 AM
Joined: Nov 2003
Posts: 84
S
Babel fish
Offline
Babel fish
S
Joined: Nov 2003
Posts: 84
I saw the tut awhile back MrPeepers, its a good one


chat.irchat.tv
#Help #Trivia #Scripts
Co-Admin @ IRChat.tv
#65098 24/12/03 10:22 AM
Joined: Dec 2003
Posts: 61
A
Babel fish
Offline
Babel fish
A
Joined: Dec 2003
Posts: 61
Code:
on *:INPUT:*: {
if (/* !iswm $1) {
}
}


^^ is faster

Last edited by Aeron; 24/12/03 10:24 AM.
#65099 24/12/03 10:36 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
But not accurate. You do have the ability to specify your own command prefix, thus the check in the ini.


-KingTomato
#65100 24/12/03 01:21 PM
Joined: Nov 2003
Posts: 9
F
f00ge Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Nov 2003
Posts: 9
Holy cr*p!
I guess it wasn't that easy after all.
I would have never come up with that.

Gonna try some of your scripts.

Thanks, all.

#65101 24/12/03 05:21 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
It's actually really simplistic as far as a hash table script goes. Its also commented, taking up a lot of room. >:D

Again, the tutorial will show you how it works, if you're willing to do a lil 15 minute reading. Hope it works out ok. It's also very efficient if you have several thousand acronyms >:D


-KingTomato
#65102 24/12/03 07:03 PM
Joined: Nov 2003
Posts: 9
F
f00ge Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Nov 2003
Posts: 9
k, I'm back after some testing.
Thank you all for contributing.

The one from j0k3r stopped me from saying anything else, than those brb, brt, lol etc. - hehe.

The one from sirono did work. But whenever I /topic, /notice, /nick etc, it spammed the channel with /notice nick text - before it actually did the notice. Hard to keep anything private. laugh

Then I tried KingTomato's hash thingie.
That wouldn't save to any file .ini or .mrc. Dunno why. The file was empty, and I couldn't even locate the actual file with my windows explorer. When I tried to paste it directy into scrpt.ini, it toally messed up the text - half of it was missing, when I openned the editor again.
I did not do the tutorial (yet). Might do that later today.

Meanwhile, I have found that old, old mIRC, that had that brb, lol stuff. I could not succesfully copy it to my currect mIRC.
Here is what it looks like:
----------------------------

on 1:INPUT:*: {
if ( %wb == on ) && ( $parms == wb ) { msg $active 6W3elcome 6B3ack | halt }
elseif ( %np == on ) && ( $parms == np ) { msg $active 6N3o 6P3roblem | halt }
elseif ( %brb == on ) && ( $parms == brb ) { msg $active 6B3e 6R3ight 6B3ack | halt }
elseif ( %bbl == on ) && ( $parms == bbl ) { msg $active 6B3e 6B3ack 6L3ater | halt }
elseif ( %lol == on ) && ( $parms == lol ) { msg $active 6L3aughs 6O3ut 6L3oud | halt }
elseif ( %bbs == on ) && ( $parms == bbs ) { msg $active 6B3e 6B3ack 6S3oon | halt }
elseif ( %gtg == on ) && ( $parms == gtg ) { msg $active 6G3ot 6T3o 6G3o | halt }
elseif ( %hehe == on ) && ( $parms == hehe ) { msg $active 6£4aughs 6Ø4ut 6£4oud | halt }
elseif ( %heh == on ) && ( $parms == heh ) { msg $active 10£14aughs 10Ø14ut 10£14oud | halt }
else { goto end }
:end
}

-----------------

I had no idea this was going to be so difficult. confused

Anyway, thanks for all your help so far, guys. Merry X-mas.

#65103 24/12/03 07:43 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Incase you want the previous, here it is:

acronym.mrc


-KingTomato
#65104 24/12/03 09:33 PM
Joined: Nov 2003
Posts: 9
F
f00ge Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Nov 2003
Posts: 9
Thanks, KingTomato.

The file works.... but only your predefined acronyms will work.
When I add/replace others, nothing happens.

#65105 25/12/03 12:21 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
just type /hadd <acronym> <meaning> in either the mirc command prompt, or in an alias. It should work instantly


-KingTomato
#65106 25/12/03 01:16 AM
Joined: Nov 2003
Posts: 9
F
f00ge Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Nov 2003
Posts: 9
* /hadd: no such table 'brb'

Sorry for being a n00b here. I'm pretty new to this advanced stuff.

#65107 25/12/03 01:23 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
sorry, brian fart.. heh

/hadd acronym <acronym> <meaning>

EDIT:
Ex:
/hadd acronym rofl Rolling On Floor Laughing


-KingTomato

Link Copied to Clipboard