Top

Smiley Exchange


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Aug 22, 2006
Last Updated  Aug 22, 2006
Tags  color  replace  reptok  smile  smiley 

Introduction

I know this has probably been done before, but I will post my version of it here, plus I haven't seen one... I just wrote this today, and it seems to work for mem tell me if it doesn't for you and we'll see what we can do about it. What it is... It's a script that replaces smilies with coloured ones, there are only a few right now, but if you want more, and don't know how to add them just comment and say which you want added, and I'll add them asap, and re post the snippet here

Grab the Code

; ---------------------------------------
; Smiley replacer by Log2 Stew
; This will replace all the smilies
; such as :D or :) with their coloured
; counterpart
; ---------------------------------------
; List of Smilies:
; :D :d - Grinningly Happy
; :( - Sad Guy
; :) - Happy
; :p :P - Tongue out (works for both)
; :@ - Mad guy
; :o :O :0 - Shocked guy (Note: one is a 0 (zero) and the other is O (Capital o)
; ---------------------------------------
on *:INPUT:#: {
  if ($left($1,1) != $chr(47)) {
    var %txt = $1-
    var %txt = $smiley(:D,1 $+ $chr(44) $+ 8 $+ : $+ 4 $+ D $+ 1 $+ $chr(44) $+ 0, %txt)
    var %txt = $smiley(: $+ $chr(41),1 $+ $chr(44) $+ 8 $+ : $+ 4 $+ $chr(41) $+ 1 $+ $chr(44) $+ 0, %txt)
    var %txt = $smiley(:p,1 $+ $chr(44) $+ 8 $+ : $+ 4 $+ P $+ 1 $+ $chr(44) $+ 0, %txt)
    var %txt = $smiley(:@,5 $+ $chr(44) $+ 4 $+ : $+ 1 $+ @ $+ 1 $+ $chr(44) $+ 0, %txt)
    var %txt = $smiley(:o,1 $+ $chr(44) $+ 8 $+ : $+ 4 $+ O $+ 1 $+ $chr(44) $+ 0, %txt)
    var %txt = $smiley(:0,1 $+ $chr(44) $+ 8 $+ : $+ 4 $+ O $+ 1 $+ $chr(44) $+ 0, %txt)
    var %txt = $smiley(: $+ $chr(40),12 $+ $chr(44) $+ 8 $+ : $+ 4 $+ $chr(40) $+ 1 $+ $chr(44) $+ 0, %txt)
    msg $chan %txt
    haltdef
  }
}
alias smiley {
  if ($findtok($3-,$1,1,32)) {
    var %txt = $3-
    while ($findtok(%txt ,$1,1,32)) {
      if (c isin $chan(#).mode) {
        var %txt = $strip($reptok(%txt , $1, $2, 32))
      }
      else {
        var %txt = $reptok(%txt, $1, $2, 32)
      }
    }
    return %txt 
  }
  return $3-
}
 

Comments

  (3)  RSS
Bigmomma
Comments: 30
 
mIRC Snippet:  Smiley Exchange
Posted on Aug 22, 2006 5:55 am
Why dont you use the $replace() command?
log2
Comments: 51
 
mIRC Snippet:  Smiley Exchange
Posted on Aug 22, 2006 9:12 am
Because that would exchange everything even if there weren't spaces... let's say someone wanted to say: Today:do something; do something else...
It would replace the :d
Alien_wkshop
Comments: 5
 
mIRC Snippet:  Smiley Exchange
Posted on Aug 26, 2006 5:31 pm
another way i couldnt get yours to work so made my own
im not that good so have to right for each smily
====================================================================

on *:TEXT:=):#:{
/set %randhard. [ $rand(1,7) ]
if (%randhard. == 1) {
/msg $chan 9=)
/unset %randhard. [ * ]
}
elseif (%randhard. == 2) {
/msg $chan 12=)
/unset %randhard. [ * ]
}
elseif (%randhard. == 3) {
/msg $chan 5=)
/unset %randhard. [ * ]
}
elseif (%randhard. == 4) {
/msg $chan 4=)
/unset %randhard. [ * ]
}
elseif (%randhard. == 5) {
/msg $chan 10=)
/unset %randhard. [ * ]
}
elseif (%randhard. == 6) {
/msg $chan 13=)
/unset %randhard. [ * ]
}
elseif (%randhard. == 7) {
/msg $chan 14=)
/unset %randhard. [ * ]
}
}

Commenting Options

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

  
Bottom