Trying to kmail a package to a group of players

MackTheFife

New member
I'm trying to create a gag package for my clannies. I can see how to do kmail using ZLIB, but I'd like to do something simple. Here it is as a high-level concept:

message="Boo!"
package = (item1, item2, item3)
clannies = (clannie1, clannie2, clannie3)

for each clannie:
kmail(clannie, message, 0[zero meat], package)

This ought to be easy, but I don't know ASH well enough to get the item list built.
I don't need the clannie and item lists in files, although they can be.
 
Here you go. Just edit the first part to your liking.

Code:
import <zlib.ash>

int[item] package;

// This is the list of people to send the package too.
// Place each name separated by commas
boolean[string] clannies = $strings[clannie1, clannie2];

// This is the package list:
// It contains the items to send and the amount of each to send
package[$item[Twinkly wad]] = 1;
package[$item[Hot wad]] = 1;
//package[$item[]] = 1;

void main(){

    foreach clannie in clannies{
        print("Sending package to "+clannie+"...");
        if(kmail(clannie, "Boo!" , 0, package))
            print("Package sucessfully sent to "+clannie, "green");
        else
            print("Something went wrong with the Kmail to "+clannie, "red");
    }
}
 

slyz

Developer
If you want to maintain a list of packages in a separate data file, you can have a look at the script in this thread (towards the end there is a working version).
 

MackTheFife

New member
Thanks, slyz. I've studied that script (in fact, I'm one of the two users of that script, and THANK YOU for writing it.) It gave me the idea for this one. But I'm very green at ash, and java-type languages in general.

If I could ask for one more hint: The file_to_map function is not quite clear to me. If I put the clannie names in a file, how would I format that file, and refer to the resulting record? I experimented with the WelcomePackages format for hours, and never understood it.



If you want to maintain a list of packages in a separate data file, you can have a look at the script in this thread (towards the end there is a working version).
 

moooo566

New member
Would it be possible to get this script to send to a larger list (like a /who), or does that go against some anti-spamming guard?

Edit: Err *Facepalm*. I can just copy the list in, since it just uses commas, can I not?
 
Last edited:

mredge73

Member
Mafia will not automatically grab names from the chat box to fill the names automatically. You will have to do that manually and paste them into your script. The list can be as long as you like.

Now if you wanted to spam your clannies that are currency online, that can be done with some clever copy/paste from a couple of scripts in these forums.
 
Top