Thread: Merchant Maker.
View Single Post
  #1  
Old 05-25-2015, 08:04 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
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