[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Wizhelp, colored commands

Wizhelp, colored commands

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


Pages: 1 2  

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Sun 18 Sep 2005 05:09 PM (UTC)
Message
I found a wizhelp snippet, that adds color to the commands. It is for afk, but I figure with some tweaking I whould be able to use it. THe snippet can be found at http://mindcloud.com/modules/Downloads/files/wizhcolor.txt#dl
I am running fedora core 4, and I am to mud programming.
Here is the issue I am having,

[josh@localhost src]$ make
make -s smaug
Compiling o/act_info.o....
act_info.c: In function ‘do_config’:
act_info.c:4025: error: called object ‘ch->act.bits[0] & 16384’ is not a function
cc1: warnings being treated as errors
act_info.c:4025: warning: too few arguments for format
make[1]: *** [o/act_info.o] Error 1
make: *** [all] Error 2

Here is the code that goes with it

ch_printf( ch, "Roomvnum [%s] Wizhelp Color [%s]", xIS_SET( ch->act, PLR_ROOMVNUM ) IS_SET(ch->pcdata->flags, PCFLAG_WIZHCOLOR ) ? "+" : " " );

Any help on this is greatly appreciated.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #1 on Sun 18 Sep 2005 05:14 PM (UTC)
Message
You're missing a comma after the first xIS_SET

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #2 on Sun 18 Sep 2005 05:24 PM (UTC)
Message
Thanks, but now I get this warning/error ... it is in the same code.

[josh@localhost src]$ make
make -s smaug
Compiling o/act_info.o....
cc1: warnings being treated as errors
act_info.c: In function ‘do_config’:
act_info.c:4025: warning: format ‘%s’ expects type ‘char *’, but argument 3 has type ‘int’
act_info.c:4025: warning: too few arguments for format
make[1]: *** [o/act_info.o] Error 1
make: *** [all] Error 2
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Reply #3 on Sun 18 Sep 2005 06:21 PM (UTC)
Message
Change your first %s (the one showing the room vnum) to a %d and see if that fixes the problem for you. %s is used for strings and %d for numbers.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #4 on Sun 18 Sep 2005 06:43 PM (UTC)
Message
thanks for that, now I know the diff between then %s and %d :) ...

but, not I am getting mor errors, this time in act_wiz.c ...

I have tried changing the %s to %d on line 7242, but it gives me another warning...

here are the errors

Compiling o/act_wiz.o....
cc1: warnings being treated as errors
act_wiz.c: In function ‘do_cedit’:
act_wiz.c:7241: warning: format ‘%s’ expects type ‘char *’, but argument 5 has type ‘int’
act_wiz.c:7241: warning: too few arguments for format
make[1]: *** [o/act_wiz.o] Error 1
make: *** [all] Error 2

Here is the code for that error + a few wxtra lines

7240 command->fun_name,
7241 flag_string( command->flags, cmd_flags ));
7242 ch_printf( ch, "Type: %s\n\r", flag_string( command->types, command_types ));
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Reply #5 on Sun 18 Sep 2005 07:02 PM (UTC)
Message
hmm, the warning indicates that the %s on 7242 should be a %d, but it also says that your flag_tring doesn't have enough components between the (), but looking at that function in my own code it doesn't look like it. Is that part of the code you'd altered, or maybe something above it isn't quite right?

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #6 on Sun 18 Sep 2005 07:56 PM (UTC)
Message
that is part of the code the instruction said to put in. I did have to comment out two things in the code due to 1. the were undeclared 2. when I uncomment them, and declare them I get pointer errors.
But I still have that error about line 7240 wether they are commented out or not.
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Reply #7 on Sun 18 Sep 2005 08:22 PM (UTC)
Message
What's the code before line 7242?
Lines 7240 and 7241 are only the end portion of a if check or loop or, whatever they're a part of.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #8 on Sun 18 Sep 2005 08:26 PM (UTC)
Message
here is the code for the whole thing.

ch_printf( ch, "Command: %s\n\rLevel: %d\n\rPosition: %s\n\rLog: %s\n\rCode: %s\n\rFlags: %s\n\r",
command->name,
command->level,
//npc_position[command->position],
//log_flag[command->log],
command->fun_name,
flag_string( command->flags, cmd_flags ));
ch_printf( ch, "Type: %s\n\r", flag_string( command->types, command_types ));

That used to be

if ( arg2[0] == '\0' || !str_cmp( arg2, "show" ) )
{
ch_printf( ch, "Command: %s\n\rLevel: %d\n\rPosition: %s\n\rLog: %s\n\rFunc Name: %s\n\rFlags: %s\n\r",
command->name, command->level, npc_position[command->position], log_flag[command->log],
command->fun_name, flag_string( command->flags, cmd_flags ) );
return;
}
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #9 on Sun 18 Sep 2005 08:54 PM (UTC)
Message
I used some code from a different custome wizhelp .. and I got past those errors. Thanks for all your help :D
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Reply #10 on Sun 18 Sep 2005 11:39 PM (UTC)
Message
that works then :)

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #11 on Sun 18 Sep 2005 11:45 PM (UTC)
Message
ok, I figured out my problems. I ausmed that smaug fuss had already had things in it, that it did not.

so I fixed all those errors, only to get another one.

it is

[josh@localhost src]$ make
make -s smaug
Compiling o/act_wiz.o....
o/act_wiz.o(.text+0x13c4e): In function `do_cedit':
/home/josh/Desktop/mud/src/act_wiz.c:7234: undefined reference to `log_flag'
o/act_wiz.o(.text+0x13c5d):/home/josh/Desktop/mud/src/act_wiz.c:7234: undefined reference to `npc_position'
collect2: ld returned 1 exit status
make[1]: *** [smaug] Error 1
make: *** [all] Error 2

and here is the code for it

ch_printf( ch, "Command: %s\n\rLevel: %d\n\rPosition: %s\n\rLog: %s\n\rCode: %s\n\rFlags: %s\n\r",
command->name,
command->level,
npc_position[command->position],
log_flag[command->log],
command->fun_name,
flag_string( command->flags, cmd_flags ));
ch_printf( ch, "Type: %s\n\r", flag_string( command->types,
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #12 on Sun 18 Sep 2005 11:54 PM (UTC)
Message
Looks like npc_position is missing? Where is that function?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #13 on Mon 19 Sep 2005 02:27 AM (UTC)
Message
I ahve npc_positon and log_flag both in mud.h ... in afk they were in olc.h but smaugfuss does not olc.

I have them on lines 309 and 310

extern char *const log_flag[];
extern char *const npc_position[POS_MAX];
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #14 on Mon 19 Sep 2005 02:30 AM (UTC)
Message
Yes, that's where it is declared, but where is const table?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] 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.


42,069 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]