1. Amadeus

    Amadeus The Maestro Staff Member

    ISXVG now supports all aspects of sending/receiving mail via the in-game mailboxes! While I'm not going to write entire sample scripts, I will give you a few snippets on how to do varoius things (with a few comments/ideas). I will leave it up to the major script authors to put together packaged scripts/executables that interact more fully with the mail system.

    Please note that all of these snippets require you to be close to a mailbox.

    1. Sending Email
    Code (Text):

    ;; You do not have to be on the 'Compose' tab in order to use this snippet
    [B]VGUI[[COLOR=blue]body_text[/COLOR]]:SetText[[COLOR=blue]This is a sample mail from me to you!][/COLOR][/B]
    ;; Note: setting the 'body_text' is a little buggy in that it won't accept
    ;; long strings at the moment.  Fix will be incoming.
    ; If you want to attach an item...
    ; Setting the "coin" values (for either sending money, or sending COD)
    ; Would you like to send it COD?
    ; Want to know how much the shipping costs will be?  (Note: Postage costs are so low that they're not included in this API.  So, this only returns a value when you're shipping an item or money.)
    [B]echo ${GV[[COLOR=blue]int,MailTotalCost[/COLOR]]}[/B]
    ; You can cancel by doing "Mail:Cancel" ...or, to send it, use this:
    II. Receiving Mail
    Code (Text):

    echo I have [B]${Mail.NumMessages}[/B] in my mailbox.
    ; You would then iterate through if you wished using the concepts below:
    echo First Message:
    echo FROM: [B]${Mail.Message[1].From}[/B]
    echo SUBJECT: [B]${Mail.Message[1].Subject}[/B]
    echo BODY: [B]${Mail.Message[1].Body}[/B]
    echo Unread: [B]${Mail.Message[1].IsUnread}[/B]
    echo ShippingFee:  [B]${Mail.Message[1].ShippingFee}[/B]
    ; Does it have money attached to it?  If so, take it!
    if ([B]Mail.Message[1].AttachedCoin[/B] > [COLOR=blue]0[/COLOR])
    ; does it have an item attached?  If so, then take it if the shipping fees
    ; are less than 1 silver.  (You would design your own 'conditions' by which
    ; you would take an item or not.)   Otherwise, Return it.
    if (${Mail.Message[1].AttachedItem(exists)})
         if ( [B]${Mail.Message[1].ShippingFee}[/B] < [COLOR=blue]100[/COLOR] )
    III. Misc.
    Code (Text):

    ; To Delete a piece of Mail
    ; To Read a piece of mail
    ; To REPLY to a piece of mail

Share This Page