Difference between revisions of "CMud Note Alias"

From AvatarWiki
Jump to navigation Jump to search
(Created page with "This is a script for those of you tired of seeing the "80 character" max issue. Basically you can just type "noteline" and an entire message and it will automatically split it i...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
This is a script for those of you tired of seeing the "80 character" max issue.  Basically you can just type "noteline" and an entire message and it will automatically split it into lines of 80 characters or less and send note + those lines.
 
This is a script for those of you tired of seeing the "80 character" max issue.  Basically you can just type "noteline" and an entire message and it will automatically split it into lines of 80 characters or less and send note + those lines.
 +
 +
Note sure if this is gonna work off copy/paste so I've uploaded a txt file here: [[http://avatar.melanarchy.info/images/b/bd/Noteline.txt]]
  
 
<pre>
 
<pre>
Line 22: Line 24:
 
</pre>
 
</pre>
  
[[Category:CMud Scripting]]
+
[[Category:Cmud Scripting]]

Latest revision as of 11:26, 1 October 2013

This is a script for those of you tired of seeing the "80 character" max issue. Basically you can just type "noteline" and an entire message and it will automatically split it into lines of 80 characters or less and send note + those lines.

Note sure if this is gonna work off copy/paste so I've uploaded a txt file here: [[1]]

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="noteline" copy="yes">
    <value>#var thelinevar {%-1}
#var templinevar {%replace( @thelinevar, " ", "=")}
#var linespam ""
#var lineword ""
#var thelinecount 0
#loop 1,%numwords( @templinevar, "=") {
  #var lineword %word( %replace( @templinevar, "=", " "), %i)
  #echo @lineword
  #if %eval( %len( @linespam)+%len( @lineword))>=80 {note + @linespam
  #var linespam @lineword} {#var linespam %trimleft(%concat(@linespam," ",@lineword))}
  }
#if @linespam="" {} {note + @linespam
#var linespam ""}</value>
  </alias>
</cmud>