Initial Upload
Initial Upload
This commit is contained in:
41
_module/nss/mail_conv_msgcnt.nss
Normal file
41
_module/nss/mail_conv_msgcnt.nss
Normal file
@@ -0,0 +1,41 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Mail - Conversation, Message Count
|
||||
//:: mail_conv_msgcnt.nss
|
||||
//:: Copyright (c) 2003 Jake E. Fitch
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Report the number of messages the Character has.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jake E. Fitch (Milambus Mandragon)
|
||||
//:: Created On: Jan. 6, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "mail_include"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
object oMailman = GetNearestObjectByTag("Mailman", oPC);
|
||||
|
||||
int iMessageCount = 0;
|
||||
int iNewMessageCount = 0;
|
||||
|
||||
int iMB = GetLocalInt(oMailman, "mail_Mailbox");
|
||||
int iLastMessage = GetCampaignInt(DBName, "LastMessage");
|
||||
int iCounter;
|
||||
|
||||
for (iCounter = 1; iCounter <=iLastMessage; iCounter++) {
|
||||
if(iMB == GetCampaignInt(DBName, "T" + IntToString(iCounter))) {
|
||||
iMessageCount++;
|
||||
|
||||
if(!GetCampaignInt(DBName, "R" + IntToString(iCounter))) iNewMessageCount++;
|
||||
}
|
||||
}
|
||||
|
||||
string sMessage = "You have " + IntToString(iNewMessageCount) + " new messages, and " + IntToString(iMessageCount) + " total messages.";
|
||||
|
||||
SetCustomToken(8000, sMessage);
|
||||
|
||||
return TRUE;
|
||||
}
|
Reference in New Issue
Block a user