08-18-2019, 14:46 +0200
Search result (2)
All posts by: GM
AuthorPost
Topic: Keepout Script Error   Forum: workimminent problem solving      Goto post
GM  10-22-2005, 18:42
(Moderator)

Avatar

Member since 09/2004
2 Posts
You are editing someone elses script... and then making errors into it...
That's not very nice of you.
Or if the script doesn't work, then contact the author of it.
Topic: [EGG] Splitting long text into smaller parts for IRC output   Forum: #tclcode snippets      Goto post
GM  09-04-2005, 19:01 | [EGG] Splitting long text into smaller parts for IRC output
(Moderator)

Avatar

Member since 09/2004
2 Posts
                                                                                                                              
01
02
03
04
05
06
07
08
09
10
11
12
proc longtextout {text} {
    set text [split [string map {\n " "} $text]]
    set curpos 0
    for {set x 1} {$x <= [llength $text]} {incr x} {
        if {[string length [join [lrange $text $curpos $x]]] > 400} {
            lappend curout [join [lrange $text $curpos [expr $x-1]]]
            set curpos $x
        }
    }
    if {$curpos != [expr [llength $text] - 1]} {lappend curout [join [lrange $text $curpos end]]}
    return $curout
}


This proc will take a long text as argument, and will return a list of lines to be sent..... it can be used for example like this:
                                                                                                                              
1
foreach curline [longtextout $mytext] {putmsg $chan $curline}

Where mytext contains the long text.
This post was edited 1 times, last on 08-14-2009, 03:28 by thommey
Go to forum
Unclassified NewsBoard 1.5.3-d | © 2003-4 by Yves Goergen | Time: 212.6 msec, CPU time: 84.1 msec, 35 Database queries in 85.8 msec | 3.5 kB (16.4 kB) | Timezone: +0200