Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. on *:input:*: {
  2. if ( ( $left($1,1) != / ) || ( $1 == /me ) ) {
  3. ;
  4. ; Quick Input check, if under 400 characters, don't bother
  5. var %textlen = $len($1-)
  6. ;
  7. if (%textlen > 400) {
  8. ;
  9. var %pos = 1
  10. var %text = $mid($1-, %pos, 400)
  11. var %firsttime = 1
  12. ;
  13. while ( %text != $null ) {
  14. ;
  15. ; Try to cut at the last word but if the last word is too long
  16. ; then just crop in the middle and be done with it.
  17. ;
  18. if ( $len($deltok(%text, -1, 32)) < 370 ) {
  19. %text = $left(%text, 370)
  20. inc %pos 370
  21. }
  22. else {
  23. %text = $deltok(%text,-1,32)
  24. inc %pos $len(%text)
  25. inc %pos
  26. }
  27. ;
  28. ; Store the outgoing text, and figure if this is the last
  29. ; batch of text we're sending, to see if we need to end it.
  30. ;
  31. var %outtext = %text
  32. %text = $mid($1-, %pos, 400)
  33. ;
  34. ; If this is the first batch of text, figure on what to do
  35. ;
  36. if (%firsttime == 1) {
  37. if ($gettok(%outtext, 1, 32) == /me) {
  38. ; This is a me command, treat it as such
  39. %outtext
  40. }
  41. else {
  42. ; Regular plain text being sent.
  43. say %outtext
  44. }
  45. ;
  46. %firsttime = 0;
  47. }
  48. else {
  49. ;
  50. ; Not the first, we're in the middle or end now.
  51. ;
  52. if (%text != $null) {
  53. ; This is only a fragment of a statement.
  54. say %outtext
  55. }
  56. else {
  57. if (%textlen <= 945) {
  58. ; If this is is it, mark the end flag
  59. say %outtext
  60. }
  61. else {
  62. ; Input is empty, but the user may not be done.
  63. say %outtext
  64. }
  65. }
  66. }
  67. }
  68. ;
  69. ; Prevent regular output from being sent to the server
  70. ;
  71. halt
  72. }
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement