Register for your free account! | Forgot your password?

You last visited: Today at 01:09

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


time problem.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 66
time problem.

first of all i want to say that i know this is not the best way, its for testing.

i created a code which will use this effect on you every 5 sec, and idk whats wrong but it keep using every 60 sec = 1min.

i rly dont understand why? here is the code

Code:
                            if (DateTime.Now.Second <= 05 && DateTime.Now.Second <= 00)
                            {
                                if (client.Entity.Level == 140)
                                {

                                    _String str = new _String(true);
                                    str.UID = client.Entity.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("break_start");
                                    client.SendScreen(str, true);

                                }
                            }

any idea why?



LordGragen. is offline  
Old 05/05/2013, 19:46   #2
 
elite*gold: 12
Join Date: Jul 2011
Posts: 6,985
Received Thanks: 3,336
Stop asking for help in that manor. It really bugs me. This isn't code "just for testing", this is a feature you've been trying to program for weeks now and you need programming help because you don't know what you're doing. There's a clear difference and if you want programming help, you need to say so; otherwise, you're just going to confuse people. Stop being so defensive, and let people help. There's no lost pride in asking for help, but pretending you're something you're not is just going to cause even more issues for you. The problem is probably in the loop you put it in; and as I said previously, this is a really bad way of doing this when you could just make a new status type in the client. This is just going to add another layer of stress on your server.


Spirited is offline  
Old 05/05/2013, 20:10   #3
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 66
what are you talking about i already made that

and if i made a thread of cores i am asking for help.

i only made it coz idk why it was looping and since i didn't know why it interested me to ask.
LordGragen. is offline  
Old 05/05/2013, 21:37   #4
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
dude u have been asking Really Stupid Question, all u want to is to be spoon feeded which i wont Provide .. Help Urself


shadowman123 is offline  
Old 05/05/2013, 21:58   #5
 
elite*gold: 0
Join Date: Mar 2013
Posts: 118
Received Thanks: 94
Quote:
Originally Posted by LordGragen. View Post
what are you talking about i already made that

and if i made a thread of cores i am asking for help.

i only made it coz idk why it was looping and since i didn't know why it interested me to ask.
Wow, sick code bro!
Smaehtin is offline  
Old 05/05/2013, 22:24   #6
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,877
if you're casting Level, which is of an integer type, to an integer type, to compare with another integer which is a constant, you're doing it wrong, or you're Korv' from like 6 years ago (BA DA DUM! -- hoping Korv' sees this and gets a small laugh out of walking down memory lane, haha)
InfamousNoone is offline  
Old 05/05/2013, 22:49   #7
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 66
did korv did the same mistake? XD
LordGragen. is offline  
Old 05/06/2013, 07:17   #8
 
elite*gold: 12
Join Date: Jul 2011
Posts: 6,985
Received Thanks: 3,336
Well, let's step through your code, shall we? (Or of the code you posted - nobody spoon feed him on this one). So what do you think is wrong with the segment of code you posted? After reading it, do you believe the problem is with this code, or do you believe it's correct?
Spirited is offline  
Old 05/06/2013, 13:51   #9
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 66
well i think it should be correct because thats how you guys told me to make it.

i made a new flag, i added the effect on client. and thats it
LordGragen. is offline  
Old 05/06/2013, 18:36   #10
 
elite*gold: 12
Join Date: Jul 2011
Posts: 6,985
Received Thanks: 3,336
Quote:
Originally Posted by LordGragen. View Post
well i think it should be correct because thats how you guys told me to make it.

i made a new flag, i added the effect on client. and thats it
After reading it yourself though, do you understand it and do you feel that it should be correct?
Spirited is offline  
Old 05/06/2013, 18:59   #11
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,609
Received Thanks: 828
Why not just do this?
Code:
void UseEffect()
{
while (true)
{
	if (client.Entity.Level == 140)
	{
		_String str = new _String(true);
		 str.UID = client.Entity.UID;
		str.TextsCount = 1;
		str.Type = _String.Effect;
		str.Texts.Add("break_start");
		client.SendScreen(str, true);
	 }
	System.Threading.Thread.Sleep(5000);
}
}
Super Aids is offline  
Old 05/06/2013, 19:11   #12
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 66
@fang i feel like its correct.

@Super Aids
well lets say 200 people are online and 140, wont that hurt the server using the edit on 200 people evey 5 sec?
LordGragen. is offline  
Old 05/06/2013, 19:29   #13
 
elite*gold: 0
Join Date: Jun 2010
Posts: 2,191
Received Thanks: 847
Find out for yourself, would only take a line of two of code to run that 10 times, take an average & * by 200.
_DreadNought_ is offline  
Old 05/06/2013, 20:17   #14
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,609
Received Thanks: 828
Rather than running that for every player then run a loop that sleeps every 5 sec that does it. Or make some proper system implementation for such thing instead of using Trinitys source.
Super Aids is offline  
Old 05/06/2013, 20:38   #15
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,310
Quote:
Originally Posted by Super Aids View Post
Rather than running that for every player then run a loop that sleeps every 5 sec that does it. Or make some proper system implementation for such thing instead of using Trinitys source.
Keep in mind that this method would have to be run as its own thread because if you use .Sleep(x) from say a command or item, you just freeze the entire server for that amount of time causing mass lag.


pro4never is offline  
Reply



« [HELP] Use of CPU | New garments »

Similar Threads
Run Time Error! [Problem]
04/12/2012 - Flyff PServer - Discussions / Questions - 0 Replies
Hallo liebe Community. Ich hab derzeit mit einem relativ großen Problem zu kämpfen. Ich starte meinen Flyff Server wie gewohnt doch bei dem World Server kommt ein Error. Er spuckt mir einen Run Time Error aus und meint es muss terminiert werden...
Another problem (CE this time)
10/19/2009 - Dekaron - 2 Replies
Hey guys, I've trouble with getting cheat engine to work with dekaron, when I start up dekaron I use the bypasser (nebular) and then start up CE. Then I go to process list and click on the dekaron.exe thingy but then I get the following error...
sibi bot problem, dc all the time
08/01/2009 - SRO PServer Ask the Experts - 0 Replies
it worked for the past day or two, then today when i log in, it bots for about 10 mins then i get DC, any1 know why? or any solutions? thanks
crevice-time problem
10/17/2008 - Dekaron - 8 Replies
Hello guys..i've made a crevice hack what works... my only problem is, that i can't kill fast enough in round 9:rtfm: knows anybody of you where i can increase the time?? greetz thanks for the replies... only needed other skills, items, tactic...
Problem With SRO [FIRST TIME]
03/22/2008 - SRO Ask the Experts - 2 Replies
hi all, this problem not for me but for my friend. He's not n00b play sro long time but this problem first time for him. :eek: so this is him post from other forum with problem. :confused:



All times are GMT +2. The time now is 01:09.


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

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.