SassIRC input theme

By PuNkTuReD on Jan 20, 2009

ABOUT THIS SCRIPT
This script has
Acro Theme
Message Theme
Nick Theme

Acro's you create yourself,
and there is an option to make your own Message Theme.
acro's nick's and your messages will be encased with --()--
Example:
--( Hi --(PuNkTuReD)-- this is a test --(Laugh Out Loud)-- )--

I do plan on "revamping" this, so any ideas would be appreciated.

/* 
ON INPUT 
*/

on 1:input:*: {
  :next
  if ($left($1,1) == /) && ($left($1,1) != /server) || ($ctrlenter) || ($inpaste) { return }
  else {
    set %output $1-
    :next1
    if (%messagethemes == ON) { set %output 4--( $+ %inputcolor %output 4)-- | goto next2 }
    if (%custommessagethemes == ON) { set %output %theme1 %output %theme2 | goto next2 }
    else { goto next2 }
    :next2
    if (%nickthemes == ON) {
      var %a = 1
      var %b = $nick($chan,0)
      while %a <= %b {
        if ($nick($chan,%a) isin $strip(%output)) { set %output $replace(%output,$($nick($chan,%a)), $(4--(14 $+ $nick($chan,%a) $+ 4)-- $+ %inputcolor )) | inc %a }
        else { inc %a }
      }
      while %a > %b { goto next3 }
    }
    else { goto next3 }
    :next3
    if (%acros == ON) {
      var %a = 1
      var %b = $lines(myacros1.txt)
      var %c = 1
      var %d = $calc($numtok(%output,32) + 1 )
      while %c <= %d {
        if ($read(myacros1.txt, %a) == $gettok(%output,%c,32)) { set %output $replacex(%output,$read(myacros1.txt, %a),4--( $+ $read(myacros2.txt, %a) $+ 4)-- $+ %inputcolor ) | inc %c }
        else { if (%c <= %d) { inc %c } }
        if (%c > %d) { inc %a | var %c = 1 }
        if (%a > %b) { goto msg }
      } 
    } 
    else { goto msg }
    :msg
    msg $active $iif(%inputcolor = $null,,%inputcolor) %output 
    halt 
  }
}

/* 
MENU 
*/

menu * {
  --( Inputs )--
  .--( Nick Theme )--
  ..$iif(%nickthemes == ON,$style(1)) --( On )--:set %nickthemes ON | echo -a 4(14--4S14ass4IRC14--4)4(14--4N14ick4T14heme14--4)4[14 Activated 4]
  ..$iif(%nickthemes == OFF,$style(1)) --( Off )--:set %nickthemes OFF | echo -a 4(14--4S14ass4IRC14--4)4(14--4N14ick4T14heme14--4)4[14 DeActivated 4]
  .-
  .--( Message Theme )--
  ..$iif(%messagethemes == ON,$style(1)) --( Default On )--:set %custommessagethemes OFF | set %messagethemes ON | echo -a 4(14--4S14ass4IRC14--4)4(14--4M14essage4T14heme14--4)4[14 Activated 4]
  ..$iif(%messagethemes == OFF,$style(1)) --( Default Off )--:set %messagethemes OFF | echo -a 4(14--4S14ass4IRC14--4)4(14--4M14essage4T14heme14--4)4[14 DeActivated 4]
  ..$iif(%custommessagethemes == ON,$style(1)) --( Custom )--:dialog $iif($dialog(my.themes),-v,-dm) my.themes my.themes
  .-
  .--( Text Effects )--
  ..--( Acros )--
  ...$iif(%acros == ON,$style(1)) --( On )--:set %acros ON | echo -a 4(14--4S14ass4IRC14--4)4(14--4A14cros14--4)4[14 Activated 4]
  ...$iif(%acros == OFF,$style(1)) --( Off )--:set %acros OFF | echo -a 4(14--4S14ass4IRC14--4)4(14--4A14cros14--4)4[14 DeActivated 4]
  ...--( Customise )--:dialog $iif($dialog(my.acros),-v,-dm) my.acros my.acros
  ..--( Color Text )--
  ...$iif(%inputcolor == 0,$style(1)) --( White )--:set %inputcolor 0
  ...$iif(%inputcolor == 1,$style(1)) --( Black )--:set %inputcolor 1
  ...$iif(%inputcolor == 2,$style(1)) --( Blue )--:set %inputcolor 2
  ...$iif(%inputcolor == 3,$style(1)) --( Green )--:set %inputcolor 3
  ...$iif(%inputcolor == 4,$style(1)) --( Light Red )--:set %inputcolor 4
  ...$iif(%inputcolor == 5,$style(1)) --( Brown )--:set %inputcolor 5
  ...$iif(%inputcolor == 6,$style(1)) --( Purple )--:set %inputcolor 6
  ...$iif(%inputcolor == 7,$style(1)) --( Orange )--:set %inputcolor 7
  ...$iif(%inputcolor == 8,$style(1)) --( Yellow )--:set %inputcolor 8
  ...$iif(%inputcolor == 9,$style(1)) --( Light Green )--:set %inputcolor 9
  ...$iif(%inputcolor == 10,$style(1)) --( Cyan )--:set %inputcolor 10
  ...$iif(%inputcolor == 11,$style(1)) --( Light Cyan )--:set %inputcolor 11
  ...$iif(%inputcolor == 12,$style(1)) --( Light Blue )--:set %inputcolor 12
  ...$iif(%inputcolor == 13,$style(1)) --( Pink )--:set %inputcolor 13
  ...$iif(%inputcolor == 14,$style(1)) --( Grey )--:set %inputcolor 14
  ...$iif(%inputcolor == 15,$style(1)) --( Light Grey )--:set %inputcolor 15
  ...-
  ...$iif(%text.colortext == ON,$style(1)) --( On )--:set %text.colortext ON | set %inputcolor 7 | echo -a 4(14--4S14ass4IRC14--4)4(14--4C14olor4T14ext14--4)4[14 Activated 4] 
  ...$iif(%text.colortext == $null,$style(1)) --( Off )--:unset %text.colortext | unset %inputcolor | echo -a 4(14--4S14ass4IRC14--4)4(14--4C14olor4T14ext14--4)4[14 DeActivated 4] 
  -
}

/*  
DIALOGS 
*/

dialog my.acros {
  title "my.acros"
  size -1 -1 200 110
  option dbu
  button "Acros ON", 11, 50 95 40 10
  button "Acros OFF", 12, 110 95 40 10
  text "", 1, 5 5 90 8 
  edit "", 2, 5 15 90 10, autohs
  button "Add", 3, 5 25 45 10
  button "Preview", 4, 50 25 45 10
  list 5, 5 35 90 60, 
  text "", 6, 105 5 90 8 
  edit "", 7, 105 15 90 10, autohs
  button "Add", 8, 105 25 45 10
  button "Preview", 9, 150 25 45 10
  list 10, 105 35 90 60
}
on *:dialog:my.acros:*:*: {
  var %a = $dname, %b = $devent, %c = $did
  if (%b == init) { fill.my.acros }
  if (%b == sclick) {
    if (%c == 11) { set %acros ON | echo -a 4(14--4S14ass14--4)4(14--4A14cros14--4)4[14 Activated 4] }
    if (%c == 12) { set %acros OFF | echo -a 4(14--4S14ass14--4)4(14--4A14cros14--4)4[14 DeActivated 4] }
    if (%c == 3) { write myacros1.txt $did(my.acros,2) | did -r my.acros 5,10 | fill.my.acros | did -r my.acros 1,2, | did -c my.acros 5 $did(my.acros,5).lines }
    if (%c == 4) { echo -a $did(my.acros,2) }
    if (%c == 5) { did -ra my.acros 1 $did(my.acros,5).seltext | did -ra my.acros 2 $did(my.acros,5).seltext } 
    if (%c == 8) { write myacros2.txt $did(my.acros,7) $+  | did -r my.acros 5,10 | fill.my.acros | did -r my.acros 6,7 | did -c my.acros 10 $did(my.acros,10).lines }
    if (%c == 9) { echo -a $did(my.acros,7) }
    if (%c == 10) { did -ra my.acros 6 $did(my.acros,10).seltext | did -ra my.acros 7 $did(my.acros,10).seltext }
  }
  if (%b == edit) {
    if (%c == 2) { did -ra my.acros 1 $did(my.acros,2) | did -t my.acros 3 }
    if (%c == 7) { did -ra my.acros 6 $strip($did(my.acros,7)) | did -t my.acros 8 }
  }
}
dialog my.themes {
  title "My Themes"
  size -1 -1 200 110
  option dbu
  button "Themes ON", 11, 50 95 40 10
  button "Themes OFF", 12, 110 95 40 10
  text "", 1, 5 5 90 8 
  edit "", 2, 5 15 90 10, autohs
  button "Add", 3, 5 25 45 10
  button "Preview", 4, 50 25 45 10
  list 5, 5 35 90 60
  text "", 6, 105 5 90 8 
  edit "", 7, 105 15 90 10, autohs
  button "Add", 8, 105 25 45 10
  button "Preview", 9, 150 25 45 10
  list 10, 105 35 90 60
}
on *:dialog:my.themes:*:*: {
  var %a = $dname, %b = $devent, %c = $did
  if (%b == init) { fill.my.themes }
  if (%b == sclick) {
    if (%c == 11) { set %messagethemes OFF | set %custommessagethemes ON | set %theme1 $did(my.themes,2) | set %theme2 $did(my.themes,7) | echo -a 4(14--4S14ass4IRC14--4)4(14--4C14ustom4T14heme14--4)4[14 Activated 4] }
    if (%c == 12) { set %custommessagethemes OFF | echo -a 4(14--4S14ass4IRC14--4)4(14--4C14ustom4T14heme14--4)4[14 DeActivated 4] }
    if (%c == 3) { write mythemes1.txt $did(my.themes,2) $+  | did -r my.themes 5,10 | fill.my.themes | did -r my.themes 1,2, | did -c my.themes 5 $did(my.themes,5).lines }
    if (%c == 4) { echo -a $did(my.themes,2) }
    if (%c == 5) { did -ra my.themes 1 $did(my.themes,5).seltext | did -ra my.themes 2 $did(my.themes,5).seltext } 
    if (%c == 8) { write mythemes2.txt $did(my.themes,7) $+  | did -r my.themes 5,10 | fill.my.themes | did -r my.themes 6,7 | did -c my.themes 10 $did(my.themes,10).lines }
    if (%c == 9) { echo -a $did(my.themes,7) }
    if (%c == 10) { did -ra my.themes 6 $did(my.themes,10).seltext | did -ra my.themes 7 $did(my.themes,10).seltext }
  }
  if (%b == edit) {
    if (%c == 2) { did -ra my.themes 1 $did(my.themes,2) | did -t my.themes 3 }
    if (%c == 7) { did -ra my.themes 6 $did(my.themes,7) | did -t my.themes 8 }
  }
}

/* 
ALIASES 
*/

alias fill.my.acros {
  var %a = 1
  var %b = $lines(myacros1.txt)
  while %a <= %b { 
    did -a my.acros 5 $read(myacros1.txt, %a) 
    did -a my.acros 10 $read(myacros2.txt, %a) 
    inc %a 
    did -z my.acros 5,10
  }
}
alias fill.my.themes {
  var %a = 1
  var %b = $lines(mythemes1.txt)
  while %a <= %b { 
    did -a my.themes 5 $read(mythemes1.txt, %a) 
    did -a my.themes 10 $read(mythemes2.txt, %a) 
    inc %a 
    did -z my.themes 5,10
  }
}

/* 
ON LOAD
*/

on *:load: {
  echo -a Thank you for using PuNkTuReD's Input themes.
  echo -a If you have any questions or suggestions, you can find PuNkTuReD on the following servers.
  echo -a IrCQNet irc.icq.com #The_Secret_Society
  echo -a SassNet sassirc.corruptcode.org #Help
  echo -a QuakeNet irc.quakenet.org #PuNkTuReD
}

Comments

Sign in to comment.
JoRdY   -  Mar 24, 2010

Its nice PuNkTureD.

 Respond  
PuNkTuReD   -  Mar 24, 2010

yes, because you have more than one, that is probably the problem.

 Respond  
Lenooox   -  Mar 24, 2010

yes i have some on :input:#:{ line in my remote
and i can use this script only
if im not have another on
:input:#:{ line?

 Respond  
PuNkTuReD   -  Mar 23, 2010

in another remote file

 Respond  
Lenooox   -  Mar 22, 2010

somewhere?

 Respond  
PuNkTuReD   -  Mar 22, 2010

you must have another "on input" event in your scripts, somewhere.

 Respond  
Lenooox   -  Mar 22, 2010

o.O i tried your script but i got duplicated messages :(

(14:11:03) (@Lenoox) test
(14:11:03) (@Lenoox) test

 Respond  
Lenooox   -  Jan 24, 2010

i tried to change
(line 41) halt to haltdef
but nothing

 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.