Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 11-28-2014, 10:25 PM
Nibiuno
Hill Giant
 
Join Date: Mar 2010
Posts: 101
Default Tradeskill Bot

Anyone have any idea why this script isnt working when the NPC is given 5000pp? It just eats the money and doesnt do anything

Code:
sub EVENT_SAY 
{
	my $tradeskills = quest::saylink("tradeskills");
	my $repick = quest::saylink("repick");
	my $alchemy = quest::saylink("alchemy");
	my $baking = quest::saylink("baking");
	my $brewing = quest::saylink("brewing");
	my $fishing = quest::saylink("fishing");
	my $fletching = quest::saylink("fletching");
	my $jewelcraft = quest::saylink("jewelcraft");
	my $poisons = quest::saylink("poisons");
	my $pottery = quest::saylink("pottery");
	my $smithing = quest::saylink("smithing");
	my $research = quest::saylink("research");
	my $tailoring = quest::saylink("tailoring");
	my $tinkering = quest::saylink("tinkering");
	if($text=~/Hail/i) {
		quest::say("Greetings $name. Would you like to learn some [$tradeskills]?"); 
	}

	if($text=~/tradeskills/i && !defined $qglobals{"tsm_alchemy"} && !defined $qglobals{"tsm_baking"} && !defined $qglobals{"tsm_brewing"} && !defined $qglobals{"tsm_fishing"} && !defined $qglobals{"tsm_fletching"} && !defined $qglobals{"tsm_jewelcraft"} && !defined $qglobals{"tsm_poisons"}  && !defined $qglobals{"tsm_pottery"} && !defined $qglobals{"tsm_smithing"} && !defined $qglobals{"tsm_research"} && !defined $qglobals{"tsm_tailoring"} && !defined $qglobals{"tsm_tinkering"}){
		quest::say("I will train you in a tradeskill for 5000pp each.  Simply say the tradekill you want to learn and then hand me 5000pp.  Would you like to learn [$alchemy], [$baking], [$brewing], [$fishing], [$fletching], [$jewelcraft], [$poisons], [$pottery], [$smithing], [$research], [$tailoring] or [$tinkering]?");
	} elsif($text=~/tradeskills/i) {
		quest::say("I believe you owe me some money for the last request you made.  Would you like to [$repick] the tradeskill you wish to learn?");
	}
	if($text=~/repick/i) {
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
		quest::say("I can once again train your [$tradeskills].");
	}
	if($text=~/alchemy/i && !defined $qglobals{"tsm_alchemy"}) {
		quest::say("Give me 5000pp and I will train you in alchemy.");
		quest::setglobal("tsm_alchemy", 1, 5, "F");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/baking/i && !defined $qglobals{"tsm_baking"}) {
		quest::say("Give me 5000pp and I will train you in baking.");
		quest::setglobal("tsm_baking", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/brewing/i && !defined $qglobals{"tsm_brewing"}) {
		quest::say("Give me 5000pp and I will train you in brewing.");
		quest::setglobal("tsm_brewing", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/fishing/i && !defined $qglobals{"tsm_fishing"}) {
		quest::say("Give me 5000pp and I will train you in fishing.");
		quest::setglobal("tsm_fishing", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/fletching/i && !defined $qglobals{"tsm_fletching"}) {
		quest::say("Give me 5000pp and I will train you in fletching.");
		quest::setglobal("tsm_fletching", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/jewelcraft/i && !defined $qglobals{"tsm_jewelecraft"}) {
		quest::say("Give me 5000pp and I will train you in jewelcraft.");
		quest::setglobal("tsm_jewelcraft", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/poisons/i && !defined $qglobals{"tsm_poisons"}){
		quest::say("Give me 5000pp and I will train you in making poisons.");
		quest::setglobal("tsm_poisons", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/pottery/i && !defined $qglobals{"tsm_pottery"}) {
		quest::say("Give me 5000pp and I will train you in pottery.");
		quest::setglobal("tsm_pottery", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/smithing/i && !defined $qglobals{"tsm_smithing"}) {
		quest::say("Give me 5000pp and I will train you in smithing.");
		quest::setglobal("tsm_smithing", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/research/i && !defined $qglobals{"tsm_research"}) {
		quest::say("Give me 5000pp and I will train you in researching spells.");
		quest::setglobal("tsm_research", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_tailoring");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/tailoring/i && !defined $qglobals{"tsm_tailoring"}) {
		quest::say("Give me 5000pp and I will train you in tailoring.");
		quest::setglobal("tsm_tailoring", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tinkering");
	}
	if($text=~/tinkering/i && !defined $qglobals{"tsm_tinkering"}) {
		quest::say("Give me 5000pp and I will train you in tinkering.");
		quest::setglobal("tsm_tinkering", 1, 5, "F");
		quest::delglobal("tsm_alchemy");
		quest::delglobal("tsm_baking");
		quest::delglobal("tsm_brewing");
		quest::delglobal("tsm_fishing");
		quest::delglobal("tsm_fletching");
		quest::delglobal("tsm_jewelcraft");
		quest::delglobal("tsm_poisons");
		quest::delglobal("tsm_pottery");
		quest::delglobal("tsm_smithing");
		quest::delglobal("tsm_research");
		quest::delglobal("tsm_tailoring");
	}

    if($platinum == 5000) {
		if(defined $qglobals{"tsm_alchemy"}) {
			quest::setskill(59,400);
			quest::delglobal("tsm_alchemy");
			quest::say("You are now an expert at alchemy.");
		} elsif(defined $qglobals{"tsm_baking"}) {
			quest::setskill(60,400);
			quest::delglobal("tsm_baking");
			quest::say("You are now an expert at baking.");	
		} elsif(defined $qglobals{"tsm_brewing"}) {
			quest::setskill(65,400);
			quest::delglobal("tsm_brewing");
			quest::say("You are now an expert at brewing.");	
		} elsif(defined $qglobals{"tsm_fishing"}) {
			quest::setskill(55,400);
			quest::delglobal("tsm_fishing");
			quest::say("You are now an expert at fishing.");	
		} elsif(defined $qglobals{"tsm_fletching"}) {
			quest::setskill(64,400);
			quest::delglobal("tsm_fletching");
			quest::say("You are now an expert at fletching.");	
		} elsif(defined $qglobals{"tsm_jewelcraft"}) {
			quest::setskill(68,400);
			quest::delglobal("tsm_jewelcraft");
			quest::say("You are now an expert at jewelcraft.");	
		} elsif(defined $qglobals{"tsm_poisons"}) {
			quest::setskill(56,400);
			quest::delglobal("tsm_poisons");
			quest::say("You are now an expert at poisons.");	
		} elsif(defined $qglobals{"tsm_pottery"}) {
			quest::setskill(69,400);
			quest::delglobal("tsm_pottery");
			quest::say("You are now an expert at pottery.");	
		} elsif(defined $qglobals{"tsm_smithing"}) {
			quest::setskill(63,400);
			quest::delglobal("tsm_smithing");
			quest::say("You are now an expert at smithing.");	
		} elsif(defined $qglobals{"tsm_research"}) {
			quest::setskill(58,400);
			quest::delglobal("tsm_research");
			quest::say("You are now an expert at research.");	
		} elsif(defined $qglobals{"tsm_tailoring"}) {
			quest::setskill(61,400);
			quest::delglobal("tsm_tailoring");
			quest::say("You are now an expert at tailoring.");	
		} elsif(defined $qglobals{"tsm_tinkering"}) {
			quest::setskill(57,400);
			quest::delglobal("tsm_tinkering");
			quest::say("You are now an expert at tinkering.");	
		} else {
			quest::say("Sorry this did not work");
		}
	}
}
Reply With Quote
  #2  
Old 11-28-2014, 10:28 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Because platinum is an item not text interaction.
Reply With Quote
  #3  
Old 11-28-2014, 10:29 PM
Nibiuno
Hill Giant
 
Join Date: Mar 2010
Posts: 101
Default

Quote:
Originally Posted by joligario View Post
Because platinum is an item not text interaction.
Man, EVENT_ITEM

I feel dumb, thanks lol
Reply With Quote
  #4  
Old 11-28-2014, 10:44 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

If you are allowing them to just buy for 5000plat through a saylink.. this could be the text to match.. would make your script much easier / shorter.




TakeMoneyFromPP is in Copper... and returns a True / False if you have enough money on PERSON (doesnt look in bank)

Will only train if they say "Train blacksmithing" and their skill is under 400 and they have 5000platinum

Code:
if ($text=~/train blacksmithing/i && $client->GetRawSkill(63) < 400 && $client->TakeMoneyFromPP(5000000)) { 
	quest::setskill(63,400);
	quest::say("You are now an expert at smithing.");
}

Just a suggestion.. if you have any questions you can PM me
Reply With Quote
  #5  
Old 11-29-2014, 09:18 AM
Nibiuno
Hill Giant
 
Join Date: Mar 2010
Posts: 101
Default

Thanks, Ill update it with that. I need to go over all of the plugins and built in functions before diving right in to building these.

Im writing a time raid script for plane of time today so Ill probably ask more dumb questions by tomorrow.

Quote:
Originally Posted by NatedogEZ View Post
If you are allowing them to just buy for 5000plat through a saylink.. this could be the text to match.. would make your script much easier / shorter.




TakeMoneyFromPP is in Copper... and returns a True / False if you have enough money on PERSON (doesnt look in bank)

Will only train if they say "Train blacksmithing" and their skill is under 400 and they have 5000platinum

Code:
if ($text=~/train blacksmithing/i && $client->GetRawSkill(63) < 400 && $client->TakeMoneyFromPP(5000000)) { 
	quest::setskill(63,400);
	quest::say("You are now an expert at smithing.");
}

Just a suggestion.. if you have any questions you can PM me
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:19 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3