Kmail Library

DaMaster0

Member
Kmaillib.ash!​

I been having a lot of trouble dealing with kmails, sending them, reading them, and deleting them, so I put together this library! Keep in mind, this is all Zarqon's work, and I am not trying to take credit for it. All I did was group it from several of his scripts and made some functions out of it.

The funtions:

First of all, it will make a variable type message.

message[int] parse_mail()

I'm pretty sure everyone is familiar with this, but it returns a map of all your kmails.

All of zarqon's kmail sending and gifting scripts.

You can read about them here.

boolean delete_mail(boolean[int]erase)

Accepts a map with the int as the kmail id and the boolean set to true. Then it deletes all the mail in the map.

The rest of these are just more functions to help you delete mail:

boolean delete_recent_mail(boolean parse, int num, message[int]mail)
boolean delete_recent_mail(int num, message[int]mail)
boolean delete_recent_mail(int num)


These functions will delete the mail based on how recent it is. Put in 0 for num, and it deletes the most recent mail, 1 for the second most recent, ect. The parse bool is so you can choose not to parse incase you don't want to delete something that might've come in at the last second. In the first function, you have to configure everything. Whether to parse or not, which kmail to delete, and feed it a map. The second function will say false to parsing, and will instead ask for a map to delete the mail from. The third function will parse, and then delete the mail.

boolean delete_all_mail(boolean parse, message[int]mail)
boolean delete_all_mail(message[int]mail)
boolean delete_all_mail()


Like delete_recent_mail, delete_all_mail will ask you if you want to parse or not. The first function will ask if you want to parse, and request a map. The second function will say no to parsing, just asking for a map of your mail. And the third function will parse. These functions will delete all the mail in your inbox.

Bugs!!

This script will not work if you include zlib in your projects, for some of the function names are the same. There might also be other reasons as well, being the exact same code and all.

Please report all bugs you find here!
 

Attachments

  • kmaillib.ash
    6.2 KB · Views: 148

Bale

Minion
Considering that this is intended to be a library of functions like zlib, it would be good if they could work and play nice. Rather than make it incompatible with zlib, wouldn't it be better that you take one of the following approaches.
  1. Include zarqon's zlib instead of copying those functions.
  2. Rename your functions.
Just sayin'
 

DaMaster0

Member
Considering that this is intended to be a library of functions like zlib, it would be good if they could work and play nice. Rather than make it incompatible with zlib, wouldn't it be better that you take one of the following approaches.
  1. Include zarqon's zlib instead of copying those functions.
  2. Rename your functions.
Just sayin'


I guess I could.... I'm just worried that I'll have some compatiblility problems other than the functions names. I'll do that in the morning. It's ten at night were I am and I'm typing this on my phone.:p
 
Top