;
;
; Input is not sent to channel until you press - (minus) on its own on a line
;
; I played with using $ctrlenter as the despooler trigger, but it was effected by ctrl-v inserts to the line, setting it off if the line exceeded the input buffer length.
;
;
on *:input:*:{
;
;
; only acts on input from a channel and not if it starts with a / unless its a /me
;
;
if ( $chan != $null ) && ( ( $left($1,1) != / ) || ( $1 == /me ) ) {
;
var %cid.chan = $+($cid,.,$chan)
;
if ( $hget( [ $+(Input.Buffer.,%cid.chan) ] ,0 ).item == 0 ) {
hfree -w [ $+(Input.Buffer.,%cid.chan) ]
hmake [ $+(Input.Buffer.,%cid.chan) ]
}
;
;
; Input Spooler
;
;
if ( $1- != - ) {
var %count = $hget( [ $+(Input.Buffer.,%cid.chan) ] ,0).item
var %pos = 1
var %text = $mid($1-,%pos,400)
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
}
inc %count
hadd [ $+(Input.Buffer.,%cid.chan) ] %count %text
;
var %text = $mid($1-,%pos,400)
}
}
;
;
; Input Despooler
;
;
else {
;
if ($gettok($hget( [ $+(Input.Buffer.,%cid.chan) ] , 1),1,32) == /me ) {
var %describe = $true
hadd [ $+(Input.Buffer.,%cid.chan) ] 1 $gettok($hget( [ $+(Input.Buffer.,%cid.chan) ] , 1),2-,32)
}
else {
var %describe = $false
}
;
var %count = 1
var %total = $hget( [ $+(Input.Buffer.,%cid.chan) ] ,0).item
;
while (%count <= %total ) {
;
;
;$iif((%describe = $true),describe,msg) $chan $iif((%count > 1),<-cont->) $hget( [ $+(Input.Buffer.,%cid.chan) ] , %count) $iif((%count < %total),<-next->,<-end->)
;^ above remarked as it would flood me off the irc server
;
.timer 1 %count $iif((%describe = $true),describe,msg) $chan $iif((%count > 1),<-cont->) $hget( [ $+(Input.Buffer.,%cid.chan) ] , %count) $iif((%count < %total),<-next->,<-end->)
;^ above timer used instead to timer the messages out.
;
;
%describe = $false
inc %count
}
hfree -w [ $+(Input.Buffer.,%cid.chan) ]
}
;
;
; Spooled or Despooled halt the original text
;
;
halt
}
}