A usefull little snippet for a multi channel bot, so that users may set a general theme for the bot
In each "msg $chan" or something like that you have on your bot, make it;
/msg $chan $theme $+ text...
to add the theme to the text for the channel
[b]**NOTE: This currently saves the themes to "bot/data/themes.fos". You may change the directory by editing this bit wherever you see it. Else use;
/mkdir bot
/mkdir bot/data
Enjoy, and post any feedback, comments, or possible ideas. thanks :-)
on *:TEXT:!theme*:#: {
if (!$2) {
msg $chan You can set $me $+ 's (Unique) theme for $chan by using: !Theme <Color Code> (You may add any extra words, such as "bold" or "line" to add text-decoration)
msg $chan Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15
if ($theme) {
msg $chan $theme $+ This current theme was set by $+([,$theme(setby),]) at $+([,$theme(time),]) on $+([,$theme(date),])
}
}
else {
write -ds $+ $chan themes.dat
write themes.dat $chan $time $date $nick $iif( isin $2- || bold isin $2-,) $+ $iif( isin $2- || underline isin $2- || line isin $2-,,) $+ $+ $remove($2-,,,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)
msg $chan $theme $+ The theme has been set
}
}
alias theme {
%c = $read(themes.dat,s,$chan)
if ($1 == time) { return $gettok(%c,1,32) }
elseif ($1 == date) { return $gettok(%c,2,32) }
elseif ($1 == setby) { return $gettok(%c,3,32) }
else { return $gettok(%c,4-,32) }
}