I actually commented something about the code, but since, later, I felt what I previously said was unnecessary so I replaced it with something not useful.
I'm sorry.
As for the on input, Aucun50 is right.
@ Aucun50 If it works fine with it what is the point of telling me that?
@ Aucun50 That only happens if you do not put a channel to send the smile to.Even though the script works, there are some things that are not necessary as he pointed out. If there is no channel supplied, how about you add some error checks?
Edit: I see that you have fixed it.
But instead of $2 as a channel and the whole !smile #chan command, why don't you simply use an alias and message the $active? By far, it would be easier.
In my opinion, your code would make sense if it's an on text event where you have to supply a channel name, but an on input is unnecessary for personal usages.
Also: I said what I said before because I saw the same exact smiley ascii code on Hawkee a few weeks ago. If you don't like what I said, you are welcome to delete it whenever you wish, since this is your own snippet.