Author Topic: Split Message Script  (Read 5550 times)

Cerulean

  • Newbie
  • *
  • Posts: 2
Split Message Script
« on: August 27, 2008, 04:33:37 PM »
Does anyone happen to have a script that will allow a very long post in chat to continue into a second post instead of just being cut off? For example, if you type a paragraph or so in a chat room it just cuts at a certain point when you post it. Some IRCs have the ability to allow the part of the post that got cut off to continue on the next line. I hope that made sense. heh

Any help would be greatly appreciated. Thank you.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Split Message Script
« Reply #1 on: August 27, 2008, 04:46:51 PM »
Just set the 'SizeLimit=' line to how many characters you want it to split at.
Save it as an IceChat 5 (*.ice) style script.

Code: [Select]
Dim SizeLimit
SizeLimit=150

Function OUTTEXT(OutgoingText)
if Len(OutGoingText) > SizeLimit then
    do     
        msg = left(OutGoingText,SizeLimit)
        SendCommand msg
        OutGoingText = mid(OutGoingText,SizeLimit+1)
    loop while Len(OutGoingText) > 0   
else
    OUTTEXT = OutGoingText
end if
End Function
The IceChat God

Cerulean

  • Newbie
  • *
  • Posts: 2
Re: Split Message Script
« Reply #2 on: August 28, 2008, 04:04:35 AM »
Thank you very much. I really appreciate the help. Now I just need to read up on how to add this. heh (Sorry if I seem noobish. I'm new to Ice Chat. Been using Pirch for years but a few weeks ago it just stopped working and I can't figure out why. Just freezes when I click the login button.) Anyway, Ice Chat is the best IRC I've found since then so I'll be sticking with it. Thanks again.

C.

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: Split Message Script
« Reply #3 on: January 30, 2009, 10:45:48 AM »
I've modified this script some, to split at the last space if possible, thus to preserve words / links.

Code: [Select]
Dim SizeLimit
SizeLimit=350

Function OUTTEXT(OutgoingText)
if Len(OutGoingText) > SizeLimit then
    do     
        search = left(OutgoingText,SizeLimit)
        if len(OutgoingText) > sizelimit and instr(search, " ") then
          splitpos = instrrev(search, " ")
          Msg = left(OutgoingText, splitpos)
          OutgoingText = Mid(OutgoingText,splitpos+1)
        else
          msg = left(OutgoingText, sizelimit)
          OutgoingText = mid(OutgoingText, sizelimit+1)
        end if
    SendCommand msg
    loop while len(OutgoingText) > 0
else
    OUTTEXT = OutGoingText
end if
End Function
This message brought to you by the Wonderful Wizard of Oz.

Sally Abravanel

  • Guest
Re: Split Message Script
« Reply #4 on: August 30, 2010, 02:19:28 AM »
Thank you, both!