Alternate Cut Script

Useful items for all visitors - virus warnings, firewalls, IRC scripts etc

Moderators: Ehlanna, Twerlinger

Alternate Cut Script

Postby Ehlanna on Thu Mar 01, 2007 11:41 pm

The original code can be found here for reference

Code: Select all
;Text cutter/colorer
;Made to keep from 'over running' the irc text buffer.
;There is no commands for this script. On any /me statement containing certain quote formats, it will activate and color them acordingly
;The script also detects if the current channel has +c (colorban) and if it does, it turns the color featuer off.
;On any post longer then 420 characters, the script will chop the text at the closest space, then post the runoff a second later.
;
;The quote coloring works like this:
; ((text)) for out of character or OOC text
; [text] for 'AI' text
; for telepathic text
; "text" for normal speech text
; .oO( text ) for 'thought' bubble text (As requested by Draconia)
;
;
;I wrote this mostly for RolePlayers to stop the 'you got cut off' and such on IRC
;If you'd like more types of text quotes to be added, I can be contacted at nyghtwulf@gmail.com
;


on 1:input:*:{
;force script to only work with /me statements.
;if you would like to remove this restriction, comment out the following line,
;AND the marked line towards the end of this script
; if ($1 == /me) {

;this section turns the text coloring engine on and off.
;If you would like to do this manualy, comment out these lines
;and set %AutoFormatting to either 'ON' or 'OFF'

if (c isincs $chan($chan).mode) {
%AutoFormatting = OFF
}
else {
%AutoFormatting = ON
}

;-------------------------------------------------------------
;Settings for the text parser engine

; Modify %CutStyle to your liking.
%CutStyle = ...

;Modify %CStrailer to your liking.
%CStrailer = 6 ...

if ($mid(%AutoFormatting,1,1) != O) {
%AutoFormatting = ON
}

;The following sets colors and formatting for quoted text.
;Don't change the characters or things will look funny

%whisperTone = 13[

;telepath color set
%softTone = 5<

;normal speech color set
%normalTone = 10"

;OOC color setting
%loudTone = 1((

;Cloud Text
%cloudTone = 12.oO(

;sets colors off at end *DO NOT CHANGE*
%endTone = "6
%endTone2 = >6
%endTone3 = ]6
%endTone4 = ))6
%endtone5 = )6


; The following sets the search codes for automatic text coloring.
;DO NOT CHANGE BELOW THIS LINE!
;-----------------------------------------------------------------
%whisperQuote = [
%softQuote = <
%normalQuote = "
%loudQuote = ((
%cloudQuote = .oO(

%endquote = "
%endquote2 = >
%endquote3 = ]
%endquote4 = ))
%endquote5 = )

%n = 1
%act = 0
%cut = 0
%QEnc = 0
%codes = $chr(0)
%chr = $chr(0)

if (($mid($1,1,2) == 6) || ($mid($1,1,1) == ") || ($mid($1,2,1) == ")) {
%QEnc = 1
}

if ($1 == /me) {
%codes = $chr(3) $+ 6
%act = 1
%QEnc = 1
%len = 424 - $len($me)
}
else {
%act = 0
%len = 430 - $len($me)
}
if ($len($1-) > %len) {
%cut = 1
while (%chr != $chr(32)) {
%len = %len - 1
%chr = $mid($1-,%len,1)
}
%scantext = $left($1-,%len)
%lefttext = %scantext
%cuttext = $right($1-,$mid($1-,%len,0))
}
else {
%lefttext = $1-
}

if ((%AutoFormatting == ON) && (%QEnc == 1)) {
%scantext = $QuoteEncode(%scantext)
%lefttext = $QuoteEncode(%lefttext)
%cuttext = $QuoteEncode(%cuttext)
}

while (%n != 0) {
%n = $regsub(scan,%scantext,/([­]|d{1 $+ $chr(44) $+ 2} $+ $chr(44) $+ ?d?d?)/,$chr(0),%scantext)
%codes = %codes $+ $regml(scan,1)
}
if (%cut == 1) {
/timerCutScript 1 1 /say %CutStyle $+  $+ %codes %cuttext
%lefttext = %lefttext $+ %CSTrailer
}
if (%act == 1) {
/me $deltok(%lefttext,1,32)
/halt
}
else {
if ($mid(%lefttext,1,1) != /) {
/say %lefttext
/halt
}
}
}
;comment out the following one line to allow the script to act on all text that is inputed
;}

alias QuoteEncode {
%CSQtext = $1-
%CSQtext = $replace(%CSQtext,$chr(32) $+ %whisperQuote,$chr(32) $+ %whisperTone)
%CSQtext = $replace(%CSQtext,$chr(32) $+ %softQuote,$chr(32) $+ %softTone)
%CSQtext = $replace(%CSQtext,$chr(32) $+ %normalQuote,$chr(32) $+ %normalTone)
%CSQtext = $replace(%CSQtext,$chr(32) $+ %loudQuote,$chr(32) $+ %loudTone)
%CSQtext = $replace(%CSQtext,$chr(32) $+ %CLoudQuote,$chr(32) $+ %cloudTone)

%CSQtext = $replace(%CSQtext,%endQuote $+ $chr(32),%endTone $+ $chr(32))
%CSQtext = $replace(%CSQtext,%endQuote2 $+ $chr(32),%endTone2 $+ $chr(32))
%CSQtext = $replace(%CSQtext,%endQuote3 $+ $chr(32),%endTone3 $+ $chr(32))
%CSQtext = $replace(%CSQtext,%endQuote4 $+ $chr(32),%endTone4 $+ $chr(32))
%CSQtext = $replace(%CSQtext,%endQuote5 $+ $chr(32),%endTone5 $+ $chr(32))
/return %CSQtext
}
User avatar
Ehlanna
High Council
High Council
 
Posts: 2494
Joined: Sat Apr 09, 2005 9:23 pm

Re: Alternate Cut Script

Postby Kerianna on Fri Aug 20, 2010 8:33 am

I was loving this script for its auto-speech-coloration...but it doesn't work with the new 7.1 mirc client (since it integrated cutscript ability, none of the cutscripts work...of course, only this one does the coloring to make that matter).

I don't suppose anyone knows how to alter it to be just a colorer> Or for that matter, how to script a speech colorer? I've been trying to no avail...
User avatar
Kerianna
Moderator
Moderator
 
Posts: 77
Joined: Sun Feb 25, 2007 1:13 pm

Re: Alternate Cut Script

Postby Avarwraith on Fri Aug 20, 2010 11:50 am

I don't know how to edit scripts, Keri my darling. But I, personally, really dislike not being able to see my cuts. I can have a habit of overcutting, and so not being able to see how much I am doing, makes it near impossible for me to moderate my posts at all.

So, what I did, and what I suggest to you, is to go into:

Options -> IRC -> Messages


And take the check out of the box labled :

Split long channel/query messages


If you do this, then you can keep your personal cut script up without messing up the layout of your posts (the weird double cut effect that a lot of people show). Thus, problem solved!

Hope this helps,

Ava
Image
User avatar
Avarwraith
Predominate
Predominate
 
Posts: 252
Joined: Sun Mar 11, 2007 6:17 pm

Re: Alternate Cut Script

Postby Ehlanna on Fri Aug 20, 2010 1:32 pm

Avarwraith wrote:I don't know how to edit scripts, Keri my darling. But I, personally, really dislike not being able to see my cuts. I can have a habit of overcutting, and so not being able to see how much I am doing, makes it near impossible for me to moderate my posts at all.

So, what I did, and what I suggest to you, is to go into:

Options -> IRC -> Messages


And take the check out of the box labled :

Split long channel/query messages


If you do this, then you can keep your personal cut script up without messing up the layout of your posts (the weird double cut effect that a lot of people show). Thus, problem solved!

Hope this helps,

Ava


I use the 'other' cut script (the simpler variant) and had just this issue. Initially I was happy that mIRC would do it all for me, then I realised that enabling the in-built function (as funky as it may be) also disabled the alarm when you have typed in a buffers worth of text. I prefer the annoying little *ting* to tell me it is about time to wrap up the post ...
User avatar
Ehlanna
High Council
High Council
 
Posts: 2494
Joined: Sat Apr 09, 2005 9:23 pm

Re: Alternate Cut Script

Postby Kerianna on Fri Aug 20, 2010 9:48 pm

Ah, ok. Thanks. ^_^

I don't really like the binging myself, but I type all my posts into a word processor and then paste them over anyway, so it only dings at me once or twice usually. And I suppose it helps that I tend to play in less-populated channels where I don't have to worry about the post length. >_> <_<
User avatar
Kerianna
Moderator
Moderator
 
Posts: 77
Joined: Sun Feb 25, 2007 1:13 pm

Re: Alternate Cut Script

Postby Thria on Mon Aug 30, 2010 10:44 pm

That's one way around it, yes.

A standard colorizer.... (pulls code out of her head)
(To change the color... change the value of %color in line 2).

EDIT: Fixed a major issue involving other commands. Please use the updated code below!!!!

Code: Select all
ON 1:INPUT:*:{
  var %color = 2
  var %num = 1
  var %out = $1-
  :loop
  if ($pos(%out,",%num) != $null) {
    if ($calc(%num % 2) == 1) {
      %out = $left(%out,$calc($pos(%out,",%num) - 1)) $+  $+ %color $+ " $+ $right(%out,$calc($pos(%out,",%num) * -1))
    }
    else {
      %out = $left(%out,$calc($pos(%out,",%num) - 1)) $+ " $+  $+ $right(%out,$calc($pos(%out,",%num) * -1))
    }
    inc %num 1
    goto loop
  }
  if ($1 == /me) {
    action $right(%out,-4)
  }
  else if ($left($1,1) == /) {
    $1-
  }
  else {
    say %out
  }
  halt
}
Thria
Adept
Adept
 
Posts: 65
Joined: Sun Oct 15, 2006 8:49 pm

Re: Alternate Cut Script

Postby Kerianna on Tue Aug 31, 2010 1:05 am

Thria wrote:That's one way around it, yes.

A standard colorizer.... (pulls code out of her head)
(To change the color... change the value of %color in line 2).

EDIT: Fixed a major issue involving other commands. Please use the updated code below!!!!


*squees* Awesome! Thanks so much. ^_^
User avatar
Kerianna
Moderator
Moderator
 
Posts: 77
Joined: Sun Feb 25, 2007 1:13 pm


Return to Public Service

Who is online

Users browsing this forum: No registered users and 1 guest