Ping? Pong! Plugin - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Forum: Plug-Ins (/forumdisplay.php?fid=28) +------ Thread: Ping? Pong! Plugin (/showthread.php?tid=12472) Ping? Pong! Plugin by segosa on 07-07-2003 at 01:23 PM
Thanks to patchou for the Idea RE: Ping? Pong! Plugin by musicalmidget on 07-07-2003 at 01:42 PM Excellent! I like it. RE: Ping? Pong! Plugin by user2319 on 07-07-2003 at 02:44 PM * user2319 waits for the time RE: Ping? Pong! Plugin by user2319 on 07-07-2003 at 03:06 PM
He says he's concentrating.. RE: Ping? Pong! Plugin by segosa on 07-07-2003 at 03:12 PM Yeah and its impossible on my own maybe with patchous help.. but i've tried and .. doesnt look bright, i know patchou could though. RE: Ping? Pong! Plugin by trax on 07-07-2003 at 03:33 PM
is it opensource?? RE: RE: Ping? Pong! Plugin by user2319 on 07-07-2003 at 03:38 PM
quote: he said it won't work RE: Ping? Pong! Plugin by segosa on 07-07-2003 at 03:45 PM Yeah and im not releasing the source so someone can modify my code and take the credit *cough* Sorry Patchou * cough* hehe ¬_¬ RE: Ping? Pong! Plugin by user2319 on 07-07-2003 at 03:53 PM hehe.. make it gpl then RE: Ping? Pong! Plugin by trax on 07-07-2003 at 04:49 PM
I don't know if this works.. RE: RE: Ping? Pong! Plugin by segosa on 07-07-2003 at 05:56 PM
quote: I've tried that mutliple times but even though sometimes it seems possible. it isnt RE: Ping? Pong! Plugin by trax on 07-07-2003 at 06:01 PM
ahh ok RE: RE: RE: Ping? Pong! Plugin by Finn on 07-07-2003 at 07:21 PM
quote: you mean like this? ////////////////////////////////////////////////////////////////////// // // // Project: Messenger Plus! simple plugin in language C // // Author: Patchou // // Last Update: 2003/07/02 // // // // For more help, please read the documentation in MPPluginHeader.h // // // ////////////////////////////////////////////////////////////////////// #include "MPPluginC.h" #include <stdio.h> #include <time.h> ////////////////////////////////////////////////////////////////////// // // // Purpose: DLL Entry Point // // // ////////////////////////////////////////////////////////////////////// BOOL APIENTRY DllMain(HANDLE hModule, DWORD nReason, void* pReserved) { return TRUE; } ////////////////////////////////////////////////////////////////////// // // // Purpose: Initialization function // // // ////////////////////////////////////////////////////////////////////// MPPLUGIN_RETURN_BOOL Initialize(/*[in]*/ DWORD nVersion, /*[in]*/ const char* sUserEmail, /*[in]*/ IDispatch* iMessengerObj) { return TRUE; } ////////////////////////////////////////////////////////////////////// // // // Purpose: Uninitialization function // // // ////////////////////////////////////////////////////////////////////// MPPLUGIN_RETURN_VOID Uninitialize() { } char * ConvertHex(char *string, unsigned int *Val) { int len = 8; int ret = 0; while (*string && len > 0) { int toups = toupper(*(string++)); if (toups >= '0' && toups <= '9') { ret<<=4; ret += toups - '0'; } else if (toups >= 'A' && toups <= 'F') { ret<<=4; ret += (toups - 'A') + 10; } len--; } *Val = ret; return string; } char *WriteHex(char *Buf, unsigned int dw) { static char* Hex = "0123456789ABCDEF"; *(Buf++) = Hex[(dw>>28)&0xF]; dw<<=4; *(Buf++) = Hex[(dw>>28)&0xF]; dw<<=4; *(Buf++) = Hex[(dw>>28)&0xF]; dw<<=4; *(Buf++) = Hex[(dw>>28)&0xF]; dw<<=4; *(Buf++) = Hex[(dw>>28)&0xF]; dw<<=4; *(Buf++) = Hex[(dw>>28)&0xF]; dw<<=4; *(Buf++) = Hex[(dw>>28)&0xF]; dw<<=4; *(Buf++) = Hex[(dw>>28)&0xF]; dw<<=4; return Buf; } int bDisablePING; int bDisablePONG; ////////////////////////////////////////////////////////////////////// // // // Purpose: Provide new commands in Messenger Plus! // // // ////////////////////////////////////////////////////////////////////// MPPLUGIN_RETURN_BOOL ParseCommand(/*[in]*/ const char* sCommand, /*[in]*/ const char* sCommandArg, /*[in]*/ PLUGIN_PARAM* pParam, /*[out]*/ char* sResult) { //The first sample command displays a hello box and cancels the //message if(stricmp(sCommand, "/xping") == 0) { *(sResult++) = *sCCNotify; strcpy(sResult, "PING!"); //The notify code must be 5 characters long sResult+= 5; sResult = WriteHex(sResult, clock()); strcpy(sResult, " Ping Request"); bDisablePING = TRUE; return TRUE; } return FALSE; } ////////////////////////////////////////////////////////////////////// // // // Purpose: Provide new tags in Messenger Plus! // // // ////////////////////////////////////////////////////////////////////// MPPLUGIN_RETURN_BOOL ParseTag(/*[in]*/ const char* sTag, /*[in]*/ PLUGIN_PARAM* pParam, /*[out]*/ char* sResult) { return FALSE; } //static char buf[4096]; DWORD WINAPI ShowResult( void *Param) { unsigned int MSTaken = (unsigned int)Param; char buf[200]; wsprintf((char*)buf, "Ping Result was %4dMS", MSTaken); MessageBox(NULL, buf, "PONG!", MB_OK); return 1; } ////////////////////////////////////////////////////////////////////// // // // Purpose: Allow special actions when a plugin text is received // // // ////////////////////////////////////////////////////////////////////// MPPLUGIN_RETURN_BOOL ReceiveNotify(/*[in]*/ const char* sNotifyCode, /*[in]*/ const char* sText, /*[in]*/ PLUGIN_PARAM* pParam, /*[out]*/ char* sTextToSend) { if(strcmp(sNotifyCode, "PING!") == 0 && strlen(sText) > 7) { if (!bDisablePING) { *(sTextToSend++) = *sCCNotify; strcpy(sTextToSend, "PONG!"); //The notify code must be 5 characters long sTextToSend += 5; strncpy(sTextToSend, sText, 8); sTextToSend += 8; strcpy(sTextToSend, " Ping Reply"); bDisablePONG = TRUE; } bDisablePING = FALSE; return TRUE; } if(strcmp(sNotifyCode, "PONG!") == 0 && strlen(sText) > 7) { if (!bDisablePONG) { DWORD ID; clock_t StartTime; ConvertHex((char*)sText, (unsigned int*)&StartTime); StartTime = ((clock() - StartTime) * 1000) / CLOCKS_PER_SEC; CloseHandle(CreateThread(NULL, 0, ShowResult, (void*)StartTime, 0, &ID)); } bDisablePONG = FALSE; return TRUE; } return FALSE; return FALSE; } RE: Ping? Pong! Plugin by surfichris on 07-08-2003 at 01:46 AM I have nearly done one with times, just need to test it now. RE: Ping? Pong! Plugin by BooGhost on 07-08-2003 at 01:49 AM i'd love being a beta tester RE: Ping? Pong! Plugin by segosa on 07-08-2003 at 06:11 AM
I've finished mine which says the time!!! RE: Ping? Pong! Plugin by trax on 07-08-2003 at 06:26 AM So what was the solution? RE: Ping? Pong! Plugin by segosa on 07-08-2003 at 06:43 AM http://shoutbox.menthix.net/showthread.php?tid=12546 have a look there |