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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Tue Nov 24, 2009 2:17 am   

[3.12] Gag flicker with prompt trigger
 
I'm having problems with a prompt trigger causing my screen to flicker. This is the code:

Code:

<trigger name="mip8" priority="4" ansi="true" regex="true" newline="false" prompt="true" id="270467">
  <pattern>(?:^)?\#K\%(?:@mipcode)(?miplen:\d{3})(?miptag:\a{3})(?mipstringa:.*)</pattern>
  <value>//%1=miptag, %2=mipstring, %3=leftover
//FFF tag is missing some letters
//BAB is ignored
//CAA is the chatmonitor, it is done but needs to be ansified
//missing tags: AAF, more, check the MIP window, if a tag isn't registerred itll go there with the mipstring
#if (%len( %stripansi( @mipstringa)) < (%int( @miplen)-3)) {#abort all}
#call %vartype( @mipstring, 3)
#call %vartype( @nonmipstring, 3)
#call %vartype(@mipstringa,3)
#if (%regex(@mipstringa,"\n")) {#PRINT LONG LINE: @mipstringa @mipstring @nonmipstring %line(1)}
mipstring=%left( %stripansi( @mipstringa), (@miplen-3))
nonmipstring=%right( @mipstringa, (@miplen-3))
#gag
#switch (@miptag = FFF) {
  hpstring=%replace( @mipstring, "~", |)
  #delitem hpstring {}
  #if (%ismember( A, @hpstring)) {
    $inum=%ismember( A, @hpstring)
    hpcur=%item( @hpstring, ($inum+1))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  #if (%ismember( B, @hpstring)) {
    $inum=%ismember( B, @hpstring)
    hpmax=%item( @hpstring, ($inum+1))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  #if (%ismember( C, @hpstring)) {
    $inum=%ismember( C, @hpstring)
    spcur=%item( @hpstring, ($inum+1))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  #if (%ismember( D, @hpstring)) {
    $inum=%ismember( D, @hpstring)
    spmax=%item( @hpstring, ($inum+1))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  #if (%ismember( G, @hpstring)) {
    $inum=%ismember( G, @hpstring)
    fortitude=%item( @hpstring, ($inum+1))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  #if (%ismember( L, @hpstring)) {
    $inum=%ismember( L, @hpstring)
    ehealth=%item( @hpstring, ($inum+1))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  #if (%ismember( J, @hpstring)) {
    $inum=%ismember( J, @hpstring)
    glinea=%item( @hpstring, ($inum+1))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  #if (%ismember( I, @hpstring)) {
    $inum=%ismember( I, @hpstring)
    overload=%trim( %subregex( %item( @hpstring, ($inum+1)), " \(\w+\)"))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  #if (%ismember( K, @hpstring)) {
    $inum=%ismember( K, @hpstring)
    mobname=%item( @hpstring, ($inum+1))
    #delnitem hpstring $inum
    #delnitem hpstring $inum
    }
  } (@miptag = BAD) {currentroom=@mipstring} (@miptag = DDD) {croomexits=@mipstring} (@miptag = AAC) {reboottime=@mipstring} (@miptag = BAE) {mudlag=@mipstring} (@miptag = AAF) {uptime=@mipstring} (@miptag = AAB) {
  mipstring=%replace( @mipstring, "~")
  mobexamine=@mipstring
  } (@miptag = BAB) {
    //#if (%regex( @nonmipstring, "\e.*you")) {} {
    //mipstring=%replace( @mipstring, "~", |)
    //#delitem mipstring {}
    //#if (%ismember( x, @mipstring)) {
    //  #delnitem mipstring 1
    //  #window tell {%ansi( white)To %pop( mipstring): %pop( mipstring)}
    //  } {#window tell {%ansi( white)From %pop( mipstring): %pop( mipstring)}}}
    } (@miptag = CAA) {
  mipstring=%replace( @mipstring, "~", |)
  #window chat %item( @mipstring, %numitems( @mipstring))
  } (@miptag = CDF) {
  mipstring=%replace( @mipstring, "~", "|")
  #file 1 %item( @mipstring, 2).txt
  } (@miptag = CCF) {#write 1 {@mipstring}} (@miptag = CEF) {#close 1} {#window MIP @miptag :@mipstring}
//#if (%regex(@nonmipstring,"\r\n")) {#if (%regex(@nonmipstring,"^\e")) {#say @nonmipstring} {#say %ansi(white)@nonmipstring}} {lastmipline=@nonmipstring;#temp {*} {#say %concat(@lastmipstring,@nonmipstring)}}
#if (%regex(@nonmipstring,"^\e")) {#say @nonmipstring} {#say %ansi(white)@nonmipstring}
//#if (@debug) {#debug 0}</value>
</trigger>


What it does is gag the line, then print out any additional information (as in the pattern was this: #K%12345008ABC54~The mob hit you really hard!. It would parse the #K%12345008ABC54~, gag the line, then print out "The mob hit you..." I do it this way instead of using #sub because the ansi is maintained w/o any additional work. However, it is causing my screen to be very jumpy in combat when the prompt trigger has the #gag. I remember the #gag was optimized for triggers, was it applied to prompt triggers too? I use the exact same code w/ a newline option checked and it doesn't flicker.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
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