This is my first attempt at a Skin Engine. I plan to update it as I learn more and need more. It runs on a dialog, where if you click the "+" button you add a skin, "-" removes it. If you click the skin name it will echo you to show you what it will look like. Press "Save" to load it as your skin, you MUST have one highlighted.
Replace the word Alias ReplaceMePlease with Alias Name Here. To use the skins just place $Name() around the thing you want the skin to affect!
Alias ReplaceMePlease {
var %h = 1 , %end1
while (%h <= $numtok($1-,32)) {
%end1 = %end1 %skincolor $+ $chr(2) $+ $char(2) $+ $left($gettok($1-,%h,32),1) $+ %skincolor2 $+ $chr(2) $+ $char(2) $+ $mid($gettok($1-,%h,32),2) $+
inc %h
}
return %end1
}
alias Skin { dialog $iif($dialog(Skin),-v,-dm) Skin Skin }
dialog Skin {
title "Skin Engine- Horolaggia"
size -1 -1 105 71
option dbu
list 1, 1 17 50 50, size
text "Skins", 2, 18 8 28 8
button "+", 4, 51 26 10 8
button "-", 5, 51 36 10 8
button "Close", 8, 64 57 37 12, ok cancel
button "Save", 10, 64 41 37 12
}
On *:Dialog:*:*:*:{
if ($dname == Skin) {
if ($devent == init) {
loadbuf -ro $dname 1 SkinKeeper.txt
}
elseif ($devent == sclick) {
if ($did == 4) {
set %sname $$?="Name the skin? (No spaces allowed!)"
var %firstcolor $$?="Set the first color in the skin. (Numbers only. Format: 01 or 10)"
var %lastcolor $$?="Set the last color in the skin. (Numbers only. Format: 01 or 10)"
if (!$read(SkinKeeper.txt,w,%sname)) {
did -a $dname 1 %sname
write SkinKeeper.txt %sname
writeini SkinKeep.ini %sname First %firstcolor
writeini SkinKeep.ini %sname Last %lastcolor
}
%sname
dialog -v $dname
}
elseif ($did == 5) {
remini SkinKeep.ini $did(1).seltext
write -dl $+ $did(1).sel SkinKeeper.txt
did -d $dname 1 $did(1).sel
}
elseif ($did == 1) {
set %skintest [ $+ [ $readini(SkinKeep.ini,$did(1).seltext,First) ] ] | set %skintest2 [ $+ [ $readini(SkinKeep.ini,$did(1).seltext,Last) ] ]
echo -a $+(<,$me,>) $+(%skintest $+ H $+ %skintest2 $+ ello!)
}
elseif ($did == 10) {
set %skincolor [ $+ [ $readini(SkinKeep.ini,$did(1).seltext,First) ] ] | set %skincolor2 [ $+ [ $readini(SkinKeep.ini,$did(1).seltext,Last) ] ] | set %Skin $did(1).seltext
msg $active $ReplaceMe(Skin changed to %Skin Skin!)
}
}
}
}
Menu Channel,Query,Nicklist {
-
SkinDialog: /Skin
}