I hope you get it to a point where you don't really need to predefine the mails. That would increase it's usefulness I think (so that we could like make algorithms for random mails or something). Nice script btw 🙂
Definitely going to test this out when I have the next chance to. It really looks like something that could be very useful to one of my projects.
I'll be sure to let you know once I test it if I have any feedback! Nice work!
You could have the mail system use a few script configurable variables:
$mail.sender - Set to the text to show for the Sender
$mail.subject - Set to the text to show for the Subject
$mail.text - Set to the text for the mail itself
$mail.add_attachment(item) - Set to something like "i3" to add Item ID 3, "g2000" to add 2000 Gold, etc.
$mail.send - Adds the newly generated mail to the mailbox and clears the attachments.
This gives a hook so developers can dynamically generate mail through a common event, script calls or whatever.
EDIT: Just looked at your script. You can do this by having some Global like "Current_email" which is initialized in the script, and cleared as I mentioned above. The "send" function would actually create a copy of the "Current_email" global and send the previous one into the mailbox.
Im no fan of global variables, but I could add an alternate method to add new mails dynamically, I have something in mind.
Thank you.
@Evgenij
The link provided at the OP seems to be broken.
The script seems to be quite interesting too. 🙁
Thank you very much! 🙂
Hey, I know this is an old post, but, I really like it and would love to use it. The only issue I have here is:
I want to use the system when a player buys a property (let's say mine) and it should randomly generate gold and gems and player can claim attachment and the mail repeats once now and then randomly if possible or by player triggering random events. I tried to send same mail twice, but, it didn't work. You can get only one mail and claim it, using the scriptcall changes nothing. I guess I could make like 200calls but it would just clutter the script and events.
Anyone has any idea how to do that? Randomly getting the mail with attachments and/or being able to send same mail again without making huge amount of event triggers.
If possible, anyone to have similar script for VX Ace?
Thanks for your time.