View Single Post
  #7  
Old 07-22-2009, 02:04 AM
Krugus
Sarnak
 
Join Date: Dec 2005
Location: the Void
Posts: 40
Default Bot Commands via quest script

Quote:
Originally Posted by WildcardX View Post
I guess what I think would be the most useful part of this script is if you added logic so the bot offers only the commands it is capable of performing. So an enchanter bot won't bother offering you help with doing a #bot cure but it would offer up #bot ai mez. That would cut down on the volume of the text the bots spit out and keep the info relevant.
I wish I had some talent in programing but I'm still just learning how to crawl in the scripting system EQEmu has. I'm learning as I go but that is why its so much fun

Anyways, here is the next revision of my Bot Help Quest Script. Added the logic you suggested to the script so it would spit out the class commands based on the bots class. Raid commands are only listed (on my to do list):

Code:
#Bot Event Script
#Just Hail and click!
#Most of the bot commands are listed here if you see one missing 
#click the #bot help to find the missing command.
#
# LAST EDIT DATE: July 22, 2009
# VERSION: 0.5
# By: Krugus
#

sub EVENT_SAY
{
my $help = quest::saylink("help");
my $general = quest::saylink("general");
my $bh = quest::saylink("#bot help");
my $bhc = quest::saylink("#bot help create");
my $bla = quest::saylink("#bot list all");
my $bu = quest::saylink("#bot update");
my $bga = quest::saylink("#bot group add");
my $bgr = quest::saylink("#bot group remove");
my $bgof = quest::saylink("#bot group order follow");
my $bgog = quest::saylink("#bot group order guard");
my $bgoa = quest::saylink("#bot group order attack");
my $bil = quest::saylink("#bot inventory list");
my $bgs = quest::saylink("#bot group summon");
my $bst = quest::saylink("#bot summon");
my $class = quest::saylink("class");
my $bmez = quest::saylink("#bot ai mez");
my $bplk = quest::saylink("#bot picklock");
my $bcup = quest::saylink("#bot cure poison");
my $bcud = quest::saylink("#bot cure disease");
my $bcuc = quest::saylink("#bot cure curse");
my $bcub = quest::saylink("#bot cure blindness");
my $bbme = quest::saylink("#bot bindme");
my $btrk = quest::saylink("#bot track");
my $btclm = quest::saylink("#bot target calm");
my $bil = quest::saylink("#bot inventory list");
my $bgs = quest::saylink("#bot group summon");
my $bst = quest::saylink("#bot summon");
my $bevc = quest::saylink("#bot evac");
my $brez = quest::saylink("#bot resurrectme");
my $bcorp = quest::saylink("#bot corpse summon");
my $blre = quest::saylink("#bot lore");
my $bsowr = quest::saylink("#bot sow regular");
my $bsowg = quest::saylink("#bot sow group");
my $bsoww = quest::saylink("#bot sow wolf");
my $binvs = quest::saylink("#bot invis live");
my $blevi = quest::saylink("#bot levitate");
my $brune = quest::saylink("#bot runeme");
my $bshk = quest::saylink("#bot shrinkme");
my $bend = quest::saylink("#bot endureb");
my $bchr = quest::saylink("#bot charm");
my $bdire = quest::saylink("#bot dire charm");
my $bpetr = quest::saylink("#bot pet remove");
my $bdgl = quest::saylink("List Druid Gate Locations");
my $bwgl = quest::saylink("List Wizard Gate Locations");
my $bdgkar = quest::saylink("#bot gate karana");
my $bdgcom = quest::saylink("#bot gate commons");
my $bdgtox = quest::saylink("#bot gate tox");
my $bdgbut = quest::saylink("#bot gate butcher");
my $bdglav = quest::saylink("#bot gate lava");
my $bdgro = quest::saylink("#bot gate ro");
my $bdgfee = quest::saylink("#bot gate feerrott");
my $bdgste = quest::saylink("#bot gate steamfont");
my $bdgmis = quest::saylink("#bot gate misty");
my $bdgwak = quest::saylink("#bot gate wakening");
my $bdgice = quest::saylink("#bot gate iceclad");
my $bdgdiv = quest::saylink("#bot gate divide");
my $bdgcob = quest::saylink("#bot gate cobalt");
my $bdgcomb = quest::saylink("#bot gate combines");
my $bdgsur = quest::saylink("#bot gate surefall");
my $bdggri = quest::saylink("#bot gate grimling");
my $bdgtwi = quest::saylink("#bot gate twilight");
my $bdgdaw = quest::saylink("#bot gate dawnshroud");
my $bdgnex = quest::saylink("#bot gate nexus");
my $bdgsto = quest::saylink("#bot gate stonebrunt");
my $bdgblo = quest::saylink("#bot gate bloodfields");
my $bdgeme = quest::saylink("#bot gate emerald");
my $bdgsky = quest::saylink("#bot gate skyfire");
my $bdgwos = quest::saylink("#bot gate wos");
my $bmage = quest::saylink("#bot magepet earth");
my $bmagw = quest::saylink("#bot magepet water");
my $bmaga = quest::saylink("#bot magepet air");
my $bmagf = quest::saylink("#bot magepet fire");
my $bmagm = quest::saylink("#bot magepet monster");
my $other = quest::saylink("other");
my $braid = quest::saylink("#bot raid help");
my $bsvr = quest::saylink("#bot saveraid");
my $bspnr = quest::saylink("#bot spawnraid");
my $bgprd = quest::saylink("#bot groupraid");
my $barch = quest::saylink("#bot archery");
my $bwgfay = quest::saylink("#bot gate fay");
my $bwgnk = quest::saylink("#bot gate nk");
my $bwgwk = quest::saylink("#bot gate wk");
my $bwghate = quest::saylink("#bot gate hateplane");
my $bwgair = quest::saylink("#bot gate airplane");
my $brstp = quest::saylink("#bot resist poison");
my $brstd = quest::saylink("#bot resist disease");
my $brstf = quest::saylink("#bot resist fire");
my $brstc = quest::saylink("#bot resist cold");
my $brstm = quest::saylink("#bot resist magic");
my $bcinvs = quest::saylink("#bot invis see");
my $binvsun = quest::saylink("#bot invis undead");
my $bsow35 = quest::saylink("#bot sow shrew");
my $bsow50 = quest::saylink("#bot sow feral");
my $allclas = quest::saylink("all clas");


if($text =~ /Hail/i)
	{
	quest::say("Do you need $help $name?");
	}
if($text =~ /help/i)
	{
	quest::say("Do you need help with $general, $class or $other commands ");
	}
if($text =~ /general/i)
	{
	quest::say("$bh, $bhc, $bla");
	quest::say("$bu, $bil");
	quest::say("$bga(target), $bgr(target)");
	quest::say("$bgs or $bst(target)");
	quest::say("$bgof(target)");
	quest::say("$bgog(target)");
	quest::say("$bgoa(target)");
	quest::say("Or can I $help you with something else?");	
	}
if($text =~ /class/i)
	{
	my $botclass = $npc->GetClass();
	if (($botclass == 1 || $botclass == 3|| $botclass == 5 || $botclass == 7 || $botclass ==16)){
	quest::say("Look, I'm just here to get into a fight.");
	quest::say("If you wanted a caster, you should have hired one.");
	quest::say("Anything else I can $help you out with?");
	}
	elsif ($botclass == 2){#cleric
	quest::say("$bcup, $bcud, $bcuc");
	quest::say("$bcub, $bbme, $brez");
	quest::say("$btclm, $brstp, $brstd");
	quest::say("$brstf, $brstc");
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 4){#ranger
	quest::say("$btrk, $bend");
	quest::say("$bsowr, $bsowg, $bsoww");
	quest::say("Or can I $help you with something else?");
	}
	elsif ($botclass == 6){#druid
	quest::say("$bcup, $bcud, $bcuc"); 
	quest::say("$bcub, $bevc , $btrk"); 
	quest::say("$blevi,$binvs, $bend");
	quest::say("$bsowr, $bsowg, $bsoww");
	quest::say("Indoors: $bsow35 at 35th");
	quest::say("Indoors: $bsow50 at 50th");
	quest::say("$bchr, $bdire, $bpetr");
	quest::say("$brstm, $brstp, $brstd");
	quest::say("$brstf, $brstc");
	quest::say("$bdgl");
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 8){#bard
	quest::say("$btrk");
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 9){#rogue
	quest::say("$bplk(target & stand right on door)");
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 10){#shaman
	quest::say("$bcup, $bcud, $bcuc"); 
	quest::say("$bcub, $blevi, $bshk");
	quest::say("$bsowr, $bsowg, $bsoww");
	quest::say("$brstm, $brstp, $brstd"); 
	quest::say("$brstf, $brstc, $bend"); 
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 11){#necro
	quest::say("$bcorp, $blre, $binvsun");
	quest::say("$bchr, $bdire, $bpetr");
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 12){#wizard
	quest::say("$blre, $blevi"); 
	quest::say("$binvs, $binvsun, $bcinvs");
	quest::say("$bwgl");
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 13){#mage
	quest::say("$blre, $blevi");
	quest::say("$binvs, $bcinvs");
	quest::say("$bmage, $bmagw");
	quest::say("$bmaga, $bmagf, $bmagm");
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 14){#enchanter
	quest::say("$bmez(target)"); 
	quest::say("$btclm, $blre, $blevi");
	quest::say("$binvs, $bcinvs"); 
	quest::say("$brune, $bend");
	quest::say("$bchr, $bdire, $bpetr");
	quest::say("Or can I $help you with something else?");	
	}
	elsif ($botclass == 15){#Beastlord
	quest::say("$bsowr, $bsowg");
	quest::say("$bshk");
	quest::say("Or can I $help you with something else?");	
	}
}
if($text =~ /other/i)
	{
	quest::say("$braid, $bsvr");
	quest::say("$bspnr, $bgprd, $barch");
	quest::say("List $allclas commands");
	quest::say("Or can I $help you with something else?");	
	}
if($text =~ /List Druid Gate Locations/i)
	{	
	quest::say("$bdgkar, $bdgcom");
	quest::say("$bdgtox, $bdgbut");
	quest::say("$bdglav, $bdgro");
	quest::say("$bdgfee, $bdgste");
	quest::say("$bdgmis, $bdgwak");
	quest::say("$bdgice, $bdgdiv");
	quest::say("$bdgcob, $bdgcomb");
	quest::say("$bdgsur, $bdggri");
	quest::say("$bdgtwi, $bdgdaw");
	quest::say("$bdgnex, $bdgsto");
	quest::say("$bdgblo, $bdgeme");
	quest::say("$bdgsky, $bdgwos");
	quest::say("Or can I $help you with something else?");	
	}
if($text =~ /List Wizard Gate Locations/i)
	{
	quest::say("$bdgcom, $bdgtox");
	quest::say("$bdgro, $bdgwak");
	quest::say("$bdgice, $bdgdiv");
	quest::say("$bdgcob, $bdgcomb");
	quest::say("$bdggri, $bdgtwi");
	quest::say("$bdgdaw, $bdgnex");
	quest::say("$bdgsto, $bdgblo");
	quest::say("$bdgeme, $bdgsky");
	quest::say("$bdgwos, $bwgfay");
	quest::say("$bwgnk, $bwgwk");
	quest::say("$bwghate, $bwgair");
	quest::say("Or can I $help you with something else?");	
	}
if($text =~ /all clas/i)
	{
	quest::say("$bmez(target)");
	quest::say("$bplk(target & stand right on door)");
	quest::say("$bcup, $bcud, $bcuc"); 
	quest::say("$bcub, $bbme, $btrk");
	quest::say("$btclm, $bevc, $brez");
	quest::say("$bcorp, $blre, $blevi");
	quest::say("$bsowr, $bsowg, $bsoww");
	quest::say("$binvs, $binvsun, $bcinvs");
	quest::say("$brune, $bshk, $bend");
	quest::say("$bchr, $bdire, $bpetr");  
	quest::say("$bdgl, $bwgl");
	quest::say("$bmage, $bmagw");
	quest::say("$bmaga, $bmagf, $bmagm");
	quest::say("$brstm, $brstp, $brstd");
	quest::say("$brstf, $brstc");
	quest::say("Or can I $help you with something else?");	
	}
}
I left in the old All Class listing but placed it in a link in the Other section just in case I missed something and added a few more class bot commands I was missing (indoor sow for druids). Anyone see any #bot class commands I'm missing please let me know.

Think it would be feasible to add in a bot.pl function like we do for players so a server dev could just place this script in the templates folder so all bots would pull from a script like this?
Reply With Quote