Cut Scripts

From The Broken Dagger Wiki
Revision as of 08:00, 13 July 2014 by BDAdmin (Talk | contribs)

Jump to: navigation, search

Cut Scripts are a term used for a small bit of code that automatically parse text to post multiple paragraphs in an IRC channel, if the text is too long. This is done because IRC limits the amount of text which may be posted to a channel in any one paragraph. Some players choose to circumvent this limit by means of scripts designed to place excess text into a post of its own. The use of such scripts is permitted in #Broken_Dagger and its associated channels, so long as they don't contradict our OOC rules by adding inappropriate symbols or colour to that text.

We recommend the following simple script for your use:

on 1:input:*: {
if ($len($1-) > 420) {
%cuttext = $remove($1-,$left($1-,420))
/timercut 1 1 /say �E�6 %cuttext
}
}



Or this not so simple one.

 on 1:input:*: { 
 if ($len($1-) > 420) { 
   { %pos = 420 
     :loop 
     if %pos < 390 goto end | 
     %chara = $mid($1-,%pos,1) 
     if $asc(%chara) == 32 goto end | 
     %pos = %pos - 1 
     goto loop 
     :end 
   } 
   %first = $left($1-,%pos - 1) 
   %cuttext = $remove($1-,%first) 
   %prefix = $left(%first,4) 
   %mtch = { /me  } 
   if (%prefix == %mtch) { %metxt = $remove(%first,%mtch) | /me %metxt } | /else { /say �E�6 %first } 
   /say �E�6 %cuttext 
   /halt 
 }