Does anyone know a link to a good format snippet that will work with smaug FUSS. The one I found doesnt seem to be in C and Im not sure how to edit it :(
Format with FUSS
Posted by Mopop on Tue 22 Nov 2005 05:50 PM — 27 posts, 90,662 views.
Check out Cronel's editor snippet. It replaces the buffer system in Smaug, and comes with a format. I'll see if I can find a link.
Here it is:
http://cronel.mube.net/code.shtml
Here it is:
http://cronel.mube.net/code.shtml
Quote:
editor.0103.tgz
13.87kb
New editor code
This code replaces the stock SMAUG editor by a new one that is less restrictive and a bit more flexible.
(Version 0.103).
Author: Cronel
editor.0103.tgz
13.87kb
New editor code
This code replaces the stock SMAUG editor by a new one that is less restrictive and a bit more flexible.
(Version 0.103).
Author: Cronel
I tried adding that last night and I got bugs like crazy! The screen flood and flood and flooded with strange errors. I had to revert to my back to my back up. Was there something I did wrong? Should It work correctly?
Yeah it should be fine, considering I added it to my MUD and I use FUSS.
Do you use the patch or do it manually?
Manually, I've never ever had a patch fully work anyways; even with stock Smaug. I normally do all patches manually.
Well i guess I can try, I dont gotta edit anything in the patch do i?
Nope. You have to read the patch; sort of like an instruction manual.
Hrm do you know how to make the compiler to stop treating warnings as errors?
Offhand, no. I don't think FUSS treats all warnings as errors anyways. But still, it's best to correct warnings.
I entered the snippet you told me about, I followed the directions for not using the patch. I added the file and got a ton of errors. Ill post some of them I cant add them all or it wont lemme post, and I cant even scroll back that far
boards.c:462: warning: declaration of `board' shadows a parameter
boards.c:238: warning: shadowed declaration is here
boards.c:466: parameter `quill' is initialized
boards.c:466: parameter `paper' is initialized
boards.c:466: parameter `tmpobj' is initialized
boards.c:467: parameter `ed' is initialized
boards.c:472: parameter `mfound' is initialized
boards.c:474: syntax error before "if"
boards.c:987: syntax error before "if"
boards.c:1303: syntax error before "do"
boards.c:1409: conflicting types for `word'
boards.c:1299: previous declaration of `word'
boards.c:1409: warning: redundant redeclaration of `word' in same scope
boards.c:1299: warning: previous declaration of `word'
boards.c:1411: syntax error before "for"
boards.c:1490: redeclaration of `board'
boards.c:462: `board' previously declared here
boards.c:1490: warning: declaration of `board' shadows a parameter
boards.c:462: warning: shadowed declaration is here
boards.c:1491: redeclaration of `pnote'
boards.c:461: `pnote' previously declared here
boards.c:1491: warning: declaration of `pnote' shadows a parameter
boards.c:461: warning: shadowed declaration is here
boards.c:1495: syntax error before "first_board"
boards.c:1551: syntax error before "argument"
boards.c:1888: redeclaration of `found'
boards.c:1545: `found' previously declared here
boards.c:1888: warning: declaration of `found' shadows a parameter
boards.c:1545: warning: shadowed declaration is here
boards.c:1889: redeclaration of `arg'
boards.c:460: `arg' previously declared here
boards.c:1889: warning: declaration of `arg' shadows a parameter
boards.c:460: warning: shadowed declaration is here
boards.c:1891: syntax error before "argument"
boards.c:1957: parameter `cnt_to' is initialized
boards.c:1957: parameter `cnt_from' is initialized
boards.c:1959: syntax error before "for"
make[1]: *** [o/act_info.o] Error 1
make[1]: *** Waiting for unfinished jobs....
distcc[31831] ERROR: compile on 10.10.200.10:10666/4 failed
Compiling o/build.o....
make[1]: *** [o/imc.o] Error 1
make: *** [all] Error 2
Yeah If you can help me get this damn format In i would love you for life :P
boards.c:462: warning: declaration of `board' shadows a parameter
boards.c:238: warning: shadowed declaration is here
boards.c:466: parameter `quill' is initialized
boards.c:466: parameter `paper' is initialized
boards.c:466: parameter `tmpobj' is initialized
boards.c:467: parameter `ed' is initialized
boards.c:472: parameter `mfound' is initialized
boards.c:474: syntax error before "if"
boards.c:987: syntax error before "if"
boards.c:1303: syntax error before "do"
boards.c:1409: conflicting types for `word'
boards.c:1299: previous declaration of `word'
boards.c:1409: warning: redundant redeclaration of `word' in same scope
boards.c:1299: warning: previous declaration of `word'
boards.c:1411: syntax error before "for"
boards.c:1490: redeclaration of `board'
boards.c:462: `board' previously declared here
boards.c:1490: warning: declaration of `board' shadows a parameter
boards.c:462: warning: shadowed declaration is here
boards.c:1491: redeclaration of `pnote'
boards.c:461: `pnote' previously declared here
boards.c:1491: warning: declaration of `pnote' shadows a parameter
boards.c:461: warning: shadowed declaration is here
boards.c:1495: syntax error before "first_board"
boards.c:1551: syntax error before "argument"
boards.c:1888: redeclaration of `found'
boards.c:1545: `found' previously declared here
boards.c:1888: warning: declaration of `found' shadows a parameter
boards.c:1545: warning: shadowed declaration is here
boards.c:1889: redeclaration of `arg'
boards.c:460: `arg' previously declared here
boards.c:1889: warning: declaration of `arg' shadows a parameter
boards.c:460: warning: shadowed declaration is here
boards.c:1891: syntax error before "argument"
boards.c:1957: parameter `cnt_to' is initialized
boards.c:1957: parameter `cnt_from' is initialized
boards.c:1959: syntax error before "for"
make[1]: *** [o/act_info.o] Error 1
make[1]: *** Waiting for unfinished jobs....
distcc[31831] ERROR: compile on 10.10.200.10:10666/4 failed
Compiling o/build.o....
make[1]: *** [o/imc.o] Error 1
make: *** [all] Error 2
Yeah If you can help me get this damn format In i would love you for life :P
Well, I need to see the first few errors.
Also, this may present a problem; I've never seen it before.
Also, this may present a problem; I've never seen it before.
distcc[31831] ERROR: compile on 10.10.200.10:10666/4 failed
We established already that the strange distcc messages are something about Wolfpaw's clustered server auto-back-up at compile system in place...
"shadows" and "redeclares" sounds like things are either in the wrong place, or put there twice.
I scraped it, it made me too pissed. I just need a good /f command for SmaugFUSS I cant really edit all the stuff because im not sure of the differences of 1.4 smaug and FUSS :(. i wish I just knew how to hard code it myself =P
You may find this one a bit less problematic - all it does is patch the existing editor to include a /f option.
http://www.afkmud.com/scripts/download.php?file=Sadiq/Format.txt
Do let me know if there are any problems with it not behaving properly, it's been awhile since this one was last looked at since it's one of Sadiq's older ones.
http://www.afkmud.com/scripts/download.php?file=Sadiq/Format.txt
Do let me know if there are any problems with it not behaving properly, it's been awhile since this one was last looked at since it's one of Sadiq's older ones.
cc1: warnings being treated as errors
build.c: In function `edit_buffer':
build.c:5265: warning: declaration of `x' shadows a previous local
build.c:5150: warning: shadowed declaration is here
I added everything here are the bugs, I tried making some sense of it and failed. If you are gonna explain it to me, explain it in idiot terms as ive only been coding for bout 12 days =)
build.c: In function `edit_buffer':
build.c:5265: warning: declaration of `x' shadows a previous local
build.c:5150: warning: shadowed declaration is here
I added everything here are the bugs, I tried making some sense of it and failed. If you are gonna explain it to me, explain it in idiot terms as ive only been coding for bout 12 days =)
The variable "x" was already used earlier up. Rename the snippet's x to x1 to work around this. That is, the major part of it could be:
if ( !str_cmp( cmd+1, "f" ) )
{
char temp_buf[MAX_STRING_LENGTH+max_buf_lines];
int x1, ep, old_p, end_mark;
int p = 0;
pager_printf( ch, "Reformating...\n\r");
for ( x1 = 0; x1 < edit->numlines; x1++ )
{
strcpy ( temp_buf+p , edit->line[x1] );
p += strlen( edit->line[x1] );
temp_buf[p] = ' ';
p++;
}
temp_buf[p] = '\0';
end_mark = p;
p = 75;
old_p =0;
edit->on_line =0;
edit->numlines =0;
while ( old_p < end_mark )
{
while ( temp_buf[p] != ' ' && p > old_p )
p--;
if ( p == old_p )
p +=75;
if ( p > end_mark )
p = end_mark;
ep =0;
for ( x1= old_p ; x1 < p ; x1++ )
{
edit->line[edit->on_line][ep] = temp_buf[x1];
ep++;
}
edit->line[edit->on_line][ep] = '\0';
edit->on_line++;
edit->numlines++;
old_p = p+1 ;
p += 75;
}
pager_printf( ch, "Reformating done.\n\r> ");
return;
}
Nice, It compiled clean and I tested it out. It doesnt even format
Begin entering your text now (/? = help /s = save /c = clear /l = list)
-----------------------------------------------------------------------
>
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(Long line trimmed)
> >
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(Long line trimmed)
> >
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(Long line trimmed)
> >
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(Long line trimmed)
> >
/f
Reformating...
Reformating done.
>
/s
Done.
<32700hp 102m 110mv> <#7>
l
Floating in a void
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSS
Exits: none.
Would anyone happen to know why? I hate having all these format problems -.- I just want to get it off my to do list lol.
Begin entering your text now (/? = help /s = save /c = clear /l = list)
-----------------------------------------------------------------------
>
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(Long line trimmed)
> >
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(Long line trimmed)
> >
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(Long line trimmed)
> >
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(Long line trimmed)
> >
/f
Reformating...
Reformating done.
>
/s
Done.
<32700hp 102m 110mv> <#7>
l
Floating in a void
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSS
Exits: none.
Would anyone happen to know why? I hate having all these format problems -.- I just want to get it off my to do list lol.
A line full of S isn't a good test, there are no word breaks to format at. It worked for me, see this:
Before the formatting I had 3 lines, the middle one was too short. After formatting it looked better.
>
/l
------------------
1> You stand inside the northern gate of Darkhaven.
2> To the south lies the
3> intersection of Vertic Avenue and Justice Road.
------------------
>
/f
Reformating...
Reformating done.
>
/l
------------------
1> You stand inside the northern gate of Darkhaven. To the south lies the
2> intersection of Vertic Avenue and Justice Road.
------------------
>
Before the formatting I had 3 lines, the middle one was too short. After formatting it looked better.
Gosh, How silly of me. I didnt know how it worked *blush* Thanks Nick and everyone else for your help!!! *crosses format off list*
Anyone else notice that the -pedantic flag doesn't like this snippet? It complains about variable sized arrays if memory serves. Has anyone come up with a work around for this or do they just ignore the error or not use -pedantic?
The error doesn't come up when compiling C++ but it is a legitimate issue in C since C does not technically allow variable sized arrays. What amazes me is that it takes using the -pedantic switch just to catch this.
Has anyone come up with a work around on this particular snippet? Looks like a handy feature to have, but since my code otherwise gets passed cleanly by the -pedantic flag, I'd rather not remove it from the makefile just for the sake of having a format option in the line editor. Would be neat to have otherwise though. :-/
max_buf_lines = 24;
if( ch->substate == SUB_MPROG_EDIT || ch->substate == SUB_HELP_EDIT )
max_buf_lines = 48;
In stock code, that's the variable that causes all this: max_buf_lines. Notice they have 2 different values for it. I'm not entirely sure why Sadiq had that variable array setup in his code. I don't think it really needs to be there.
So instead of:
char temp_buf[MAX_STRING_LENGTH + max_buf_lines];
Perhaps just:
char temp_buf[MAX_STRING_LENGTH];
Cause in the grand scheme of things, all he's really done is let another 48 chars go into temp_buf which doesn't seem very useful.
This line will need changing too:
strncpy( temp_buf + p, edit->line[x], MAX_STRING_LENGTH + max_buf_lines - p );
will give it a shot, thanks for the suggestion. :)
Just as a follow-up, what Samson suggested worked perfectly.
Kudos for the tip. You the man, as always. ;)
Kudos for the tip. You the man, as always. ;)