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
Aleron
Wanderer


Joined: 01 Aug 2005
Posts: 76

PostPosted: Wed Feb 01, 2006 4:22 pm   

Auto-Indenting
 
Perhaps auto-indenting could be fixed for CMUD? At the moment, I have all kinds of auto-indenting problems with zMUD (i.e., things are idented incorrectly and inconsistently), especially with large triggers/aliases containing nested blocks.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Feb 01, 2006 4:34 pm   
 
Probably a good idea to post examples of where the formatting breaks down as examples.

I know on my slower computers if I interrupt the auto-indenting the indenter can eat some of the script after the change. As if I interrupt the re-ordering of it and it chops things after the line I'm changing while its autoformatting.
Reply with quote
Aleron
Wanderer


Joined: 01 Aug 2005
Posts: 76

PostPosted: Wed Feb 01, 2006 4:55 pm   
 
Sure. Here is an example trigger from a script I wrote recently, I'll just give you the code for the trigger, as it is formatted by zMUD at the moment:

Code:
#IF (@botState = 4) {
      #IF (@killedJormleif = 1) {
    #MATH thisRunTime %ctime-@runStartTime
    #SAY Run Time: @thisRunTime seconds
    #MATH totalRunTime @totalRunTime+@thisRunTime
      #IF (@bestRunTime > @thisRunTime) {#VAR bestRunTime @thisRunTime}
    } {#ADD numNoRepopRuns 1}
      #VAR botState "at repop"
        #IF (@movePoints < 300) {sleep}
        #TSET 200
        #TI 1 {startRun}
      }


If I understand how zMUD is supposed to be auto-indenting this, its all screwed up. I just rewrote it (as in, retyped, not copy/paste) this trigger, and it still formats it this way. This is how I expect it should be formatting it (correct me if I am wrong):

Code:
#IF (@botState = 4) {
  #IF (@killedJormleif = 1) {
    #MATH thisRunTime %ctime-@runStartTime
    #SAY Run Time: @thisRunTime seconds
    #MATH totalRunTime @totalRunTime+@thisRunTime
    #IF (@bestRunTime > @thisRunTime) {#VAR bestRunTime @thisRunTime}
    } {#ADD numNoRepopRuns 1}
  #VAR botState "at repop"
  #IF (@movePoints < 300) {sleep}
  #TSET 200
  #TI 1 {startRun}
  }


Computer speed isn't an issue. I see the same problems on my machine at work (2.4GHz), on my laptop (2GHz), and at home (3.1GHz).
Reply with quote
Rainchild
Wizard


Joined: 10 Oct 2000
Posts: 1551
Location: Australia

PostPosted: Wed Feb 01, 2006 9:18 pm   
 
Code:
#IF (@botState = 4)
{
  #IF (@killedJormleif = 1)
  {
    #MATH thisRunTime %ctime-@runStartTime
    #SAY Run Time: @thisRunTime seconds
    #MATH totalRunTime @totalRunTime+@thisRunTime
    #IF (@bestRunTime > @thisRunTime)
    {
      #VAR bestRunTime @thisRunTime
    }
  } {
    #ADD numNoRepopRuns 1
  }
  #VAR botState "at repop"
  #IF (@movePoints < 300)
  {
    sleep
  }
  #TSET 200
  #TI 1 {startRun}
}


Would be my preference, though I have a feeling the open { might have to be on the same line as the #IF
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Feb 01, 2006 10:00 pm   
 
There will not be any auto-indenting in the Settings Editor. It will stay exactly how you typed it in. Read Zugg's preliminary announcements when the CMud forums were first opened (he might even have them stickied), I know he said as much in one of them.
_________________
EDIT: I didn't like my old signature
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Feb 02, 2006 7:20 pm   
 
Yep, Matt is correct. No "Pretty Printing" in CMUD, at least to start with.
Reply with quote
Aleron
Wanderer


Joined: 01 Aug 2005
Posts: 76

PostPosted: Thu Feb 02, 2006 7:41 pm   
 
Thanks for verifying, I looked for the referenced thread but couldn't find it.
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