SiRoCu Posted August 29, 2017 Posted August 29, 2017 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? Quote
0 crazyarashi Posted August 29, 2017 Posted August 29, 2017 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 Quote
0 SiRoCu Posted August 29, 2017 Author Posted August 29, 2017 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. Quote
0 Akkarin Posted August 29, 2017 Posted August 29, 2017 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. Quote
0 SiRoCu Posted August 29, 2017 Author Posted August 29, 2017 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. Quote
0 SiRoCu Posted August 29, 2017 Author Posted August 29, 2017 (edited) 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 August 29, 2017 by SiRoCu Quote
Question
SiRoCu
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?
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.