Jump to content
  • 0

How can I send notification to my hotmail box from ingame script?


SiRoCu

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  08/19/17
  • Last Seen:  

How can I send some messages to my hotmail box for real-time alert on my mobile from NPC in game when user enter some code into that NPC?

 

Is there a script functions or need to develop and rebuild C source code to do that job?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

8 minutes ago, SiRoCu said:

How can I send some messages to my hotmail box for real-time alert on my mobile from NPC in game when user enter some code into that NPC?

 

Is there a script functions or need to develop and rebuild C source code to do that job?

Have you check this out? :))
Email Topic

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  08/19/17
  • Last Seen:  

1 hour ago, crazyarashi said:

Have you check this out? :))
Email Topic

Thank to reply :)

But my server is running on linux box. Need a try.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3127
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

The quickest way would be to make the npc write a row to the sql db, use a php script to pull the data and display as an rss feed, use php script to check for new entries and send an email based on what's going on. If you have little to no Web experience I suggest using something like Zapier. 

However, the correct way to do this would be to add email functionality into the mapserver. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  08/19/17
  • Last Seen:  

4 hours ago, Akkarin said:

The quickest way would be to make the npc write a row to the sql db, use a php script to pull the data and display as an rss feed, use php script to check for new entries and send an email based on what's going on. If you have little to no Web experience I suggest using something like Zapier. 

However, the correct way to do this would be to add email functionality into the mapserver. 

Thank you to reply.

Well, adding email functionality look like the best solution.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  08/19/17
  • Last Seen:  

This is my function in map/script.c 

Work best with SMTP authentication & mail client on linux box.

Useage: sendmail "messages..."; or sendmail("messages...");

---------------- +Code ----------------

#include<string.h>
#include<stdio.h>

.

.

BUILDIN_FUNC(sendmail)
{
    struct npc_data* nd = NULL;
    const char* str = script_getstr(st,2);

    if (script_hasdata(st, 3))
        nd = npc_name2id(script_getstr(st, 3));
    else
        nd = (struct npc_data *)map_id2bl(st->oid);

    if (nd != NULL && nd->chat_id) {
        char message[80];
        safesnprintf(message, sizeof(message), "%s", str);
        char newstr[256];
        strcpy(newstr, "echo \"");
        strcat(newstr, message);
        strcat(newstr, "\"  | mail -s \"Fixed Subject\"  [email protected]");
        system(newstr);
    }
    return SCRIPT_CMD_SUCCESS;
}

.

.

BUILDIN_DEF(sendmail,"s?"),

Edited by SiRoCu
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...