Question

I'm now using this code to copy a section in the text. I want to change the code so that it copys the whole text between 2 tags.

Example -> this text copy <- (copy just between -> and <-)

The code now is

ON *:TEXT:*->*:*: {
  if ($nick == Nickname) {
    /msg $chan $$9
  }
}

This wil just copy the 9th, now i want it to get $- all text between -> <-

Was it helpful?

Solution

Instead of your current msg command, try the following command:

msg $chan $mid($1-, $calc($pos($1-, ->, 1) + 2), $calc($pos($1-, <-, $pos($1-, <-, 0)) - $pos($1-, ->, 1) - 2))

This line will take the first occurrence of -> and last occurence of <-, and message everything that's between them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top