Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ How can i gag MUD channels to separated window?

How can i gag MUD channels to separated window?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Redhat   (1 post)  Bio
Date Mon 10 Mar 2003 03:29 PM (UTC)
Message
I want gag MUD channels from main world window (for example <newbie>, <chat>,...) to separated windows.

How can i do that in VBScript?

Thanx RedHat
Top

Posted by David B   USA  (80 posts)  Bio
Date Reply #1 on Mon 10 Mar 2003 07:15 PM (UTC)
Message
Blah ooc's 'yadda yadda'
Example ooc channel.

Trigger:* ooc's '*'
send: %1 ooc's '%2"
checked: Enabled, omit from output
On the right side of the trigger part it lets you change where you send into to, you put it to notepad new


My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
Top

Posted by Kerrigan   (5 posts)  Bio
Date Reply #2 on Thu 13 Mar 2003 10:10 AM (UTC)
Message
mmh, i'm not sure, but won't this method opens every time the trigger matches a _new_ notepad window ?
i think you have to send it to "notepad (append)"
am i wrong ?

but going on by this method, there's a more complexiv problem. what will be done if you receive a message from the MUD which is multiline, like:

Blah ooc's 'yadda yadda yadda yadda yadda
yadda yadda yadda yadda '

the trigger will yust match the first line and sent just the first line to notepad. up to now i fixed this problem by setting a variable, like "varTextFollowing" to 1 in the first trigger, which catches the "* ooc's *" and gets the first line in another variable, like "varText", i will do so with every following line (concatenating the text in the variable "varText" as long as my variable "varTextFollowing" is set to 1) until i get a line with the prompt or a " " in the beginning (i think this is different in every MUD). i could't use a CR or LF because my MUD sends it on every line, grmpf, otherwise it would be easier. after i receive the "end-sequence" like my prompt or " " i send everything to notepad (append) and reset my first variable "varTextFollowing" to 0, which indicates that the text has ended.

any other advice ?

Kerrigan
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Thu 13 Mar 2003 10:11 PM (UTC)
Message
You are right, append is the way to go.

You could do without the variable, provided the first trigger simply enabled the second one (eg. one matching *). The second one could use world.AppendToNotepad to append its text to the same notepad window.

Also have a third trigger with a lower sequence number than the * trigger, that matches on the prompt line or the line with a space at the start, and use that to disable the second trigger.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


18,315 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.