Register for your free account! | Forgot your password?

You last visited: Today at 04:25

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Auto Message Sender

Discussion on [Release] Auto Message Sender within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
[Release] Auto Message Sender

Is there really any name for this? Anyways, this is a simple release of how to send messages to the server. The timer is set to 4 minutes, and yeah I think it SHOULD work, if not post whats wrong and ill fix it, havent tested it.

For you who want to learn:
I set the timer at 4 minutes, 240000 milliseconds. Therefore, I start the timer and it all begins! When 4 minutes have gone, it will look up the void "MsgTimer_Elapsed". Once it find it, it will check if MsgCount is either 1,2,3 or 4. If its 4, it will put the MsgCount to 0. But now you are thinking, there isnt a msgcount check for the number zero, minimum is one?! Yeah, you're right, but if you look at the World.SendMsgToAll, under that it pluses the MsgCount, so it will automatically be 1 once its 0.







In General.cs:
Search for:
public static System.Timers.Timer Thetimer;
Under, add:

Quote:
public static System.Timers.Timer MsgTimer;
public static int MsgCount = 1;
Search for:
Thetimer.Start();
Under, add:

Quote:
MsgTimer = new System.Timers.Timer();
MsgTimer.Interval = 240000;
MsgTimer.Elapsed += new ElapsedEventHandler(MsgTimer_Elapsed);
MsgTimer.Start();

Now search for :
public static void DoStuff()

Above it, add:

Code:
public static void MsgTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            string text = "";
            if (MsgCount == 1)
                text = "Example 1";
            else if (MsgCount == 2)
                text = "Example 2";
            else if (MsgCount == 3)
                text = "Example 3";
            else if (MsgCount == 4)
            {
                MsgCount = 0;
                text = "Example 4";
        }
            World.SendMsgToAll(text, "[GM]", 2011);
            MsgCount++;
             
        }
Just edit the "Example" text to whatever you want server to say.

Enjoy, press thanks.
_Emme_ is offline  
Thanks
16 Users
Old 01/04/2009, 13:45   #2
 
elite*gold: 0
Join Date: Sep 2008
Posts: 348
Received Thanks: 141
Nice..!!!
!DeX! is offline  
Old 01/04/2009, 13:46   #3
 
sherwin9's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 222
Received Thanks: 27
Ah nice release, It's very clear, Again, I learned from it
sherwin9 is offline  
Old 01/04/2009, 13:48   #4
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
You are welcome. Anything else you would see me release? Im not going to release codes that may give my server competetion, just so you know.
_Emme_ is offline  
Old 01/04/2009, 13:55   #5
 
sherwin9's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 222
Received Thanks: 27
Omg you still need to make the 2 parents making baby and then suddenly there is this crying baby remember :P
sherwin9 is offline  
Old 01/04/2009, 16:07   #6
 
L1nk1n*P4rK's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 303
Received Thanks: 39
Nice....thnks for releasing this.
L1nk1n*P4rK is offline  
Old 01/04/2009, 16:14   #7
 
~Demented~'s Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 183
Received Thanks: 70
cool hope we will be seeing more of u xD
~Demented~ is offline  
Old 01/04/2009, 17:30   #8


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Emme, you have to learn to stop using hundreds and hundreds of timers, everytime you start a new timer you start a new thread, starting loads of threads is bad -.-.

Obviously there is a trade off between the number of threads you NEED and the performance gains, but seriously the amount of things youve released that use timers, i would hate to see your source, and i hate to imagine what would happen with 50 or so players online, it would be horrible....

Im now expecting a reply from you stating that you dont use as many timers and that you understand the performance gains and loses from using so many timers, but honestly i cant beleive that, every release youve made has included a timer >.<
Korvacs is offline  
Old 01/04/2009, 17:58   #9
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
Ive using one timer in my source, haha. Ofcourse, I know this can be done in many many other ways, but hey, its epvp, people dont care about quality here. But if anyone is intrested,I could code this better to show you the difference.
_Emme_ is offline  
Old 01/04/2009, 18:22   #10


 
MeGaMaX's Avatar
 
elite*gold: 37752
Join Date: Sep 2006
Posts: 1,089
Received Thanks: 2,609
cool
MeGaMaX is offline  
Old 01/05/2009, 18:04   #11
 
Kital82's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 129
Received Thanks: 15
Quote:
Originally Posted by EmmeTheCoder View Post
Ive using one timer in my source, haha. Ofcourse, I know this can be done in many many other ways, but hey, its epvp, people dont care about quality here. But if anyone is intrested,I could code this better to show you the difference.
I would like to see it
I'm learning when coding my source but it's not much ...
Kital82 is offline  
Old 01/06/2009, 01:49   #12
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
Only LOTF compatible as usual.
scottdavey is offline  
Old 01/06/2009, 12:20   #13
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
@scott
There is no other public source that is as far as LOTF is right now. Im only teaching people,
_Emme_ is offline  
Old 03/15/2009, 16:00   #14
 
elite*gold: 0
Join Date: Dec 2006
Posts: 133
Received Thanks: 16
Thank's!
martoon is offline  
Old 03/15/2009, 16:35   #15


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
Necropost
KraHen is offline  
Reply


Similar Threads Similar Threads
«[Release]» Metin2 Radio player - 11 Sender - By Braver
05/11/2010 - Metin2 PServer Guides & Strategies - 20 Replies
Hallo, seit kurzem habe ich einen Metin2 Radio Player gemacht. Er Besitz 11 Sender Darunter sind folgene Genere: Techno Disco House Gemischt Disco Bass-Stadion
Message Sender by List
04/08/2009 - Silkroad Online - 0 Replies
Hello, some time ago there was a tool which was able to send msg to people by .txt list :) It was like an In-Game E-Mail spammer. Maybe anybody have it ? It would be really usefull, when doing plvl, you made all trustfull noobs pay'ers list, and send them a msg, about info and so on...



All times are GMT +1. The time now is 04:27.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.