Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2015, 08:04 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default Merchant Maker.

This script will create merchants for you, all you have to do is change $id and @idarray, I wrote this a while ago but never released it. It writes to a .sql file that you can easily copy and paste from or import using HeidiSQL or Navicat.
Code:
sub Create {
    print "Starting!\n";
    my $id = CHANGEME;
    my @idarray = (CHANGEME);
    open my $file, ">Merchant $id.sql";
    my $message = "INSERT INTO `merchantlist` VALUES\n";
    my $slot = 0;
    foreach my $item (@idarray) {
        $message .= "('$id', '" . ++$slot . "', '$item', '-1100', '0', '0', '65535', '100')" . (($item != $idarray[$#idarray]) ? ",\n" : ";");
    }
    print "Done!\n";
    say $file $message;
    close $file;
}
Create();
Reply With Quote
  #2  
Old 08-29-2015, 05:51 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

I have since updated this script:
Code:
sub Create {
    my $merchant_id = shift;
    my $data = shift;
    my @items = split(/ /, $data);
    chomp $items[$#items];
    print "Starting!\n";
    open my $file, ">Merchant $merchant_id.sql";
    my $message;
    my $n = 1;
    foreach my $item (@items) {
        print "Adding item $item.\n";
        $message .= "INSERT INTO `merchantlist` VALUES ('$merchant_id', '" . $n++ . "', '$item', '-1100', '', '0', '65535', '100');\n";
    }
    say $file $message;
    print "Done!\n";
    close $file;
}
print "What is the merchant id?\n";
my $merchant_id = int(<STDIN>);
print "List the items you would like on the merchant.\n";
my $data = <STDIN>;
Create($merchant_id, $data);
Here is an example of use:
Reply With Quote
  #3  
Old 08-31-2015, 05:28 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Found an issue:
Code:
$message .= "INSERT INTO `merchantlist` VALUES ('$merchant_id', '" . $n++ . "', '$item', '-1100', '', '0', '65535', '100');\n";
Should be:
Code:
$message .= "INSERT INTO `merchantlist` VALUES ('$merchant_id', '" . $n++ . "', '$item', '-1100', '0', '0', '65535', '100');\n";
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 07:58 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