Import smilies
Added by Mr. BS over 9 years ago
Now that AdiIRC 1.9.7+ has support for emoticons/icons in chat area, here is a small snippet for easily import a directory of images.
The script bellow will use the filename for the image tag. For example, lol.png will be saved as lol. This is the tag to be used in chat and/or on scripts.
Sub-folders are supported.
Screenshot¶
//set %e0temp1 $$sdir(dir,Emoticons folder) | set %e0temp2 *.jpg;*.gif;*.bmp;*.png;*.ico | echo -agtu Importing emoticons, please be patient. | remini $qt($adiircini) emoticons | writeini -n emoticons UseEmoticons True | .timer -m 1 1 noop $!findfile(%e0temp1,%e0temp2,0,writeini -n $qt($adiircini) emoticons Emoticon_ $!+ $!regsubex($nopath($1-),/(\.(jpg|gif|bmp|png|ico))/,) $!1-) $(|) echo -agtu $!findfilen emoticons were successfully imported. Please confirm in /config -t Emoticons $(|) setconfig $(|) unset %e0temp* $(|) if ( $!findfilen <= 1500) $chr(123) window -kdC @Emoticons -1 -1 400 300 verdana 14 $(|) var % $+ i 4, % $+ t $!ini($adiircini,emoticons) $(|) while (% $+ i <= % $+ t) $chr(123) var % $+ x % $+ x $!regsubex($ini($adiircini,emoticons,% $+ i),/^Emoticon_(.+)/,$replace(\1,\\,\)) $(|) inc % $+ i $chr(125) $(|) clear @emoticons $(|) echo -w2 @emoticons % $+ x $(|) .timer -m 1 1 $!iif($window(@emoticons),window -a $!v1)
Usage¶
Just run the code above in editbox (where you send messages to channel) and it will open an explorer window for you to pick the emoticons folder.
Replies (1)
RE: Import smilies - Added by Nigel Fisher over 8 years ago
The script, as written, gives an error of "/writeini: insufficient parameters" when run in AdiIRC 2.4.
The updated version for 2.4://set %e0temp1 $$sdir(dir,Emoticons folder) | set %e0temp2 *.jpg;*.gif;*.bmp;*.png;*.ico | echo -agtu Importing emoticons, please be patient. | remini $qt($adiircini) emoticons | writeini -n config.ini emoticons UseEmoticons True | .timer -m 1 1 noop $!findfile(%e0temp1,%e0temp2,0,writeini -n $qt($adiircini) emoticons Emoticon_ $!+ $!regsubex($nopath($1-),/(\.(jpg|gif|bmp|png|ico))/,) $!1-) $(|) echo -agtu $!findfilen emoticons were successfully imported. Please confirm in /config -t Emoticons $(|) setconfig $(|) unset %e0temp* $(|) if ( $!findfilen <= 1500) $chr(123) window -kdC @Emoticons -1 -1 400 300 verdana 14 $(|) var % $+ i 1, % $+ t $!ini($adiircini,emoticons) $(|) while (% $+ i <= % $+ t) $chr(123) var % $+ x % $+ x $!gettok($ini($adiircini,emoticons,% $+ i),2,95) $(|) inc % $+ i $chr(125) $(|) clear @emoticons $(|) echo -w2 @emoticons % $+ x $(|) .timer -m 1 1 $!iif($window(@emoticons),window -a $!v1)
Can anyone help me modify the script to prepend and append all imported filenames with a colon? I've tried placing the colon in all the positions within the regsubex command that I can think of, but nothing has worked correctly.