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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Adding commands to smaugfuss
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Adding commands to smaugfuss

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


Posted by Soul Demon   (6 posts)  [Biography] bio
Date Mon 09 Feb 2004 04:43 PM (UTC)
Message
First off i would like to thank those who have previously responded to posts of mine as they have been very helpful.

On to my problem..

I have successfully added serveral snippets to the smaugfuss source, recompiled and had them work for me.

The problem i am having is with the commands that i add with cedit...

If i add (for example: balance) a command and associate it to its specific code (do_balance) it works...

I then do
cedit save cmdtable

and everything seems to be fine... the command can be executed and works properly...

then i reboot the mud and the command no longer works..
if in invoke that particular command it says
huh!
if i check it with cedit i can find the command but the code has been changed to something weird which looks like this

#COMMAND
Name balance~
Code (0x808ef87)
Position 106
Level 0
Log 0
End


If i re- cedit the command and point it to its code again save cmd table it works fine until reboot.

So i opened up the commands.dat file to look to see if i could find other instances of this weird code and i found 17 other commands with it... when i compare these to the original commands.dat file i see that they have been somehow changed as well ..

I have tried to manually set these commands back to what they should be based on the original file but when i reboot the mud my changes are not reflected in the game....

The following is the list of commands and the odd code that i am getting (sorry for the length)


#COMMAND *Appears this way in orig. source
Name atmob~
Code (0x8128b80) *recurring number throughout
Position 100
Level 52
Log 0
End

#COMMAND *I added
Name balance~
Code (0x808ef87)
Position 106
Level 0
Log 0
End

#COMMAND
Name clear~
Code (0x8128b80)
Position 100
Level 0
Log 0
End

#COMMAND
Name cmenu~
Code (0x8128b80)
Position 100
Level 61
Log 1
End

#COMMAND *I added
Name deposit~
Code (0x808eba1)
Position 106
Level 0
Log 0
End

#COMMAND *I added
Name destroyslay~
Code (0x8138139)
Position 106
Level 55
Log 0
End

#COMMAND
Name mmenu~
Code (0x8128b80)
Position 100
Level 54
Log 0
End

#COMMAND *Appears this way in orig. source
Name moblog~
Code (0x8128b80)
Position 100
Level 58
Log 0
End

#COMMAND *I added
Name makeslay~
Code (0x81379ab)
Position 106
Level 55
Log 0
End

#COMMAND
Name omenu~
Code (0x8128b80)
Position 100
Level 54
Log 0
End

#COMMAND *Appears this way in orig. source
Name opentourney~
Code (0x8128b80)
Position 100
Level 65
Log 1
End

#COMMAND
Name pagelength~
Code (0x8128b80)
Position 100
Level 51
Log 0
End

#COMMAND
Name redraw~
Code (0x8128b80)
Position 100
Level 52
Log 0
End

#COMMAND
Name refresh~
Code (0x8128b80)
Position 100
Level 52
Log 0
End

#COMMAND *I added
Name setslay~
Code (0x8137b15)
Position 106
Level 55
Log 0
End

#COMMAND *I added
Name showslay~
Code (0x8138048)
Position 106
Level 55
Log 0
End

#COMMAND *I added
Name withdraw~
Code (0x808ed94)
Position 106
Level 0
Log 0
End


If i am once again displaying symptoms of mental defects please alert me to this fact

Thanks in advance to whoever helps me on this

S.D.
[Go to top] top

Posted by Abbddull   (1 post)  [Biography] bio
Date Reply #1 on Mon 09 Feb 2004 05:35 PM (UTC)
Message
For the commands that you have added be sure that you have done what is outlined in
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=2496
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #2 on Mon 09 Feb 2004 06:12 PM (UTC)
Message
Ok, what it looks like is that when saving the commands, its writing the memory adress of the do_command, and not the name of the command. However, this is strange because it would seem to me that all commands would have that adress, not just some of them. So, another possibility is that when loading, there was an error location to proper code, so its reverting to a standard default code, but instead of writing the name of the command, its writing the commands memory adress, something like:
if ( !found ){
command->fun_name = defaultcommand;}
instead of:
if ( !found ){
command->fun_name = defaultcommand->fun_name;}
Something like that. However, this still leaves the underlying problem of not finding the command upon booting.

Here is a few things you could try: Check your log to see if there were any error messages. If so, you can use these to track down the problem. You could use Nick's GDB guide to step though the reading in of the command, using the specific commands name, which I think he described quite thouroughly using a specific string to activate a breakpoint. You can also scatter the reading/writing with bug()'s to write what its doing to the log file to give you more information.

Until you can track it down, I would just edit the command.dat file manually. I hope one of those suggestions works for you, though I'm not that familiar with smaugfuss.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Soul Demon   (6 posts)  [Biography] bio
Date Reply #3 on Mon 09 Feb 2004 06:47 PM (UTC)
Message
Ok thanks
so far i went to the post abbddull mentioned
http://www.gammon.com.au/forum/bbshowpost.phpbbsubject_id=2496
(dont know how i missed that before)
and that fixed my problems with the commands i added...
these commands now maintain there code references after rebooting and work properly...
but what about the commands that were already resident in smaug
(mmenu, omenu, cmenu, pagelength, refresh, redraw, and clear)

these are still appearing with the messed up code and i havent altered them anywhere in the source itself or with cedit
these are two examples of what i am talking about

#COMMAND
Name clear~
Code (0x8128b80)
Position 100
Level 0
Log 0
End

#COMMAND
Name cmenu~
Code (0x8128b80)
Position 100
Level 61
Log 1
End

As far as what you are saying greven im going to have to learn little more before i mess with that stuff
(i am an extreme newb)

but thank you for the help






[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.


5,368 views.

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 FutureQuest]