PDA

View Full Version : Bot Account Limit


ionhsmith
02-12-2016, 10:39 PM
I was wondering how to limit bot spawns to specific account access like I use to under the commands tab in Heidi. I set the bots so only GM could spawn them until they are fixed. Since I updated the Commands say old and now we have command_settings however the bots are not in there ... So where can I go to set this now ?

Uleat
02-12-2016, 11:28 PM
You want to look in `rule_values` for that particular setting.

ionhsmith
02-13-2016, 08:58 AM
I looked in there too but i dont see it in there

Uleat
02-13-2016, 12:55 PM
Those rules are added during the updater script's bot installation process.

You'll just need to add them manually too in your case, since you added the bot tables manually:

INSERT INTO `rule_values` VALUES ('1', 'Bots:AAExpansion', '8', 'The expansion through which bots will obtain AAs');
INSERT INTO `rule_values` VALUES ('1', 'Bots:CreationLimit', '150', 'Number of bots that each account can create');
INSERT INTO `rule_values` VALUES ('1', 'Bots:FinishBuffing', 'false', 'Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat.');
INSERT INTO `rule_values` VALUES ('1', 'Bots:GroupBuffing', 'false', 'Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB.');
INSERT INTO `rule_values` VALUES ('1', 'Bots:ManaRegen', '3.0', 'Adjust mana regen for bots, 1 is fast and higher numbers slow it down 3 is about the same as players.');
INSERT INTO `rule_values` VALUES ('1', 'Bots:QuestableSpawnLimit', 'false', 'Optional quest method to manage bot spawn limits using the quest_globals name bot_spawn_limit, see: /bazaar/Aediles_Thrall.pl');
INSERT INTO `rule_values` VALUES ('1', 'Bots:QuestableSpells', 'false', 'Anita Thrall\\\'s (Anita_Thrall.pl) Bot Spell Scriber quests.');
INSERT INTO `rule_values` VALUES ('1', 'Bots:SpawnLimit', '71', 'Number of bots a character can have spawned at one time, You + 71 bots is a 12 group raid');


That may not be the correct rule_set...

I need to dig around sometime and figure out how exactly that system works.


EDIT: Actually...


There's several things that you will need to do since you did a manual install. (The script itself used to perform all of those task..but, too many people were
having 'special case' failures for something that worked absolutely fine on my system and was coded to ansi sql specs...)

Run the script portion of these lines individually..some may fail:
https://github.com/EQEmu/Server/blob/master/utils/scripts/eqemu_update.pl#L1099
https://github.com/EQEmu/Server/blob/master/utils/scripts/eqemu_update.pl#L1102
https://github.com/EQEmu/Server/blob/master/utils/scripts/eqemu_update.pl#L1106
https://github.com/EQEmu/Server/blob/master/utils/scripts/eqemu_update.pl#L1108

if you haven't done this already:
https://github.com/EQEmu/Server/blob/master/utils/scripts/eqemu_update.pl#L1111

ionhsmith
02-13-2016, 01:02 PM
I have those in there but not the one that i can make it so only gms can soawn or make bots.

Uleat
02-13-2016, 01:16 PM
Make sure you see my edit..the last one includes the `command_settings` entry.

Just bump the `status` of that up to whatever you want the minimum to be.

ionhsmith
02-13-2016, 07:06 PM
ok I'm not doing something right on this I guess ... how exactly do I run these scripts? I thought I could just pull them from the links you sent but guess I was wrong ... might be out of my knowledge

Uleat
02-13-2016, 08:40 PM
On the lines linked to, you want what's inside the outermost quotes.

ionhsmith
02-13-2016, 08:47 PM
select all, copy, and run in what ? type of thing I guess is what I'm asking lol

ionhsmith
02-15-2016, 12:42 PM
Ok I stopped being special and figured it out ... thanks Uleat that worked

ionhsmith
02-15-2016, 01:13 PM
ok so after I got it so only GM can spawn bots how do I delete the current ones from bot_data

I get this error
DELETE FROM `peq`.`bot_data` WHERE `bot_id`=1;
/* SQL Error (1451): Cannot delete or update a parent row: a foreign key constraint fails (`peq`.`bot_stances`, CONSTRAINT `FK_bot_stances_1` FOREIGN KEY (`bot_id`) REFERENCES `bot_data` (`bot_id`)) */

Uleat
02-15-2016, 03:16 PM
Bot ID's are tied to multiple tables..gimme a little bit and I'll see if there's something that can be accomplished easily.

ionhsmith
02-15-2016, 09:06 PM
ok sounds good... I guess I could always do the drop_bots sql and reload them ... would that work ?

Uleat
02-15-2016, 11:00 PM
I'm not liking what I see in terms of ease-of-use...

I don't particularly care to test it on my working database because I have changes in it that need to be scripted out first.


I can't say whether or not doing a manual drop/load will work because I haven't tested that process.

If you're using HeidiSQL or Navicat, you'd probably be best suited to manually select the entries and delete them by table until they clear out.

The only one (I believe) that you don't need to touch is `bot_command_settings` - if you happened to be using that dev branch.

ionhsmith
02-16-2016, 10:45 AM
hmm I use heidi ill give it a shot and post what i find... I know i cant delete it from bot_data because thats whats giving me the error so ill try the others.

Uleat
02-16-2016, 01:21 PM
Try `bot_data` last as most of the constraints are tied to the `bot_id` column there.

ionhsmith
02-17-2016, 11:06 AM
Ok so i was able to delete everything from the other tables and then delete the bot_data erasing the bots which is good. I came up with another issue though. Under Rule_values where u can limit the amount of bots people can have up at one time I set it to 1 and it is not working. Set at 1 people are still able to spawn multiple bots at the same time.

Uleat
02-17-2016, 03:32 PM
https://github.com/EQEmu/Server/blob/master/zone/bot.cpp#L9722


Make sure that the rule you are changing in the database is named 'Bots:SpawnLimit' exactly - no deviations in spelling.


"Bots:QuestableSpells", Anita Thrall's (Anita_Thrall.pl) Bot Spell Scriber quests.
"Bots:CreationLimit", Number of bots that each account can create
"Bots:SpawnLimit", Number of bots a character can have spawned at one time, You + 71 bots is a 12 group raid
"Bots:ManaRegen", Adjust mana regen for bots, 1 is fast and higher numbers slow it down 3 is about the same as players.
"Bots:QuestableSpawnLimit", Optional quest method to manage bot spawn limits using the quest_globals name bot_spawn_limit, see: /bazaar/Aediles_Thrall.pl
"Bots:GroupBuffing", Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB.
"Bots:FinishBuffing", Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat.
"Bots:AAExpansion", The expansion through which bots will obtain AAs



The `ruleset_id` also plays a role in this..though, I can never figure out which one is supposed to be active...



SELECT * FROM `rule_sets` LIMIT 1;


..returns "3", "merc_test" for me...

(Is this why rulesets are so hard to deal with?)

ionhsmith
02-17-2016, 08:06 PM
Mine says Bots:SpawnBotCount
And my rule_set is at 1

Uleat
02-17-2016, 08:24 PM
There's 8 rule name changes starting here: https://github.com/EQEmu/Server/blob/master/utils/scripts/eqemu_update.pl#L1119

You'll need to update the names to match what the server code uses.



if(get_mysql_result("SELECT `rule_name` FROM `rule_values` WHERE `rule_name` LIKE 'Bots:BotAAExpansion'") ne "" && $db){
print get_mysql_result("UPDATE `rule_values` SET `rule_name` = 'Bots:AAExpansion' WHERE `rule_name` LIKE 'Bots:BotAAExpansion';");
}
if(get_mysql_result("SELECT `rule_name` FROM `rule_values` WHERE `rule_name` LIKE 'Bots:AAExpansion'") eq "" && $db){
print get_mysql_result("INSERT INTO `rule_values` VALUES ('1', 'Bots:AAExpansion', '8', 'The expansion through which bots will obtain AAs');");
}



It sounds like you have the old rule names in place..so, you should be able to just run the 8 UPDATE queries.


Still not sure why your install wouldn't register for the updater script.

ionhsmith
02-18-2016, 11:32 AM
Yea it seems my updates are not working very well through the updater for some reason. I have to manually source in everything.
is there a way to copy and paste that code without getting all the numbers

ionhsmith
02-18-2016, 01:01 PM
I got this when doing the query

SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if(get_mysql_result("SELECT `rule_name` FROM `rule_values` WHERE `rule_name` LIK' at line 1 */

Uleat
02-18-2016, 04:40 PM
Remember, you just want the SQL portion of those lines.

print get_mysql_result("UPDATE `rule_values` SET `rule_name` = 'Bots:AAExpansion' WHERE `rule_name` LIKE 'Bots:BotAAExpansion';");

would be

UPDATE `rule_values` SET `rule_name` = 'Bots:AAExpansion' WHERE `rule_name` LIKE 'Bots:BotAAExpansion';


The outer 'wrapper' is the perl script - which doesn't run too well in MySQL :)

ionhsmith
02-18-2016, 07:47 PM
ok awesome that updated thanks.
so is this Bots:QuestableSpawnLimit a quest people can do to be able to use bots?