Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; --------------------------------------------------------------
- ; ----------Gummo's Colour Script v4.6.2-------------
- ;----------EDITED A little by Spanky(Spencer)-----
- ; -------------------------V2-------------------------------
- #gum.colour on
- on *:input:*: {
- ; Don't try to do anything if user typed a command or pasted a lot of text (or pressed ctrl+enter, see below)
- if (/* iswm $1) || ($inpaste) return
- elseif ($ctrlenter) {
- ; Allow easy setting of modes (if enabled). +/- modes with ctrl+enter will set them in a channel. Arguments allowed.
- if (%gum.colour.easymodes) && ($me ison $target) && ($regex($1-,/^(?:[+-][a-z]+)+/i)) {
- mode $target $1-
- haltdef
- }
- return
- }
- ; used so you can do !op !deop etc etc feel free to delete this line if you don't want/need it
- if (!* iswm $1) return
- ; Don't colour messages in certain rooms to avoid annoying people and/or to your preference. This line is optional.
- if ($istok(#Staff #Oper #Opers #Services #Services-Log #Log #Support #Appeals #Abuse,$target,32)) return
- ; Stop the script if the channel blocks coloured messages (channel mode +c)
- ; Note the $gettok since 'c' can exist in one of the arguments. I've had trouble with that previously.
- if (c isincs $gettok($chan($target).mode,1,32)) return
- ; Point of no return! We've stopped mIRC's default actions now, so we have to send the message.
- haltdef
- ; Don't edit the following four lines. They create temporary variables from the permanent ones for simplicity.
- var %bg %gum.colour.background, %txt $+ %gum.colour.text, %punc $+ %gum.colour.punctuation
- var %caps $+ %gum.colour.capitals, %nick $+ %gum.colour.nicknames
- var %punc2 $+ $base($right(%punc,-1),10,10,2), %punc3 $+(%punc,$chr(44),%bg)
- var %punc4 $+ %gum.colour.numbers
- var %gum.colour.channick $+ %gum.colour.channick
- var %gum.colour.chanops $+ %gum.colour.chanops
- var %gum.colour.chanbrac $+ %gum.colour.chanbrac
- var %gum.colour.pmnick $+ %gum.colour.pmnick
- var %gum.colour.pmbrac $+ %gum.colour.pmbrac
- var %gum.colour.achannick $+ %gum.colour.achannick
- var %gum.colour.achanops $+ %gum.colour.achanops
- var %gum.colour.achanbrac $+ %gum.colour.achanbrac
- var %gum.colour.apmnick $+ %gum.colour.apmnick
- var %gum.colour.apmbrac $+ %gum.colour.apmbrac
- var %gum.colour.brackets %gum.colour.brackets (
- var %gum.colour.brackets2 %gum.colour.brackets2 )
- ; Preparing various variables
- var %regex, %chanregex, %puncregex, %nicks, %chans, %chanlist, %i 1
- ; Tokenize the text instead of putting it in a variable, to avoid mIRC's variable evaluation for simple maths..
- tokenize 32 $remove($strip($1-,rc),)
- ; Create a list of channels to be matched in the text, escaped to prepare it for regex.
- while ($chan(%i)) {
- %chanlist = $+(%chanlist,|\Q,$v1,\E)
- inc %i
- }
- ; sorts out the emotions
- if (%gum.emoticon) tokenize 32 $regsubex($1-,/( $+ $c.ereg $+ |\?(?=[]})".?!:({[]| ['"]| |$))/gi,$replacecs(\1,x,×,X,×,s,§,S,§,D,Ð,d,Ð,p,Þ,P,þ,?,?,O,$c.rand.upper.o,o,$c.rand.lower.o,-,¬,>.<,[-.-]",$chr(41),$c.rand.hap,$chr(40),$c.rand.unhap,C,Ç,c,ç,U,Û,u,û,F,ƒ,f,ƒ))
- if (%gum.autoformat) && ($len($1-) > 1) && (!%me) tokenize 32 $regsubex($replacex($1-,dont,don't,w/ $+ $chr(32),$chr(32) $+ with,b/c,because),/(^[A-z]|(?<=[.?!:]\s)[A-z]|\bi\b)/g,$upper(\1)) $+ $iif($regex($1-,/^(?!['!?@.]).+(?<=[A-z0-9])(?<![]^_`\\[])$/),)
- ; All of the Acronyms
- if (%gum.acronym) tokenize 32 $replacexcs($1-,>.>,».»,<.<,«.«,LOl,-Laughing Out Loud-,BRB,-Be Right Back-,HB,-Hurry Back-,WB,-Welcome Back-,ILY,-I <3 You-,ROFLMAO,-Rolling On Floor Laughing My Ass Off-,LMAO,-Laughing My Ass Off-,ROFL,-Rolling On Floor Laughing-,BBL,-Be Back Later-,BBIAB,-Be Back In A Bit-,BBS,-Be Back Soon-,PMSL,-Pissing Myself Laughing-,TBH,-To Be Honest-,TYVM,-Thank You Very Much-,TTYL,-Talk To You Later-,TY,-Thank You-,YW,-You're Welcome-,OMG,-Oh My God-,ASAP,-As Soon As Possible-,AFAIK,-As Far As I Know-,AFK,-Away From Keyboard-,BBN,-Bye Bye Now-,ASL,-Age/Sex/Location-,IMCO,-In My Considered Opinion-,IMHO,-In My Humble Opinion-,IMO,-In My Opinion-,JK,-Just Kidding-,LMSO,-Laughing My Socks Off-,NP,-No Problem-,WYSIWYG,-What You See Is What You Get-,WTH,-What The Hell?!-,TMI,-Too Much Information-)
- ; Set the channel regular expression (for finding channels, both in channel and PM)
- %chanregex = /(?<=\s|[(,+%@&~?!]|(?<!\w)[])(?=#[^\s,+%@&~]{3})( $+ $right(%chanlist,-1) $+ )(?=[[:punct:]]*[\s,]|[](?!\w))/gi
- ; Set a slightly different nickname regular expression for queries as opposed to channels
- ; Queries only match you and the nick you PM, while channels match any possible nickname (and channel) to avoid big loops
- if ($query($target)) %regex = /(?<=\s|\s[[{]|(?<!\w)[]|[.,'"<(+%@&~/\\])(\Q $+ $me $+ \E|\Q $+ $target $+ \E)(?=[[:punct:]]*\s|['"/\\=*@.,]|[](?!\w))/gi
- elseif ($chan) %regex = /(?<=\s|(?<!\w)[]|[.,'"<(+%@&~/\\])(?!\d)([^-,./:-@~ ×÷]{3,})(?=[[:punct:]]*[\s,]|[/\\=*@.,]|['"](?=\S{3,}\s|[\s,])|[](?!\w))/gi
- ; Prepare the symbols/capitals/smileys regular expression (for simplicity later)
- %puncregex = /((?i:\b[OVUX][_.]+[OVUX]\b|[:;=][A-Z]\b|\b[A-Z][:;=]\B|\b(?:X[DOP]|[DOP]X)\b|[^A-Z\s])+|[A-Z]+)/g
- ; If we're not sending text to a PM or channel, exit
- else return
- ; Now we'll move the channels (all known) into a variable and put ctrl+o in their place (to avoid confusion with ctrl+r)
- tokenize 32 $mid($regsubex(chans,/ $1- /,$iif(%gum.colour.highlightchan,%chanregex,),),3,-2)
- ; A simple loop to move the matched channels into the %chans variable
- %i = 1
- while ($regml(chans,%i)) {
- %chans = %chans $v1
- inc %i
- }
- ; Now we'll move the nicknames into a variable (known and potential alike) and put a ctrl+r in their place
- tokenize 32 $mid($regsubex(nicks,/ $1- /,$iif(%gum.colour.highlightnick,%regex,),),3,-2)
- ; Another simple loop to move the matched nicknames into the %nicks variable
- %i = 1
- while ($regml(nicks,%i)) {
- %nicks = %nicks $v1
- inc %i
- }
- ; If we were sending to a channel, remove potential nicknames which don't exist in the channel (and put them back into the text)
- ; Modified to also cater for channel matches
- if ($chan) {
- var %nn, %n $numtok(%nicks,32)
- while (%n) {
- %nn = $gettok(%nicks,%n,32)
- if (%nn !ison $chan) && ($me !ison %nn) {
- tokenize 32 $regsubex($1-,//g,$iif(\n == %n,%nn,))
- %nicks = $deltok(%nicks,%n,32)
- }
- dec %n
- }
- }
- ; Now remove those pesky extra ctrl+r characters in %nicks
- %nicks = $remtok(%nicks,,0,32)
- ; Colour capital letters, emoticons and punctuation in one line since this negates a need for workarounds of any kind.
- if (%betaon) tokenize 32 $regsubex($1-,%puncregex,$+($iif(\1 isalpha && !$istok(XD.DX.XO.OX.XP.PX,\1,46),%caps,$iif($left(\1,1) isnum,%punc4,$iif($left(\1,1) == $chr(44) && $mid(\1,2,1) isnum,%punc2,%punc))),\1,%txt))
- ; Colour capital letters, emoticons and punctuation in one line since this negates a need for workarounds of any kind.
- if (%betaoff) tokenize 32 $regsubex($1-,%puncregex,$+($iif(\1 isalpha && !$istok(XD.DX.XO.OX.XP.PX,\1,46),%caps,$iif($left(\1,1) isnum,%punc2,$iif($left(\1,1) == $chr(44) && $mid(\1,2,1) isnum,%punc3,%punc))),\1,%txt))
- ; Loop through each channel, colouring it and putting it back in its original place
- if (%chans) tokenize 32 $regsubex($1-,//g,$+(%nick,$gettok(%chans,\n,32),%txt))
- ; Loop through each nickname, colouring it and putting it back in its original place
- if (%nicks) tokenize 32 $regsubex($1-,//g,$+(%nick,$gettok(%nicks,\n,32),%txt))
- ; Finalise colouring and remove unnecessary colours
- tokenize 32 $regsubex($+(%txt,$1-,),/(?:\d\d?(?:\x2C\d\d?)?)+/g,)
- tokenize 32 $regsubex($1-,/\d\d?(?:\x2C\d\d?)? /g,$chr(32) )
- while ($1- != $regsubex($1-,/(\d\d?)(?:\x2C\d\d?)?([^]+)(\d\d?)(?:\x2C\d\d?)?/g,$iif(\1 == \3,\1\2,\1\2\3))) tokenize 32 $v2
- ; Put the background colour at the start (minimise character use as much as possible, even though it's a lot of code for that)
- ; This prevents requiring two colour codes at the start for no reason
- ; Also added check to add bold character to the start (if applicable)
- tokenize 32 $regsubex($1-,/^(\d\d?)(?!\x2C\d)(?=(.))/,$+($iif(%gum.colour.bold,),,$base(\1,10,10,1),$chr(44),$iif(\2 isnum,$base(%bg,10,10,2),%bg)))
- ; Message to target change .msg to msg if you take off the themes
- echo $chan $timestamp $+(,,,%gum.colour.mechanbrac,,%gum.colour.mebrackets,,,%gum.colour.mechannick,$regsubex($iif($chan,$nick(#,$nick).pnick,$nick),/^([~&@%+])([~&@%+]*)/,$+(,,%gum.colour.mechanops,$replace(\1,$regml(2),$null),,,%gum.colour.mechannick)),,,%gum.colour.mechanbrac,%gum.colour.mebrackets2,) $+ $1-
- .msg $target $1-
- }
- ; Theme stuff
- on ^*:TEXT:*:?: {
- echo $nick $theme.text($nick, $address, $nick, $1-)
- haltdef
- }
- alias theme.text {
- return $timestamp $+ %gum.colour.pmbrac $+ %gum.colour.brackets $+ $+ %gum.colour.pmnick $+ $1 $+ $+ %gum.colour.pmbrac $+ %gum.colour.brackets2 $+ $4-
- }
- on ^*:action:*:?: {
- echo $nick $theme.act($nick, $address, $nick, $1-)
- haltdef
- }
- alias theme.act {
- return $timestamp $+ %gum.colour.apmbrac $+ %gum.colour.brackets $+ $+ %gum.colour.apmnick $+ $1 $+ $+ %gum.colour.apmbrac $+ %gum.colour.brackets2 $+ $4-
- }
- ON ^*:action:*:#:{
- echo $chan $timestamp $+(,,%gum.colour.achanbrac,%gum.colour.brackets,,,%gum.colour.achannick,$regsubex($iif($chan,$nick(#,$nick).pnick,$nick),/^([~&@%+])([~&@%+]*)/,$+(,,%gum.colour.achanops,$replace(\1,$regml(2),$null),,,%gum.colour.achannick)),,,%gum.colour.achanbrac,%gum.colour.brackets2,) $+ $1-
- haltdef
- }
- ON ^*:TEXT:*:#:{
- echo $chan $timestamp $+(,,%gum.colour.chanbrac,%gum.colour.brackets,,,%gum.colour.channick,$regsubex($iif($chan,$nick(#,$nick).pnick,$nick),/^([~&@%+])([~&@%+]*)/,$+(,,%gum.colour.chanops,$replace(\1,$regml(2),$null),,,%gum.colour.channick)),,,%gum.colour.chanbrac,%gum.colour.brackets2,) $+ $1-
- haltdef
- }
- #gum.colour end
- ; Creating the menu for the Script
- menu * {
- -
- Gummo Colour
- .$iif($group(#gum.colour).status == on,Disable,Enable) $+ : {
- $iif($group(#gum.colour).status == on,.disable,.enable) #gum.colour
- echo $color(info) -a Gummo's Colour Script is now $upper($group(#gum.colour).status) $+ .
- }
- .-
- .$iif(%gum.emoticon,$style(1)) Emoticons:$iif(%gum.emoticon,unset %gum.emoticon,set %gum.emoticon 1) | echo -a [Emotions turned $iif(%gum.emoticon,on,off) $+ .]
- .$iif(%betaon,$style(1)) Unstable Mode:$iif(%betaon,unset %betaon,set %betaon 1) | echo -a [Unstable Mode turned $iif(%betaon,on,off) $+ .]
- .$iif(%betaoff,$style(1)) Stable Mode:$iif(%betaoff,unset %betaoff,set %betaoff 1) | echo -a [Stable mode Turned $iif(%betaoff,on,off) $+ .]
- .$iif(%gum.autoformat,$style(1)) Automatic formatting:$iif(%gum.autoformat,unset %gum.autoformat,set %gum.autoformat 1) | echo -a [Automatic formatting turned $iif(%gum.autoformat,on,off) $+ .]
- .$iif(%gum.acronym,$style(1)) Acronyms:$iif(%gum.acronym,unset %gum.acronym,set %gum.acronym 1) | echo -a [Acronyms turned $iif(%gum.acronym,on,off) $+ .]
- .-
- ..$gum.colour.greyed Numbers
- ..$submenu($gum.colour.submenu(numbers,$1))
- .$gum.colour.greyed Background
- ..$submenu($gum.colour.submenu(background,$1))
- .$gum.colour.greyed Text
- ..$submenu($gum.colour.submenu(text,$1))
- .$gum.colour.greyed Punctuation
- ..$submenu($gum.colour.submenu(punctuation,$1))
- .$gum.colour.greyed Capitals
- ..$submenu($gum.colour.submenu(capitals,$1))
- .$gum.colour.greyed Nicknames
- ..$submenu($gum.colour.submenu(nicknames,$1))
- .-
- .$gum.colour.greyed Channel Brackets
- ..$submenu($gum.colour.submenu(chanbrac,$1))
- .$gum.colour.greyed Channel nick
- ..$submenu($gum.colour.submenu(channick,$1))
- .$gum.colour.greyed Channel Ops
- ..$submenu($gum.colour.submenu(chanops,$1))
- .$gum.colour.greyed Channel Brackets for you
- ..$submenu($gum.colour.submenu(mechanbrac,$1))
- .$gum.colour.greyed Channel nick for you
- ..$submenu($gum.colour.submenu(mechannick,$1))
- .$gum.colour.greyed Channel Ops for you
- ..$submenu($gum.colour.submenu(mechanops,$1))
- .$gum.colour.greyed PM bracket
- ..$submenu($gum.colour.submenu(pmbrac,$1))
- .$gum.colour.greyed pm nick
- ..$submenu($gum.colour.submenu(pmnick,$1))
- .$gum.colour.greyed action Channel Bracket
- ..$submenu($gum.colour.submenu(achanbrac,$1))
- .$gum.colour.greyed action Channel nick
- ..$submenu($gum.colour.submenu(achannick,$1))
- ..$submenu($gum.colour.submenu(achanops,$1))
- .$gum.colour.greyed action PM bracket
- ..$submenu($gum.colour.submenu(apmbrac,$1))
- .$gum.colour.greyed action pm nick
- ..$submenu($gum.colour.submenu(apmnick,$1))
- .-
- .First bracket:
- ....$iif($chr(40) iswm %gum.colour.brackets,$style(1)) (:set %gum.colour.brackets (
- ....$iif([ iswm %gum.colour.brackets,$style(1)) [:set %gum.colour.brackets [
- ....$iif(< iswm %gum.colour.brackets,$style(1)) <:set %gum.colour.brackets <
- .-
- .Second bracket:
- ....$iif($chr(41) iswm %gum.colour.brackets2,$style(1)) ):set %gum.colour.brackets2 )
- ....$iif(] iswm %gum.colour.brackets2,$style(1)) ]:set %gum.colour.brackets2 ]
- ....$iif(> iswm %gum.colour.brackets2,$style(1)) >:set %gum.colour.brackets2 >
- .-
- .First bracket for you:
- ....$iif($chr(40) iswm %gum.colour.brackets,$style(1)) (:set %gum.colour.brackets (
- ....$iif([ iswm %gum.colour.mebrackets,$style(1)) [:set %gum.colour.mebrackets [
- ....$iif(< iswm %gum.colour.mebrackets,$style(1)) <:set %gum.colour.mebrackets <
- .-
- .Second bracket for you:
- ....$iif($chr(41) iswm %gum.colour.mebrackets2,$style(1)) ):set %gum.colour.mebrackets2 )
- ....$iif(] iswm %gum.colour.mebrackets2,$style(1)) ]:set %gum.colour.mebrackets2 ]
- ....$iif(> iswm %gum.colour.mebrackets2,$style(1)) >:set %gum.colour.mebrackets2 >
- .-
- .$gum.colour.greyed(%gum.colour.easymodes) Easy Modes: {
- %gum.colour.easymodes = $iif(%gum.colour.easymodes,$false,$true)
- echo $color(info) -a Easy modes (typing a mode and then pressing ctrl+enter to set) are now $iif(%gum.colour.easymodes,enabled,disabled) $+ .
- }
- .$gum.colour.greyed(%gum.colour.highlightnick) Highlight Nicks: {
- %gum.colour.highlightnick = $iif(%gum.colour.highlightnick,$false,$true)
- echo $color(info) -a Nickname highlighting is now $iif(%gum.colour.highlightnick,enabled,disabled) $+ .
- }
- .$gum.colour.greyed(%gum.colour.highlightchan) Highlight Chans: {
- %gum.colour.highlightchan = $iif(%gum.colour.highlightchan,$false,$true)
- echo $color(info) -a Channel highlighting (as opposed to nickname highlighting) is now $iif(%gum.colour.highlightchan,enabled,disabled) $+ .
- }
- .$gum.colour.greyed(%gum.colour.bold) Bold Text: {
- %gum.colour.bold = $iif(%gum.colour.bold,$false,$true)
- echo $color(info) -a Bold text is now $iif(%gum.colour.bold,enabled,disabled) $+ .
- }
- .-
- .$gum.colour.greyed Presets
- ..$submenu($gum.colour.presetmenu($1))
- ..Delete preset:gum.colour.deletepreset
- .-
- .$gum.colour.greyed Reset to Defaults:if ($input(Are you really sure you want to reset to defaults? All of your current settings (other than presets) will be lost!,y,Reset to Defaults?)) gum.colour.reset -hard
- }
- ; Special submenu for selecting a colour to save time coding
- alias -l gum.colour.submenu {
- ; The alias will never call 0, so we make a workaround
- var %n $2 - 1
- var %cmd :set % $+ gum.colour. $+ $$1
- if (%n isnum 0-15) return $iif($(% $+ gum.colour. $+ $1,2) == %n,$style(1)) $colourname(%n) $+ %cmd %n
- ; We can't put 99 here or it wouldn't work, so we'll just pretend it's 16 :)
- if ($1 == background) && (%n == 16) return $iif(%gum.colour.background == 99,$style(1)) $colourname(99) $+ %cmd 99
- }
- ; Special submenu for sorted presets (from temporary list, created elsewhere
- alias gum.colour.presetmenu {
- if ($1 == 1) return Save As...:gum.colour.presetsave
- if ($1 == 2) return Refresh List:gum.colour.presetrefresh
- if ($1 == 3) return -
- if ($1 isnum) && ($gettok(%gum.colour.presetlist,$calc($1 - 3),44)) return $replace($v1,$chr(151),$chr(32)) $+ :gum.colour.presetload $v1
- }
- ; Simplify the menu a little by checking whether to grey-out and/or tick the options via simple maths
- alias -l gum.colour.greyed {
- var %x 0
- if ($group(#gum.colour).status != on) %x = %x + 2
- ; Allow for a tick when a variable was speficied and evaluated to $true
- if ($1 == $true) %x = %x + 1
- return $style(%x)
- }
- ; Alias to reset variables to defaults (hard setting replaces ALL variables, soft or unspecified only fixes variables)
- alias -l gum.colour.reset {
- var %forced $false
- if ($1 == -hard) %forced = $true
- if ((%gum.colour.background !isnum 0-15) && (%gum.colour.background != 99)) || (%forced) set %gum.colour.background 1
- if (%gum.colour.text !isnum 0-15) || (%forced) set %gum.colour.text 3
- if (%gum.colour.punctuation !isnum 0-15) || (%forced) set %gum.colour.punctuation 0
- if (%gum.colour.capitals !isnum 0-15) || (%forced) set %gum.colour.capitals 9
- if (%gum.colour.nicknames !isnum 0-15) || (%forced) set %gum.colour.nicknames 11
- if (%gum.colour.numbers !isnum 0-15) || (%forced) set %gum.colour.numbers 6
- if (%gum.colour.easymodes == $null) || (%forced) set %gum.colour.easymodes $true
- if (%gum.colour.highlightnick == $null) || (%forced) set %gum.colour.highlightnick $true
- if (%gum.colour.highlightchan == $null) || (%forced) set %gum.colour.highlightchan $true
- if (%gum.colour.bold == $null) || (%forced) set %gum.colour.bold $false
- if (%gum.colour.channick == $null) || (%forced) set %gum.colour.channick 7
- if (%gum.colour.chanops == $null) || (%forced) set %gum.colour.chanops 8
- if (%gum.colour.chanbrac == $null) || (%forced) set %gum.colour.chanbrac 4
- if (%gum.colour.mechannick == $null) || (%forced) set %gum.colour.mechannick 7
- if (%gum.colour.mechanops == $null) || (%forced) set %gum.colour.mechanops 8
- if (%gum.colour.mechanbrac == $null) || (%forced) set %gum.colour.mechanbrac 4
- if (%gum.colour.pmnick == $null) || (%forced) set %gum.colour.pmnick 7
- if (%gum.colour.pmbrac == $null) || (%forced) set %gum.colour.pmbrac 4
- if (%gum.colour.achannick == $null) || (%forced) set %gum.colour.achannick 13
- if (%gum.colour.achanops == $null) || (%forced) set %gum.colour.achanops 4
- if (%gum.colour.achanbrac == $null) || (%forced) set %gum.colour.achanbrac 6
- if (%gum.colour.apmnick == $null) || (%forced) set %gum.colour.apmnick 13
- if (%gum.colour.apmbrac == $null) || (%forced) set %gum.colour.apmbrac 6
- if (%gum.colour.brackets == $null) || (%forced) set %gum.colour.brackets (
- if (%gum.colour.brackets2 == $null) || (%forced) set %gum.colour.brackets2 )
- if (%gum.colour.mebrackets == $null) || (%forced) set %gum.colour.mebrackets (
- if (%gum.colour.mebrackets2 == $null) || (%forced) set %gum.colour.mebrackets2 )
- ; Refresh the preset colours list while we're at it
- gum.colour.presetrefresh
- ; If forced (hard reset), the user will expect to know
- if (%forced) echo $color(info) -a Gummo's Colour Script settings reset to defaults.
- }
- ; This alias will load the specified preset colours
- alias -l gum.colour.presetload {
- var %settings $readini(gum.colour.ini,Presets,$$1)
- var %names background,text,punctuation,capitals,nicknames,numbers,mebrackets2,mebrackets,brackets2,brackets,apmbrac,apmnick,achanbrac,achanops,achannick,pmnick,pmbrac,mechanbrac,mechanops,mechannick,chanbrac,chanops,channick
- var %i 1
- while ($gettok(%names,%i,44)) {
- set $+(%,gum.colour.,$v1) $gettok(%settings,%i,44)
- inc %i
- }
- ; Let the user know we just loaded a preset
- echo $color(info) -a Preset colour configuration $qt($replace($1,$chr(151),$chr(32))) loaded.
- }
- ; This alias will save the current colour configuration as a preset (with confirmation for over-write)
- alias -l gum.colour.presetsave {
- var %settings, %i 1
- var %names background,text,punctuation,capitals,nicknames,numbers,mechanbrac,mechanops,mechannick,mebrackets2,mebrackets,brackets2,brackets,apmbrac,apmnick,achanbrac,achanops,achannick,pmnick,pmbrac,chanbrac,chanops,channick
- var %name $input(Please enter a name to save for this colour preset:,e,Enter Preset Name)
- ; Replace spaces with a special dash (ASCII 151) to enable spaces in names and remove any commas for compatibility
- %name = $replace(%name,$chr(32),$chr(151),$chr(44),$null)
- if (%name) {
- ; Check for identical named colour preset
- if (!$readini(gum.colour.ini,Presets,%name)) || ($input(There is already a preset called $qt(%name) $+ . Do you want to over-write this preset?,y,Preset Already Exists)) {
- while ($gettok(%names,%i,44)) {
- %settings = $addtok(%settings,$($+(%,gum.colour.,$v1),2),44)
- inc %i
- }
- ; Write the data and let the user know (delete any existing entry first to enable case-sensitive renaming)
- remini gum.colour.ini Presets %name
- writeini gum.colour.ini Presets %name %settings
- echo $color(info) -a Preset colour configuration $qt(%name) saved.
- ; Refresh the presets list of it won't appear in there
- gum.colour.presetrefresh
- }
- }
- }
- ; This alias refreshes the list of presets (doing it as the menu opens is too intensive)
- alias -l gum.colour.presetrefresh {
- var %presets, %i
- %i = $ini(gum.colour.ini,Presets,0)
- while (%i) {
- %presets = $addtok(%presets,$ini(gum.colour.ini,Presets,%i),44)
- dec %i
- }
- ; Sort the list of presets for purely aesthetic purposes
- %presets = $sorttok(%presets,44,a)
- set %gum.colour.presetlist %presets
- }
- ; Use this $colourname alias as you wish; customise it such that it matches your colours 0-15.
- alias colourname {
- ; I know this could be done with a $gettok but then it would be harder to understand (and change, for that matter)
- var %ret
- if ($1 == 00) %ret = White
- if ($1 == 01) %ret = Black
- if ($1 == 02) %ret = Dark Blue
- if ($1 == 03) %ret = Dark Green
- if ($1 == 04) %ret = Red
- if ($1 == 05) %ret = Maroon
- if ($1 == 06) %ret = Purple
- if ($1 == 07) %ret = Orange
- if ($1 == 08) %ret = Yellow
- if ($1 == 09) %ret = Light Green
- if ($1 == 10) %ret = Teal
- if ($1 == 11) %ret = Light Blue
- if ($1 == 12) %ret = Blue
- if ($1 == 13) %ret = Pink
- if ($1 == 14) %ret = Dark Grey
- if ($1 == 15) %ret = Light Grey
- if ($1 == 99) %ret = No Background
- return %ret
- }
- ; This just says thanks when they load the script, obviously
- on *:load: {
- echo $color(info) -a ---
- echo $color(info) -a Thanks for using Gummo's Colour Script. :D
- echo $color(info) -a Right-click in a channel or PM to customise.
- echo $color(info) -a ---
- }
- ; Reset any missing variables upon startup ('soft' settings)
- on *:start: {
- gum.colour.reset -soft
- }
- on *:unload: {
- unset %gum.colour.*
- echo $color(info) -a ---
- echo $color(info) -a Thanks for using Gummo's Colour Script, sorry you want to remove it. :P
- echo $color(info) -a All variables related to this script have been removed.
- if ($isfile(gum.colour.ini)) {
- if ($input(The presets configuration file $chr(40) $+ gum.colour.ini $+ $chr(41) has not been deleted. Would you like to delete it?,y,Delete Presets?)) {
- .remove gum.colour.ini
- echo $color(info) -a Presets configuration file deleted.
- }
- else echo $color(info) -a Presets configuration file remains.
- }
- echo $color(info) -a ---
- }
- ; Emotion Aliases
- alias c.ereg return (?<=[]})"'.?!:({[]| ['"]| ||^)(?:[DX'O:;x=>][])<ZOPFSGDVX3:;\|=([](?<![ods][fosbvp])|[\Q0xcvuo-><\E][_,.']+[\Q0xcvuo-><\E]|\.o\.)(?=[]})"'.?!:({[]| ['"]| |$)
- alias c.rand.upper.o return $replace($rand(1,7),1,Ø,2,Ò,3,Ó,4,Ô,5,Õ,6,Ö,7,©)
- alias c.rand.lower.o return $replace($rand(1,9),1,ø,2,ò,3,ó,4,ô,5,õ,6,ö,7,ð,8,¤,9,º)
- alias c.rand.hap return $replace($rand(1,6),1,$chr(41),2,›,3,»,4,>,5,$chr(125),6,])
- alias c.rand.unhap return $replace($rand(1,7),1,$chr(40),2,‹,3,«,4,¢,5,<,6,$chr(123),7,[)
- ; Alias for the preset Deleter
- alias -l gum.colour.deletepreset {
- $input(Please enter a name to Delete this colour preset:,e,Enter Preset Name)
- remini gum.colour.ini Presets %name
- echo -a Done Deleted preset %name
- gum.colour.presetrefresh
Add Comment
Please, Sign In to add comment