Emoticon changer

By blackvenomm666 on Sep 27, 2011

Been meaning to do this one for a while and a friend today decided to ask me for help with messing with the emoticon bs. so i decided i was messing with it anyways may as well give it a go:D
this snippet changes mirc's default way of showing when someone uses emoticons.
this is how mirc shows emoticons that java users use

Image

with this script it will replace the ugly mirc default ^^^ with
the theme will not be there all it will do is show the nick and the smiley no date/time/day or coloration
Image
to use this do alt + r then load this into a new remotes file. then save it. you must either A. load it when not connected to servers then connect or B. disconnect from servers after loading it then reconnect to them

on *:connect: {
  ignore -tw *
  debug -i aux emoticon
}
alias emoticon {
  tokenize 32 $1-
  if (PRIVMSG isin $1-) && (IMAGE isin $1-) && (smile isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58)) $remove($gettok($2,1,33),$chr(58))  :)
    }
    else {  $remove($gettok($2,1,33),$chr(58))  :)
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (sad isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  :(
    }
    else {   $remove($gettok($2,1,33),$chr(58))  :(
    }
  }

  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (wink isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  ;)
    }
    else {  $remove($gettok($2,1,33),$chr(58))  ;)
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (cry isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  :'(
    }
    else {  $remove($gettok($2,1,33),$chr(58))  :'(
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (mad isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  D:<
    }
    else {  $remove($gettok($2,1,33),$chr(58))  D:<
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (tongue isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  :P
    }
    else {  $remove($gettok($2,1,33),$chr(58))  :P
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (kiss isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  :*
    }
    else {  $remove($gettok($2,1,33),$chr(58))  :*
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (smirk isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  :>
    }
    else {   $remove($gettok($2,1,33),$chr(58))  :>
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (surprise isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  :O
    }
    else {  $remove($gettok($2,1,33),$chr(58))  :O
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (undecided isin $1-) {
    if ($4 == $me) {    
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  :\
    }
    else {  $remove($gettok($2,1,33),$chr(58))  :\
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (indifferent isin $1-) {
    if ($4 == $me) {   
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  :/
    }
    else {   $remove($gettok($2,1,33),$chr(58))  :/
    }
  }
  elseif (PRIVMSG isin $1-) && (IMAGE isin $1-) && (evil isin $1-) {
    if ($4 == $me) { 
      echo -t $remove($gettok($2,1,33),$chr(58))   $remove($gettok($2,1,33),$chr(58))  >:D
    }
    else {  $remove($gettok($2,1,33),$chr(58))  >:D
    }
  }
}

Comments

Sign in to comment.
blackvenomm666   -  Jan 10, 2012

there is no gif? the emoticons are a built in java feature that do not show up on mirc. they show up as red text instead. i changed it to make it show up as text smileys

 Respond  
Vegitha   -  Jan 10, 2012

how do i add the gif (emoticons) ? do i make a new folder under in the irc directory?

 Respond  
Jethro   -  Sep 28, 2011

Ryan, you could've done the if-then-else comparison saving yourself an if statement and the repetition of another:

alias emoticon {
  tokenize 32 $strip($1-)
  if ($count($1-,PRIVMSG,IMAGE)) {
    if ($4 == $me) {
      echo -t $remove($gettok($2,1,33),$chr(58)) $remove($gettok($2,1,33),$chr(58)) $replace($1-,smile,:),sad,:(,cry,:'(,$&
        mad,D:<,tongue,:P,kiss,:*,smirk,:>,surprise,:o,undecided,:\,indifferent,:/,evil,>:D)
    }
    else {
      echo -t $4 $remove($gettok($2,1,33),$chr(58)) $replace($1-,smile,:),sad,:(,cry,:'(,$&
        mad,D:<,tongue,:P,kiss,:*,smirk,:>,surprise,:o,undecided,:\,indifferent,:/,evil,>:D)
    }
  }
}

It's either the nick equals $me or not. A simple true or false.

 Respond  
yelow79   -  Sep 28, 2011

Thank you for clearing that up. I knew there was a reason just didn't know what it was.

 Respond  
blackvenomm666   -  Sep 28, 2011

and even if you could just use the on load. that would be a fail since you don't load the script everytime you open mirc. it must work on the on connect everytime or else the script will fail.

 Respond  
Jethro   -  Sep 28, 2011

yelow79, lots of people have such a misconception that on load event will trigger when a script is loaded in a remote. That's not often the case. On occasions mIRC will prompt for initialization of a script, but most of the time it'll require you to load it manually for the onload event to execute. If you copy a simple snippet directly into the remote without a manual load, the load event is useless.

extio, why will you bother with a loop? :/ Do you care to demonstrate to us your idea behind a loop?

 Respond  
extio   -  Sep 28, 2011

ooo i didnt realize jethro's did it without a loop. but i dont understand it at all. hmm...

 Respond  
yelow79   -  Sep 28, 2011

Ryan or whoever else....
Why did you use " on :connect: " instead of "on :load: "

wouldn't on load remove the issue you have of loading the script and then having to reconnect to a server?

 Respond  
blackvenomm666   -  Sep 27, 2011

also going off of jethros example

alias emoticon {
  tokenize 32 $strip($1-)
  if ($count($1-,PRIVMSG,IMAGE)) && ($4 == $me) {
    echo -t $remove($gettok($2,1,33),$chr(58)) $remove($gettok($2,1,33),$chr(58)) $replace($1-,smile,:),sad,:(,cry,:'(,$&
      mad,D:<,tongue,:P,kiss,:*,smirk,:>,surprise,:o,undecided,:\,indifferent,:/,evil,>:D)
  }
  elseif ($count($1-,PRIVMSG,IMAGE)) && ($4 != $me) {
    echo -t $4 $remove($gettok($2,1,33),$chr(58)) $replace($1-,smile,:),sad,:(,cry,:'(,$&
      mad,D:<,tongue,:P,kiss,:*,smirk,:>,surprise,:o,undecided,:\,indifferent,:/,evil,>:D)
  }
}

that is the corrected version that will work for both channel and pm emoticon messages

 Respond  
Frenetic   -  Sep 27, 2011

We were all newbies some time, by doing it a way we could of understood then may or may not help them now.

 Respond  
blackvenomm666   -  Sep 27, 2011

yes i probably could use a loop. i could also use a txt or ini to just read from and replace easily. but i tend to like going the simplistic route. when i code i always think about the noobs and i try to code in a way that while may not be the BEST way it might now always look the best but i try to make it so the noobs can easily learn from it and therefore pull it apart easier and go ok this makes this run this is how this can be done and give them a basis to work off of for their own scripts.

 Respond  
extio   -  Sep 27, 2011

i know there would be a way to use a loop to avoid a lot of that code and use variables to change just the parts...... but i guess thats unimportant.

 Respond  
Frenetic   -  Sep 27, 2011

I love how everyone knows your name Ryan, lol. :)

Nice work though. =)

 Respond  
yelow79   -  Sep 27, 2011

I always like seeing different ways of doing the same thing. I believe it helps everyone learn more.

 Respond  
blackvenomm666   -  Sep 27, 2011

no i don't mind i like learning new ways of doing stuff jeth:) i just don't always understand it right off the bat

 Respond  
Jethro   -  Sep 27, 2011

Yeah Ryan. I didn't mean to barge in like that and correct you. It's just all the ifs and repetitions get the best of me and I couldn't help but offer my two cents. ^^

 Respond  
blackvenomm666   -  Sep 27, 2011

oo now that i look more i understand yours

 Respond  
blackvenomm666   -  Sep 27, 2011

O_O yea that makes no sense to me jethro and i just made my version bigger ran into a problem with it happening in pm's had to figure out how to fix that

 Respond  
Jethro   -  Sep 27, 2011

Let's shrink it down a bit, Ryan:

alias emoticon {
  tokenize 32 $strip($1-)
  if ($count($1-,PRIVMSG,IMAGE)) {
    echo -t $4 $remove($gettok($2,1,33),$chr(58)) $replace($1-,smile,:),sad,:(,cry,:'(,$&
      mad,D:<,tongue,:P,kiss,:*,smirk,:>,surprise,:o,undecided,:\,indifferent,:/,evil,>:D)
  }
}

Did you mean $strip($1-) ?

 Respond  
D34th   -  Sep 27, 2011

Ryan: Removing the major annoyances of IRC with CS. +10 :D

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.