Server Help

Bot Questions - Bot !help function

Cyan~Fire - Tue Aug 19, 2003 6:29 pm
Post subject: Bot !help function
I'm programming a little plugin right now and I did this:
case OP_Player:
{ // Player-level commands
// sendPrivate(p, "!about (query me about my function)");
sendPrivate(p, "!about !ship !capital");
}

But it won't show the lines when I do !help.
I checked !plugin and it says it was loaded, anyone have any idea why it didn't work?

Also: How do you make operatives in commands?
Like !ship [#].
CypherJF - Wed Aug 20, 2003 2:52 pm
Post subject:
Read this MervBot tutorial by .

You have to be careful because bit's and pieces of code are left out such in the case to use atoi (your !ship [#]) you need to include

#include <stdlib.h>

in command.cpp, in the top portion like so:

#include "spawn.h"
#include <stdlib.h>
#include "..\algorithms.h"


To address how to do a command here's another code sniplet

if (c->check("lt_on")) { // !lt_on [#]
int temp = 500; // default value incase [#] is not a number.

if (isNumeric(c->final))
temp = atoi(c->final); // change text number into int (stdlib)
}



Hopes this helps, if not just IM me, it was a pain to post code on here icon_smile.gif

- cyp
CypherJF - Wed Aug 20, 2003 2:54 pm
Post subject:
CypherJF wrote:
Read this MervBot tutorial by .

Sorry I lost my mind icon_smile.gif I totally forgot to stick the URL and name in there... OY!

Quote:

Working on a simple MERVBot Tutorial:

http://www.dueling.net/MERVbot_tutorial.html

just started on it so it's not done yet, hopefully it'll be helpful to new bot programmers

Underlord
DZ Sysop


It has missing code here and there, formatting isn't very nice but at least it explains some stuff ... C++ definately a needed knowledge (w/ experience coding helps a lot ...)

Like i said any help just IM me
-cyp
Cyan~Fire - Wed Aug 20, 2003 6:01 pm
Post subject:
Cool! Thanks that helped. I got it all working now!
Any idea with the !help info though?
Smong - Thu Aug 21, 2003 2:53 pm
Post subject:
Are you sure plugins say "!about (query me about my function)"? If you had more than one plugin loaded and someone did !help they would get the message several times.
Cyan~Fire - Thu Aug 21, 2003 6:01 pm
Post subject:
Yeah I know, but it's not the problem.
Now I've just changed it to !myship but it still doesn't display... So weird :-/
ExplodyThingy - Fri Aug 22, 2003 10:52 pm
Post subject:
Read the above switch statement above it, and make sure the break statements arent preventing it from working. Take out al the breaks up to the first message sent.
ShortyMatt - Fri Aug 22, 2003 11:26 pm
Post subject:
sooo dam confusing
Cyan~Fire - Fri Aug 22, 2003 11:52 pm
Post subject:
OMG, I feel so stupid now.
Explody that was the prob icon_razz.gif Thanks!

No I'm wondering, why were there breaks there in the first place...
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group