Bot Theme

By Jonesy44 on Apr 20, 2008

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 :-)
Image

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) }
}

Comments

Sign in to comment.
RJosh   -  Dec 06, 2009

You may want to update your intro since the script no longer writes to bot\data* and writes to the directory the file was loaded from.

 Respond  
Spanky   -  Dec 06, 2009

it changes all text color to the color you pick in the room. So i can have it red and underlined in one room and yellow and bold in the other.. yes it does if you use the Tmsg Alias. and change all msg in the scripts to Tmsg..

 Respond  
darkarrow   -  Dec 03, 2009

wait so this changes all the bots script to this theme?

 Respond  
Jonesy44   -  Jan 24, 2009

yeeah, true. i was gonna add it then couldn't be assed :P

 Respond  
Spanky   -  Jan 23, 2009

no problem oh yea also think about adding the Alias u gave me xD for the lazy ppl u know
the

 alias tmsg { msg $1 $theme $+ $2- } 

is usefull if u got loads of scripts on ur bot anyways good work.
||stupid typos -.-||

 Respond  
Jonesy44   -  Jan 23, 2009

Updated a little bug, thanks spencer :]

 Respond  
Jonesy44   -  Jan 22, 2009

done

 Respond  
Spanky   -  Jan 22, 2009

update it BOY

 Respond  
Jonesy44   -  Apr 21, 2008

cheers bud :P

Hope ya enjoy ;-)

 Respond  
EL   -  Apr 20, 2008

o0o neat man im test XD

 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.