Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion Goto page 1, 2  Next
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Sun Aug 01, 2010 11:40 pm   

Please help - How to make text appear in a different window?
 
Hi I am abit of a newbie when it comes to programming and CMUD but there is one thing I need to work,

Hoping you tech peeps could help, is really important to me and would be very appreciative! :)

I want everything that preceeds the text "|1|" (not including speechmarks) to appear in a different (seperate) window instead of the main zmud window,


Have tried experimenting with #CAP,
what I did was a trigger so when "|1|" appears, it puts your text in another window (#cap), but the text still appears in the main window.
Is this feasible to do it that way? (#CAP all the time) or would this cause me lag? (because that text appears quite often in the mud I play) hehe x


Thankyouuu in advance :)
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Mon Aug 02, 2010 12:20 am   
 
hi! well think i've figured this out,
am using #gag on |1|
and #cap too
seems to work a charm, if someone knows a better way please still post :)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Aug 02, 2010 2:22 am   
 
Don't spam the different forums. I just got done with your other post in ZMud (was going to provide a trigger but then realized it was in the zmud forums so it wouldn't have worked).

Anywho, try this out:

Code:
#trigger {^(*)|1|$} {
  #gagspace
  #execwin [b]windowname[/b] {#print %1}
}


If your game uses color, you can check the ANSI trigger checkbox in the Trigger Options panel (it's a collapsible panel on the bottom edge of the Edit Trigger window). This may require you to include the ansi codes for the |1| part of the pattern, but any ansi color that appears in the the (*) will be automatically captured.
_________________
EDIT: I didn't like my old signature
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Tue Aug 17, 2010 7:27 pm   
 
Thanks for your reply,
Hey I tried doing this,
Do i just copy the above trigger text into my MUD window and hit enter?
this is what I did and it does now appear in the "triggers" section but the text still appears in same window :(
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Aug 17, 2010 7:53 pm   
 
Hm. I think "#GAGSPACE" should work, but try "#GAGSPACE 1".
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Thu Aug 19, 2010 3:01 pm   
 
ok in the trigger title box I have just put: |1|

and in the trigger itself I use:

#gagspace 1
#execwin snoopwindow {#print %1}

Now the text with "|1| <text here>" does not appear in main window, but it also does not appear anywhere else :( please help, highly frustrating hehe
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Thu Aug 19, 2010 3:03 pm   
 
(because the #gag #cap thing was dodgy, it didn't print everything in seperate window )
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Thu Aug 19, 2010 3:22 pm   
 
[edit] still not working :(
It doesn't capture text in new window


WISH this would work, anyone play www.mudii.co.uk and know what i'm talking about?

It's a "snoop" window, basically a spell so you can see what other people are doing, major wiz part of game.
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Thu Aug 19, 2010 3:43 pm   
 
Yo, would it matter that the "|1|" that appears is in blue??
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Aug 19, 2010 4:53 pm   
 
Also, instead of using #execwin with #print, it's faster to just use this:
Code:
#window snoopwindow %1

If you are using #capture and #gag, be sure to do the #capture FIRST and the #gag after it.
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Thu Aug 19, 2010 5:49 pm   
 
Ok.
Yeah i'm doing that now, it still seems some text (about 1%) is not transferring over to the other window, and it's very confusing. Maybe it's the mud i'm playing doing it wrong, dunno.

like if the player I am snooping talks to me, I can't hear it (tells you: hi!) etc.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Aug 19, 2010 10:40 pm   
 
That makes it sound like your trigger isn't firing in those cases. Maybe the MUD is adding a space to the end of the line that you can't see. Since your trigger ends in $, a space after the |1| would prevent it from firing.
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Mon Aug 30, 2010 8:19 pm   
 
Still dumbfounded on this,
what exact trigger would I need? *cries*
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Aug 31, 2010 3:15 am   
 
If you post some sample text from the mode in [code] tags we should be able to help you with that.
_________________
Asati di tempari!
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Mon Oct 24, 2011 12:09 pm   I know it was long time ago but still interested
 
Still can't see why this will not work :(
VERY appreciative of help


Last edited by midniterider on Tue Oct 25, 2011 1:29 pm; edited 1 time in total
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Mon Oct 24, 2011 12:12 pm   
 
Hope someone can figure it :) It'd change my gaming experience totally


Last edited by midniterider on Tue Oct 25, 2011 1:29 pm; edited 1 time in total
Reply with quote
ins0mnia
Novice


Joined: 23 Jan 2011
Posts: 42
Location: United States

PostPosted: Tue Oct 25, 2011 5:46 am   Re: Please help - How to make text appear in a different window?
 
midniterider wrote:
I want everything that preceeds the text "|1|" (not including speechmarks) to appear in a different (seperate) window instead of the main zmud window


This is what confused everyone, from the examples you need the text following |1| to trigger

Code:
#trigger {^|1|(*)$} {#window snoopwindow %1;#gag}


You can just paste that in your command line
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Tue Oct 25, 2011 1:28 pm   
 
Works a charm :) Thankyou
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Tue Oct 25, 2011 7:28 pm   
 
Hi again lol
The window prints all the text in blue, is there a way to make it the same colour as main window?
- Sorry to be a pest ins0mnia
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Tue Oct 25, 2011 7:31 pm   
 
don't worry if it's too complicated - it does work fine blue :) X
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Tue Oct 25, 2011 8:53 pm   
 
Check the ansi trigger box in the options at the bottom.
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Tue Oct 25, 2011 11:08 pm   
 
thanks for your reply.
I try checking the ANSI trigger box and the window stops appearing on |1| and appears in main window instead
I think I somehow need the right ANSI codes or something?
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Oct 26, 2011 12:54 am   
 
Oh, yeah, I should have read the full thread before posting. If you wanted to use an ansi trigger, you'd need to add the ansi codes for the |1|, but the easier way would be to just use #CAPTURE instead of #WINDOW (#CAPTURE preserves color, #WINDOW defaults to blue). So your code would be:
Code:
#trigger {^|1|(*)$} {#capture snoopwindow;#gag}
Reply with quote
midniterider
Beginner


Joined: 01 Aug 2010
Posts: 21

PostPosted: Wed Oct 26, 2011 1:12 am   
 
Thanks ever so much! I will test it tomorrow.
There is still a slight problem where the text very occasionally (and randomly) puts itself into the main window - but I suspect that will just be the lag?
Thanks again :-)
Reply with quote
ins0mnia
Novice


Joined: 23 Jan 2011
Posts: 42
Location: United States

PostPosted: Wed Oct 26, 2011 10:58 pm   
 
It shouldn't go to the main window, that means the trigger pattern is wrong in some regard and not firing in all cases. Most likely the start of line. I would remove the ^ in the pattern, at least to test it. You might need an optional %s at the start of line to match for example.

As always, code can be done multiple ways. Personally I'd stick with #WINDOW since Zugg suggests it's faster, but #CAPTURE is fine too. Just want to point out you can use %ansi() to color lines as needed.

Code:
#trigger {|1|(*)$} {#window snoopwindow %ansi(green)%1;#gag}


If you post some sample lines that aren't triggering it might help.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net