Difference between revisions of "Cut Scripts"

From The Broken Dagger Wiki
Jump to: navigation, search
m
Line 8: Line 8:
 
  }
 
  }
 
  }
 
  }
 +
 +
 +
----
 +
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  }
 +
 +
 +
    /halt
 +
  }
 +
  
 
[[Category:Rules]]
 
[[Category:Rules]]
 
[[Category:Channel Rules]]
 
[[Category:Channel Rules]]
 
[[Category:Glossary (OOC)]]
 
[[Category:Glossary (OOC)]]

Revision as of 18:51, 8 August 2007

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))
}
}



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 {
   /halt 
 }