PDA

View Full Version : Working SQL Bot file


Havok2all
01-08-2015, 06:32 PM
Anyone have a working SQL file for bots? I have tried like 6 different versions going back almost 2 years and everyone has had some form of issue. Either the "name already being used" or "No HP column" and most recently "melee bots stand there doing nothing".

Anyone who has a working source able to point to where they got it?

Thanks.

Uleat
01-08-2015, 07:56 PM
Going back 2 years is probably a bad thing...

Try using the sql files located in git repo here:
https://github.com/EQEmu/Server/tree/master/utils/sql/git/bots

Post back if you have issues sourcing either those in (drop, then load.)

Havok2all
01-08-2015, 08:25 PM
That's the one I currently sourced in (I've come full circle). My current issue is that melee bots just stand there during a fight.

ionhsmith
01-08-2015, 08:42 PM
I tried to do this and i get an error ... Says FUNCTION peq.GetMobType does not exist ... i was trying to do this fix as well

Uleat
01-08-2015, 11:41 PM
Not sure on that particular function..was it deleted?


EDIT: It may be possible that your load_bots.sql didn't fully run. That function is created in that script.

werebat
01-09-2015, 09:50 AM
If you are using a recent build, bots are not working properly anyway. The HP problem and spellcasting issue makes them unpredictable. Until that is resolved, the casters do not work. Not sure about melee bots.

If your build is pre-December, then you should be ok.

Havok2all
01-09-2015, 08:48 PM
My issue is the opposite Werebat. Casters are working for me, but melee just stand there and do nothing. They srun to target, but don't attack. As I stated in my first post, I went back trying different source builds of load_bots going back almnost 2 years. I couldn't get any of them to work.

I am really perplexed. I had a server before and bots worked fine. Wish like hell I held onto that file now :(

Riklin
01-11-2015, 10:25 PM
I tried to do this and i get an error ... Says FUNCTION peq.GetMobType does not exist ... i was trying to do this fix as well


I ran into this issue. What I did to fix it was to create a peqtest database instance and source the September 2014 data, then source in the bots, then source in the mercs. After all that, I copied the GetMobType function in the peqtest database and pasted it in the real database. Worked perfectly for me.

werebat
01-12-2015, 09:27 AM
Here is the issue. I fixed it in on my build.

In the load_bots.sql there are two lines that need to be corrected.

197 DELIMTER \\
212 END \\

The problem is that you cannot use a backslash as a delimiter. Change the \\ to $$ and rerun it. You may need to run drop_bots first so you dont hit a bunch of duplicate errors.

197 DELIMTER $$
212 END $$

Uleat
01-12-2015, 04:46 PM
Yousir, are correct!

http://dev.mysql.com/doc/refman/5.1/en/stored-programs-defining.html


Not sure how that occurred..I rewrote those and not sure why I would have used 'backs' :/
(I know it was something that I did because all of the old delimiters are '$$')

Forward slashes are fine too..but, I'll push that change to the repo and hopefully it will make it into the peq dump soon.

Thanks for catching that!


EDIT: EQEmu git repo have been updated..the 'old' script actually used '//'..so, not sure how I did that...

Havok2all
01-13-2015, 06:19 PM
Bah :P That didn't fix my issue with melee standing around watching the fight.

werebat
01-13-2015, 06:22 PM
That is a code issue and not the sql. Recent changes affected the hp and STR values. My caster bots would fight until level 12 but now they just sit. They do cast but they wont melee.

fault
01-19-2015, 10:43 PM
getting the following errors in that updated bot sql file

ideas? mysql 5.0.11

SQL query:

ALTER TABLE `guild_members` DROP PRIMARY KEY;

MySQL said: Documentation
#1091 - Can't DROP 'PRIMARY'; check that column/key exists

and


DELIMITER $$
CREATE FUNCTION `GetMobType` (mobname VARCHAR(64)) RETURNS CHAR(1)
BEGIN
DECLARE Result CHAR(1);
SET Result = NULL;
IF (SELECT COUNT(*) FROM `character_data` WHERE `name` = mobname) > 0 THEN
SET Result = 'C';
ELSEIF (SELECT COUNT(*) FROM `bots` WHERE `Name` = mobname) > 0 THEN
SET Result = 'B';
END IF;
RETURN Result;
END$$

MySQL said: Documentation
#1548 - Cannot load from mysql.proc. The table is probably corrupted

werebat
01-20-2015, 09:22 AM
sounds like your mysql needs to be upgraded to 5.1.

fault
01-24-2015, 08:48 PM
Ive got now:

mysql --version
mysql Ver 14.14 Distrib 5.5.41, for Linux (x86_64) using readline 5.


still get this:

SQL query:



DELIMITER $$

DROP FUNCTION IF EXISTS `GetMobTypeByName` $$

MySQL said: Documentation
#1548 - Cannot load from mysql.proc. The table is probably corrupted

werebat
01-24-2015, 09:38 PM
5.1 not 5.5. At least in windows, 5.5 will not work supposedly, not sure about Linux. I would try 5.1 as the guide says.

fault
01-25-2015, 11:36 AM
it didnt work on 5.1 either

Tamian
06-12-2015, 12:31 PM
Latest repo pull has a 'incomlpete' load_bots.sql. Once created, you can alter the following table to look as follows/use the following to modify create statement in load_bots.sql.

CREATE TABLE `botbuffs` (
`BotBuffId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`BotId` int(10) unsigned NOT NULL DEFAULT '0',
`SpellId` int(10) unsigned NOT NULL DEFAULT '0',
`CasterLevel` int(10) unsigned NOT NULL DEFAULT '0',
`DurationFormula` int(10) unsigned NOT NULL DEFAULT '0',
`TicsRemaining` int(11) unsigned NOT NULL DEFAULT '0',
`PoisonCounters` int(11) unsigned NOT NULL DEFAULT '0',
`DiseaseCounters` int(11) unsigned NOT NULL DEFAULT '0',
`CurseCounters` int(11) unsigned NOT NULL DEFAULT '0',
`CorruptionCounters` int(11) unsigned NOT NULL DEFAULT '0',
`HitCount` int(10) unsigned NOT NULL DEFAULT '0',
`MeleeRune` int(10) unsigned NOT NULL DEFAULT '0',
`MagicRune` int(10) unsigned NOT NULL DEFAULT '0',
`Dot_Rune` int(10) unsigned NOT NULL DEFAULT '0',
`DeathSaveSuccessChance` int(10) unsigned NOT NULL DEFAULT '0',
`CasterAARank` int(10) unsigned NOT NULL DEFAULT '0',
`caston_x` int(10) NOT NULL DEFAULT '0',
`Persistent` tinyint(1) NOT NULL DEFAULT '0',
`caston_y` int(10) NOT NULL DEFAULT '0',
`caston_z` int(10) NOT NULL DEFAULT '0',
`ExtraDIChance` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`BotBuffId`),
KEY `FK_botbuff_1` (`BotId`),
CONSTRAINT `FK_botbuff_1` FOREIGN KEY (`BotId`) REFERENCES `bots` (`BotID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

In addition, a find/replace may have occurred ... as character_data was truncated a few times to just character_ .... so you should check that as well.

CodyF86
06-15-2015, 12:13 AM
In a previous thread there were some variables that were missing from the current PEQ database someone mentioned a fix for. There were also 3 others I found from the error message I received in-game.

I have added them and have bots 100% working now with the latest PEQ database.

Here is link to a zip file with a working load and drop bots.sql and also a complete .sql files of the 2 items that needed missing variables added.

Working Bots (http://indybookbinders.com/cloud/Bots.zip)

Specifically listed below. caston_x, caston_y, and caston_z were missing along with ExtraDIChance.

for vwbotcharactermobs the syntac was bit jumbled on the PEQ database, below is correct, just plug it in.

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vwbotcharactermobs` AS select 'C' AS `mobtype`,`c`.`id` AS `id`,`c`.`name` AS `name`,`c`.`class` AS `class`,`c`.`level` AS `level`,`c`.`last_login` AS `timelaston`,`c`.`zone_id` AS `zoneid` from `character_data` `c` union all select 'B' AS `mobtype`,`b`.`BotID` AS `id`,`b`.`Name` AS `name`,`b`.`Class` AS `class`,`b`.`BotLevel` AS `level`,0 AS `timelaston`,0 AS `zoneid` from `bots` `b`;

CREATE TABLE IF NOT EXISTS `botbuffs` (
`BotBuffId` int(10) unsigned NOT NULL,
`BotId` int(10) unsigned NOT NULL DEFAULT '0',
`SpellId` int(10) unsigned NOT NULL DEFAULT '0',
`CasterLevel` int(10) unsigned NOT NULL DEFAULT '0',
`DurationFormula` int(10) unsigned NOT NULL DEFAULT '0',
`TicsRemaining` int(11) unsigned NOT NULL DEFAULT '0',
`PoisonCounters` int(11) unsigned NOT NULL DEFAULT '0',
`DiseaseCounters` int(11) unsigned NOT NULL DEFAULT '0',
`CurseCounters` int(11) unsigned NOT NULL DEFAULT '0',
`CorruptionCounters` int(11) unsigned NOT NULL DEFAULT '0',
`HitCount` int(10) unsigned NOT NULL DEFAULT '0',
`MeleeRune` int(10) unsigned NOT NULL DEFAULT '0',
`MagicRune` int(10) unsigned NOT NULL DEFAULT '0',
`dot_rune` int(10) unsigned NOT NULL DEFAULT '0',
`caston_x` int(10) unsigned NOT NULL DEFAULT '0',
`DeathSaveSuccessChance` int(10) unsigned NOT NULL DEFAULT '0',
`CasterAARank` int(10) unsigned NOT NULL DEFAULT '0',
`Persistent` tinyint(1) NOT NULL DEFAULT '0',
`caston_y` int(10) unsigned NOT NULL DEFAULT '0',
`caston_z` int(10) unsigned NOT NULL DEFAULT '0',
`ExtraDIChance` int(10) unsigned NOT NULL DEFAULT '0'
) ENGINE=InnoDB AUTO_INCREMENT=231 DEFAULT CHARSET=latin1;

jpyou127
06-15-2015, 11:37 AM
It will be a few days before I can make your bot update, but issue I am having is if it's a PC and 1 bot in the group and the bot dies it crashes the zone. Are you having this issue after your bot fixes?

Peyton

kimura
06-15-2015, 11:57 AM
It will be a few days before I can make your bot update, but issue I am having is if it's a PC and 1 bot in the group and the bot dies it crashes the zone. Are you having this issue after your bot fixes?

Peyton

Sounds like you have old source, that has been fixed, pull the latest source

CodyF86
06-15-2015, 12:04 PM
I followed the windows server setup guide to a T. It says the latest source is at: http://peqtgc.com/releases ...

and compiled the source myself straight from github.

Apparently it isn't, where can I find it?

edit: er sorry couldn't tell if you were talking to me or the poster above.

kimura
06-15-2015, 12:10 PM
I followed the windows server setup guide to a T. It says the latest source is at: http://peqtgc.com/releases ...

and compiled the source myself straight from github.

Apparently it isn't, where can I find it?

that is a link to the database

kimura
06-15-2015, 12:15 PM
the source is from github, which you probably have a recent one if you recently did it

Tamian
06-18-2015, 11:32 AM
The only issue I am having with Bots now is the run speed -- what variable/setting defines how BOT's adjust their run speed to the PC? Or is there a means to get them to cast SOW on themselves?

What I am seeing is that bots are not keeping up to me even without me being sow'd.

CodyF86
06-19-2015, 07:03 PM
That's interesting. With GMspeed on they following me at warp speed like their run speed is related to your characters.

I did notice they do tend to walk without gmspeed on though. I'll go play with it some more.

Tamian
06-20-2015, 03:42 AM
Thank you Cody!

If you would not mind as well, it seems that #bot resurrectme signals a response from the Bot Cleric, and the Bot response via say that they are trying, but the spell is never cast.

Kingly_Krab
06-20-2015, 04:15 AM
#bot resurrectme works correctly, do you have a target when you're doing it? if(!strcasecmp(sep->arg[1], "resurrectme")) {
Mob *target = c->GetTarget();
if(target == nullptr || !target->IsCorpse()) {
c->Message(15, "You must select a corpse!");
return;
}

if(c->IsGrouped()) {
bool hasrezzer = false;
Group *g = c->GetGroup();
for(int i = 0; i < MAX_GROUP_MEMBERS; i++) {
if(g && g->members[i] && g->members[i]->IsBot() && (g->members[i]->GetClass() == CLERIC)) {
hasrezzer = true;
Mob *rezzer = g->members[i];
rezzer->CastToBot()->BotGroupSay(rezzer->CastToBot(), "Trying to resurrect %s.", target->GetCleanName());
rezzer->CastToBot()->Bot_Command_RezzTarget(target);
break;
}
}

if(!hasrezzer)
c->Message(15, "You must have a Cleric in your group!");
} else
c->Message(15, "You must have a Cleric in your group!");

return;
}

Side note, bots inherit their runspeed from the mob they're following (you usually): if(AImovement_timer->Check()) {
if(GetFollowID()) {
Mob* follow = entity_list.GetMob(GetFollowID());
if(follow) {
float dist = DistanceSquared(m_Position, follow->GetPosition());
int speed = follow->GetRunspeed();
if(dist < GetFollowDistance() + 1000)
speed = follow->GetWalkspeed();

if(dist > GetFollowDistance()) {
CalculateNewPosition2(follow->GetX(), follow->GetY(), follow->GetZ(), speed);
if(rest_timer.Enabled())
rest_timer.Disable();
return;
} else {
if(moved) {
moved = false;
SetCurrentSpeed(0);
}
}
}
}
}

Tamian
06-20-2015, 05:42 AM
I do have the corpse targeted, and I am seeing the "trying to rez" message -- just the rez never comes.