Difference between revisions of "Cutscript"

From The Broken Dagger Wiki
Jump to: navigation, search
Line 1: Line 1:
 
A cutscript is a way to make IRC post more text than it will usually hold in its buffer.  This script will (possibly) only work in mIRC, and handles up to three posts worth of text.  Just put it into your Remote Scripts and load it.
 
A cutscript is a way to make IRC post more text than it will usually hold in its buffer.  This script will (possibly) only work in mIRC, and handles up to three posts worth of text.  Just put it into your Remote Scripts and load it.
  
----
+
on *:input:*: {
 
+
  if ( ( $left($1,1) != / ) || ( $1 == /me ) ) {
on *:input:*:
+
    var %next = -
if ( ( $left($1,1) != / ) || ( $1 == /me ) ) {
+
    var %continue = -
var %next = -
+
    var %done =  -|
var %continue = -
+
    var %more = -
var %done =  -|
+
    var %textlen = $len($1-)
var %more = -
+
    if (%textlen > 400) {
var %textlen = $len($1-)
+
      var %pos = 1
if (%textlen > 400) {
+
      var %text = $mid($1-, %pos, 400)
var %pos = 1
+
      var %firsttime = 1
var %text = $mid($1-, %pos, 400)
+
      while ( %text != $null ) {
var %firsttime = 1
+
        if ( $len($deltok(%text, -1, 32)) < 370 ) {
while ( %text != $null ) {
+
          %text = $left(%text, 370)
if ( $len($deltok(%text, -1, 32)) < 370 ) {
+
          inc %pos 370
%text = $left(%text, 370)
+
        }
inc %pos 370
+
        else {
}
+
          %text = $deltok(%text,-1,32)
else {
+
          inc %pos $len(%text)
%text = $deltok(%text,-1,32)
+
          inc %pos
inc %pos $len(%text)
+
        }
inc %pos
+
        var %outtext = %text
}
+
        %text = $mid($1-, %pos, 400)
var %outtext = %text
+
        if (%firsttime == 1) {
%text = $mid($1-, %pos, 400)
+
          if ($gettok(%outtext, 1, 32) == /me) {
if (%firsttime == 1) {
+
            %outtext %next
if ($gettok(%outtext, 1, 32) == /me) {
+
          }
%outtext %next
+
          else {
}
+
            say %outtext %next
else {
+
          }
say %outtext %next
+
          %firsttime = 0;
}
+
        }
%firsttime = 0;
+
        else {
}
+
          if (%text != $null) {
else {
+
            say %continue %outtext %next
if (%text != $null) {
+
          }
say %continue %outtext %next
+
          else {
}
+
            if (%textlen <= 945) {
if (%textlen <= 945) {
+
              say %continue %outtext %done
say %continue %outtext %done
+
            }
}
+
            else {
else {
+
              say %continue %outtext %more
say %continue %outtext %more
+
            }
}
+
          }
}
+
        }
}
+
      }
}
+
      halt
halt
+
    }
}
+
  }
 
}
 
}

Revision as of 23:22, 23 April 2008

A cutscript is a way to make IRC post more text than it will usually hold in its buffer. This script will (possibly) only work in mIRC, and handles up to three posts worth of text. Just put it into your Remote Scripts and load it.

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 <= 945) {
             say %continue %outtext %done
           }
           else {
             say %continue %outtext %more
           }
         }
       }
     }
     halt
   }
 }

}