TwinklyGiveaway - Script Request

codster62

Member
I am looking for a script that will use k-mail and send specific items to a list of people in my clan who I am currently supplying wads to. For example I need a script that will send wads to these people, however, people are joining my service(available to clannies only) and I need to be able to add people to this list if needed. I will pay meat for the creation of this script. Not much, but like 250-500k.

Guelerme - 15 twinkly
Dricoleth - 15 twinkly
Deatharte - 15 twinkly
Hadanelith - 1 prismatic
Rotund - 15 twinkly
DrM94 - 15 twinkly
 
It would be helpful to know if you are ever going to need to send more than one kind of wad to the same person.

(I'm not going to do this, too busy in real life right now, but it the question popped into my head when considering the question, so other potential scripters might want to know too -- the request is very easy if your answer is "No".)
 
I'm not exactly sure this is what you want. I assume from the title that this is a one time giveaway and not something that will be changing? I'm confused because of your use of the words "supplying" & "service".

Anyways, here you go. You can add people to the map at the beginning of the script. I've already added the people you listed, just follow the same format as them.

Edit: If this isn't what you want you'll need to be more specific.
Edit 2: This requires zlib for it's kmail function.
 

Attachments

  • giveaway.ash
    798 bytes · Views: 42
Last edited:

slyz

Developer
I have been ninja'd already, but here was my solution, using the CLI's send function:

Code:
string message = "There you go!";
string [string] [int] GiveawayList;
file_to_map("TwinklyGiveaway_data.txt",GiveawayList);

string command;
string sendItemStr;
item sendItem;
foreach playername, numToSend in GiveawayList {
   sendItemStr = GiveawayList[playername][numToSend] + " wad";
   sendItem = sendItemStr.to_item();
   if ( sendItem == $item[none] ) {
      print("Item to be send to " + playername + " not recognized","red");
      continue;
   }
   if ( item_amount(sendItem) < numToSend ) {
      print("Not enough " + sendItemStr + "s to send to " + playername,"red");
      continue;
   }
   command = "send " + numToSend.to_string() + " " + GiveawayList[playername][numToSend] + " wad to " + playername + " || " + message;
   cli_execute(command);
}

You would need to have a file named TwinklyGiveaway_data.txt in Mafia's data folder formatted like this:

Code:
Guelerme	15	twinkly
Dricoleth	15	twinkly
Deatharte	15	twinkly
Hadanelith	1	prismatic
Rotund	15	twinkly
DrM94	15	twinkly

with tabs between entries.

You just need to modify the first line in the code to change the message people would get, and update TwinklyGiveaway_data.txt when you need.

This will only work with items that end in " wad".

Edit: regarding aqualectrix's question, you just need to add a second line with the same player name and a different kind of wad (either in Ninja's script, either in my datafile), to send more than one type of wads to the same person.
 

Attachments

  • TwinklyGiveaway.ash
    751 bytes · Views: 41
  • TwinklyGiveaway_data.txt
    125 bytes · Views: 53
Last edited:

codster62

Member
Thanks alot for the superquick responses guys! This is actually not a one time thing, but something I will be doing for awhile, so it would really help me! I will check out both of them and see which one works the best and pay accordingly, although I appreciate both of your efforts. =)
 

codster62

Member
Ok, I looked over the scripts, and I like teh second one better. Works great, and has a data file for easy access and customizability. Thanks, k-mail me(coolbufferbot) in game and I will send you meat.
 
Top