If you do not have time to deal with this right now, please do not worry about it. It's just me trying to get into the coding aspect with something simple. Obviously, nothing is simple but Hello World!
Here's what I have successfully done.
Commands.h:
#define COMMAND_SETTIME 58 (next one after 57 heh)
`commands` table in DB:
added record for settime, handler 58.
Commands.cpp:
Code: Select all
case COMMAND_SETTIME:
{
if(sep && sep->arg[1]) {
client->SimpleMessage(CHANNEL_COLOR_YELLOW,"I'm in!");
} else {
client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Usage: /settime {HH:MM}");
}
break;
}Anyway, typing /settime 1 (anything really) now prints out my debug line. Wee! Ok, here's where it all falls apart...
world_time.hour = part of the value
world_time.minute = other part
I know how to split them up at the :, but it's the "world_time.hour" part that's got me boggled. I took the code from World.cpp (init). Since it fails completely, I am assuming that is incorrect.
Anyway, if I gain an understanding of how to access World data/variables from within the command switch, maybe I could help add a few commands here and there.
The one I really want to see is /commands [text], which will list available commands that contain [text]. So then, we can build the /{command} help features using the helptext field. That should be easy... however, C++ is definitely not phpScript.
Thanks for your time with the noob.