[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  quick question
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

quick question

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Thu 10 Jun 2004 07:43 AM (UTC)  quote  ]
Message
trying to do an apendtonotepad thing here want it to do multiple lines not just one, like...

(Serpentlords): You say, "Ok i am starting to hate all this crap with cookies
and pies and cakes and candy its so not cool cookies rule!"

if i set it open using the script i get the first line, if i use the option to send to notepad i get nada, just a little help would be nice

Everything turns around in the end
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Thu 10 Jun 2004 08:11 AM (UTC)  quote  ]
Message
Whats your trigger? If you use, well, either way, you can only send at most, whatever your trigger is matching. The mud probably doesnt insert a newline, so its probably all one line (and your client is wrappning it), then you should be able to use just one trigger, if the mud is wrapping for you, things will get more complicated. Well, or you can use multiline triggers.

But, either way, you can only send what you match on. So the problem is probably with your trigger.
Feel free to post them here, we can help you out with the formalities.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Nick Gammon   Australia  (15,683 posts)  [Biography] bio
Date Thu 10 Jun 2004 09:18 PM (UTC)  quote  ]
Message
A multiple-line trigger may help here. If what you say is in quotes you can probably set one up without too much trouble.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Fri 11 Jun 2004 07:00 AM (UTC)  quote  ]
Message
<triggers>
<trigger
match="(Ashura): *"
send_to="12"
sequence="100"
>
<send>world.AppendToNotepad &quot;hi&quot;, &quot;%1&quot; + vbcrlf
</send>
</trigger>
</triggers>

thats the trigger and it only works for the first line.

Everything turns around in the end
[Go to top] top

Posted by Nick Gammon   Australia  (15,683 posts)  [Biography] bio
Date Fri 11 Jun 2004 11:07 PM (UTC)  quote  ]

Amended on Fri 11 Jun 2004 11:08 PM (UTC) by Nick Gammon

Message
Well, it was a little trickier than I expected to get right, but this should work.

First, make a script file if you don't have one already, and put this into it:


Sub OnChat (name, line, wildcards)
Dim msg
 
  msg = Split (wildcards (10), chr (10))

  For Each m In msg
    AppendToNotepad "Chats", m & vbCrLf
  Next

end Sub



The reason for this script is to split up the incoming line at line feeds, and append them to the notepad with a carriage-return/linefeed combination, otherwise the multiple lines appear as little black squares.

Next, paste in this trigger:


<triggers>
  <trigger
   enabled="y"
   lines_to_match="10"
   match="^\(Serpentlords\): (.*?) &quot;([^&quot;]+)&quot;\Z"
   multi_line="y"
   name="chats"
   regexp="y"
   script="OnChat"
   sequence="100"
  >
  </trigger>
</triggers>



This matches the "Serpentlords" chats, however you can have more than one like this: "Ashura|Serpentlords" (instead of just "Serpentlords").

It then matches up to 10 lines (you can change that) looking for the closing quote symbol, and accepting any characters, including newlines, but excepting the quote symbol itself. The reason for that is to stop the same line matching more than once. It calls OnChat script routine, which then breaks up the matching line and appends it to the notepad window.



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,691 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]