EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   New Commands - updated july 7th (https://www.eqemulator.org/forums/showthread.php?t=14645)

Jezebell 07-02-2004 04:58 PM

Code:

Error in query 'INSERT INTO name_filter SET name = 'Draupner''
Maybe it is the space before and after the equal sign, it shouldn't be there?

Liscadipesce 07-02-2004 06:10 PM

Woot
 
Thanks for the great additions Draupner.

I was curious if you could make it all come together in one command. Like say #npcedit? And if a user just type thats, the user would see the syntax and the options available. One command per field in the DB is kinda weird and I would find it easier in one command.

If not, the commands are still a great addition and will save a lot of time.

Draupner 07-03-2004 12:32 AM

Yea Liscc, making them into 1 command is what I wanted to do in the first place but I've only been lookin into c++ for like 2 days so I'm still quite noobish at it. Hopefully in the future though I'll be able to combine them into 1 command

animepimp 07-03-2004 01:28 AM

Quote:

Code:

Error in query 'INSERT INTO name_filter SET name = 'Draupner''

This is not a proper insert. This is the syntax for UPDATE with the first word changed. The proper syntax for INSERT INTO is as follows.

Code:

INSERT INTO name_filter (name, column2, column3, column4) values ('Draupner', value2, value3, value4);
You need to fill all the columns at once even if you usee only default values or something.

Draupner 07-03-2004 02:57 AM

Thanks for that tip it fixed it.
Add names to the name_filter list
Usage: #dumbname

command.cpp Line 261
Code:

                command_add("dumbname","[name] - Makes a name dumb",100,command_dumbname) || //Draupner: Dumbname Command
command.cpp Line 2701
Code:

void command_dumbname(Client *c, const Seperator *sep) //Draupner: Dumbass name command
 {
if (c->GetTarget() && c->GetTarget()->IsClient()) {
        char errbuf[MYSQL_ERRMSG_SIZE];
                char *query = 0;
                if (!database.RunQuery(query, MakeAnyLenString(&query, "INSERT INTO name_filter (name) values ('%s')", c->GetTarget()->GetName(), errbuf))) {
                cerr << "Error in query '" << query << "' " << errbuf << endl;
                        c->Message(0, "Query Failure. Check Zone Window for MySQL Error.");
        } else c->Message(0, "%s has been added to the name_filter list", c->GetTarget()->GetName());
                safe_delete_array(query);
        } else c->Message(13, "Target must be a Player!");
}

command.h Line 114
Code:

void command_dumbname(Client *c, const Seperator *sep); //Draupner: Dumbname

Tree 07-03-2004 03:32 PM

OMG
 
Holy crap you are amazing! I WANT TO LOVE YOU ALL NIGHT

Swampdog 07-04-2004 06:33 AM

Wow! Away from the boards for a couple of weeks and look what happens.. heheh Great additions!

I'd like to request something similar with the doors table in order to spawn items into the zone from the obj file. Trying to get them in the right position is a pain in the arse but if there was a # command to spawn and change the coordinates then update it to db, that would be awesome... :wink:

Cripp 07-04-2004 02:23 PM

Noticed a little problem with #npcedit..
when you use any of the commands it says for example..
"NPCID 5 now has 3498939 Armor Class"
it still works perfect for making the db changes. Anyways, here is what i changed to make it display correctly..

example, changed this..
Code:

c->Message(15,"NPCID %u now has the lastname %s",c->GetTarget()->CastToNPC()->GetNPCTypeID(),(sep->argplus[2]));
to this..
Code:

c->Message(15,"NPCID %u now has the lastname %s",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->arg[2]));
so changed all the (sep->argplus[2])
to atoi(sep->arg[2]) and it all displays correctly

hope this makes any sense and hope it helps :D

Draupner 07-04-2004 03:49 PM

I'm so dumb, I had worked so hard on this and since I wrote the #npcedit name #npcedit lastname first (which don't use the atoi, thats converts a string -> an interger) I fucked up on the messages for the rest. Also the sep->argplus works, the error was the lack of atoi. But thanks a lot for catching this for me, I don't believe I missed it.

Enoex 07-04-2004 03:53 PM

This is a very excellent addition, helps a lot. Thanks much for this. :D

Dave987 07-08-2004 03:41 AM

VERY nice work Draup! Thanks alot!!

productief 07-10-2004 04:01 AM

too bad that you have such a big avatar :P

Draupner 07-10-2004 04:04 AM

yea i fixed that sry was only up for like 2 min before i noticed

Charmy 07-10-2004 07:26 AM

Quote:

Yea Liscc, making them into 1 command is what I wanted to do in the first place but I've only been lookin into c++ for like 2 days so I'm still quite noobish at it
im sorry, but did you say 2 days?...

you know.. i thought i was a halfway intelligent person until i see what you learned in two days that i over 2 months haven't even begun to understand...

No one beleived me when i said we were really in the matrix, but this proves it!!! or somthing..


Anyway, amazing work, great job, and thank you..


Oh yea, i need a command that lets me type #jewed, where it drains all the persons platnium gold, silver, and copper from their banks and inventories. thanks again.

Melwin2 07-11-2004 03:45 AM

Excellent work.


All times are GMT -4. The time now is 08:22 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.