Cut Script Color Preservation - 09/10/06 04:30 AM
Hello all! I won't lie to everyone, I thiefed this script from a website using dogpile and google Now I see it, and I compare it with another one and... wait, let me just get to the point instead of the story
--
Here is a script that handles cuts. If you RP a lot and need a better cut script, this one ROCKS! Only problem, it doesn't preserve colors through the cuts. Below I'm posting both one that handles color preservation, and the one that rocks but doesn't preserve colors. Any and all help will be thanked in cookies and stuff! If you can figure it out, rest assured I have a whole horde of people who'd thank you as well since no REAL good cut script that does everything exists as far as I know!
--
THIS SCRIPT MAINTAINS COLORS - but does an awful job at actually showing posts. The first post shows everything, and if it goes beyond two posts it does nada. Part one of my all-elusive suepr-script
======
on 1:input:*: {
%textcut = 21 | %actioncut = 26 | %cutat = 425 | %nicklen = $len($$me) | %length = $len($1-)
if ($left($1,1) = / ) { %length = %length - $len($1)
; Next line might need additional commands ?
if ($1 = /me ) || ($1 = /action ) { %length = %length + 7 | %textcut = %actioncut }
; Prevent cut for "unseen" commands eg a long /alias (may need extra commands?)
elseif ($1 != /say ) { goto end }
}
%cutit = %length + %nicklen
if (%cutit > %cutat) { %cutlen = %cutit - %cutat | %word = $0 | inc %word | %cuttext = ""
:loop
dec %word
if (%word > 0) && ($len(%cuttext) < %cutlen) { %ins = $gettok($1-,%word,32) | %cuttext = $instok(%cuttext,%ins,1,32) | goto loop }
%lastcolour = $null | %leftlen = 0 - $len(%cuttext) | %lefttext = $left($1-,%leftlen)
:colour
%lastcolourn = $pos(%lefttext,,0)
if ( %lastcolourn > 0 ) { %lastcolourp = $pos(%lefttext,,%lastcolourn) | %lastcolour = $mid(%lefttext,%lastcolourp,6) | %comma = ,
if ( $pos(%lastcolour,%comma,0) != 1) { %lastcolour = $left(%lastcolour,3) }
elseif ( $pos(%lastcolour,%comma,1) != 3 ) && ( $pos(%lastcolour,%comma,1) != 4) { %lastcolour = $left(%lastcolour,3) }
:colloop
if ($mid(%lastcolour,2,1) !isnum) { %lastcolour = $right(%textcut,2) }
if ( $right(%lastcolour,1) !isnum ) { %leng = $len(%lastcolour) | dec %leng | %lastcolour = $left(%lastcolour, %leng)
if ($len(%lastcolour) > 1) { goto colloop }
else ( dec %lastcolourp | %lefttext = $left(%lefttext,%lastcolourp) | goto colour }
}
/timerCut 1 1 /say %textcut $+ %lastcolour %cuttext
{
:end
}
}
=====
THIS SCRIPT HANDLES CUTS LIKE A GOD! This one will show you locally what others will see, and will continue on to three lines. Since mIRC has its limitation, the third cut is usually the final cut, and will not be neat about it. I honestly don't care about that, since I can just continue on a-posting.
====
on *:input:*: {
if ( ( $left($1,1) != / ) || ( $1 == /me ) ) {
var %next = ->
var %continue = <-
var %done = <>
var %more =
var %textlen = $len($1-)
if (%textlen > 400) {
var %pos = 1
var %text = $mid($1-, %pos, 400)
var %firsttime = 1
while ( %text != $null ) {
if ( $len($deltok(%text, -1, 32)) < 370 ) {
%text = $left(%text, 370)
inc %pos 370
}
else {
%text = $deltok(%text,-1,32)
inc %pos $len(%text)
inc %pos
}
var %outtext = %text
%text = $mid($1-, %pos, 400)
if (%firsttime == 1) {
if ($gettok(%outtext, 1, 32) == /me) {
%outtext %next
}
else {
say %outtext %next
}
%firsttime = 0;
}
else {
if (%text != $null) {
say %continue %outtext %next
}
else {
if (%textlen <= 999) {
say %continue %outtext %done
}
else {
say %continue %outtext %more
}
}
}
}
halt
}
=====
Again, any and all help will be appreciated!
--
Here is a script that handles cuts. If you RP a lot and need a better cut script, this one ROCKS! Only problem, it doesn't preserve colors through the cuts. Below I'm posting both one that handles color preservation, and the one that rocks but doesn't preserve colors. Any and all help will be thanked in cookies and stuff! If you can figure it out, rest assured I have a whole horde of people who'd thank you as well since no REAL good cut script that does everything exists as far as I know!
--
THIS SCRIPT MAINTAINS COLORS - but does an awful job at actually showing posts. The first post shows everything, and if it goes beyond two posts it does nada. Part one of my all-elusive suepr-script
======
on 1:input:*: {
%textcut = 21 | %actioncut = 26 | %cutat = 425 | %nicklen = $len($$me) | %length = $len($1-)
if ($left($1,1) = / ) { %length = %length - $len($1)
; Next line might need additional commands ?
if ($1 = /me ) || ($1 = /action ) { %length = %length + 7 | %textcut = %actioncut }
; Prevent cut for "unseen" commands eg a long /alias (may need extra commands?)
elseif ($1 != /say ) { goto end }
}
%cutit = %length + %nicklen
if (%cutit > %cutat) { %cutlen = %cutit - %cutat | %word = $0 | inc %word | %cuttext = ""
:loop
dec %word
if (%word > 0) && ($len(%cuttext) < %cutlen) { %ins = $gettok($1-,%word,32) | %cuttext = $instok(%cuttext,%ins,1,32) | goto loop }
%lastcolour = $null | %leftlen = 0 - $len(%cuttext) | %lefttext = $left($1-,%leftlen)
:colour
%lastcolourn = $pos(%lefttext,,0)
if ( %lastcolourn > 0 ) { %lastcolourp = $pos(%lefttext,,%lastcolourn) | %lastcolour = $mid(%lefttext,%lastcolourp,6) | %comma = ,
if ( $pos(%lastcolour,%comma,0) != 1) { %lastcolour = $left(%lastcolour,3) }
elseif ( $pos(%lastcolour,%comma,1) != 3 ) && ( $pos(%lastcolour,%comma,1) != 4) { %lastcolour = $left(%lastcolour,3) }
:colloop
if ($mid(%lastcolour,2,1) !isnum) { %lastcolour = $right(%textcut,2) }
if ( $right(%lastcolour,1) !isnum ) { %leng = $len(%lastcolour) | dec %leng | %lastcolour = $left(%lastcolour, %leng)
if ($len(%lastcolour) > 1) { goto colloop }
else ( dec %lastcolourp | %lefttext = $left(%lefttext,%lastcolourp) | goto colour }
}
/timerCut 1 1 /say %textcut $+ %lastcolour %cuttext
{
:end
}
}
=====
THIS SCRIPT HANDLES CUTS LIKE A GOD! This one will show you locally what others will see, and will continue on to three lines. Since mIRC has its limitation, the third cut is usually the final cut, and will not be neat about it. I honestly don't care about that, since I can just continue on a-posting.
====
on *:input:*: {
if ( ( $left($1,1) != / ) || ( $1 == /me ) ) {
var %next = ->
var %continue = <-
var %done = <>
var %more =
var %textlen = $len($1-)
if (%textlen > 400) {
var %pos = 1
var %text = $mid($1-, %pos, 400)
var %firsttime = 1
while ( %text != $null ) {
if ( $len($deltok(%text, -1, 32)) < 370 ) {
%text = $left(%text, 370)
inc %pos 370
}
else {
%text = $deltok(%text,-1,32)
inc %pos $len(%text)
inc %pos
}
var %outtext = %text
%text = $mid($1-, %pos, 400)
if (%firsttime == 1) {
if ($gettok(%outtext, 1, 32) == /me) {
%outtext %next
}
else {
say %outtext %next
}
%firsttime = 0;
}
else {
if (%text != $null) {
say %continue %outtext %next
}
else {
if (%textlen <= 999) {
say %continue %outtext %done
}
else {
say %continue %outtext %more
}
}
}
}
halt
}
=====
Again, any and all help will be appreciated!