Auto-Census delay?

Questions and discussions on development tools for WarcraftRealms
Post Reply
User avatar
gendril
Posts: 62
Joined: Fri Jul 29, 2005 10:30 am
Location: Canada

Auto-Census delay?

Post by gendril »

I know that there is a delay with Auto-Census, but what is it. When searching through the code I found:

Code: Select all

local g_LastCensusRun = time() - 1500; --  timer used if auto census is turned on
Does this mean that it runs a census every 1500 seconds?
Maeric - Level 60 Warlock - Thunderhorn
http://wow.allakhazam.com/profile.html?4032

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Actually, what that does is cause the first start up census to not start for 10 minutes.

This check on line 1290 causes auto census to not start until 30 minutes after the last census was stopped.

Code: Select all

g_LastCensusRun < time&#40;&#41; - 1800
phpbb:phpinfo()

User avatar
gendril
Posts: 62
Joined: Fri Jul 29, 2005 10:30 am
Location: Canada

Post by gendril »

So if I wanted to start census immediately (or very soon after I've logged into a character) what would I change?
Maeric - Level 60 Warlock - Thunderhorn
http://wow.allakhazam.com/profile.html?4032

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

You would want change the default:

Code: Select all

local g_LastCensusRun = time&#40;&#41; - 1500; --  timer used if auto census is turned on
to maybe

Code: Select all

local g_LastCensusRun = time&#40;&#41; - 1730; --  timer used if auto census is turned on
Which would cause a census to start about 30 sec after login.
phpbb:phpinfo()

User avatar
gendril
Posts: 62
Joined: Fri Jul 29, 2005 10:30 am
Location: Canada

Post by gendril »

Ok, I can't say that I quite understand that. But what number would I put there if I wanted the census to start 5 seconds after login? 30 seconds is too much time to wait when I take a census and then am out of there.
Maeric - Level 60 Warlock - Thunderhorn
http://wow.allakhazam.com/profile.html?4032

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Basically, when Auto-Census is on, then it will attempt to take a Census 1800 seconds (30 mins) after the time set in g_LastCensusRun. When the mod first loads up, it sets g_LastCensusRun to the current time minus 1200 seconds, meaning in 600 more seconds, a snapshot will be kicked off.

So by setting g_LastCensusRun farther and farther in the past, it will cause a Census to be kicked off sooner. So, to get it to start 5 seconds after loging, you would set it to 1795.

You could also just set it to 1800 and a Census will begin as soon as possible.
phpbb:phpinfo()

User avatar
gendril
Posts: 62
Joined: Fri Jul 29, 2005 10:30 am
Location: Canada

Post by gendril »

Thanks, that's exactly what I wanted to know.
Purrrrrrrfect! :lol:
Maeric - Level 60 Warlock - Thunderhorn
http://wow.allakhazam.com/profile.html?4032

jonnydont

Post by jonnydont »

I want the program to begin taking a census 5 second after logon, and then automatically retake the next census immeadiatly after finishing the current one. How would I do that???

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

There isn't really much benefit to running a constant census. I'm not really sure why you would want to do that.
phpbb:phpinfo()

jonnydont

Post by jonnydont »

Rollie wrote:There isn't really much benefit to running a constant census. I'm not really sure why you would want to do that.
You'd be suprised at how many new people it finds when you run it back to back.

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

But I would hope you would still be able to see those folks if you waited 30 mins before taking another Census. Still, if this is what you want to do, it would be easy to set up.

You would want to change line 108:

Code: Select all

local g_LastCensusRun = time&#40;&#41; - 1500;
to something like:

Code: Select all

local g_LastCensusRun = time&#40;&#41; - 5;

And change line 1353

Code: Select all

	if&#40; g_VariablesLoaded and g_IsCensusPlusInProgress == false and CensusPlus_Database&#91;"Info"&#93;&#91;"AutoCensus"&#93; == true and g_LastCensusRun < time&#40;&#41; - 1800 &#41; then
to something like

Code: Select all

	if&#40; g_VariablesLoaded and g_IsCensusPlusInProgress == false and CensusPlus_Database&#91;"Info"&#93;&#91;"AutoCensus"&#93; == true and g_LastCensusRun < time&#40;&#41; - 5 &#41; then
I haven't tested the above, but that would pretty much cause you to be taking Census pretty much constantly.
phpbb:phpinfo()

jonnydont

Post by jonnydont »

Thanks! Works like a charm!

User avatar
Zimeron
Posts: 178
Joined: Mon Sep 05, 2005 5:40 pm

Post by Zimeron »

I just login and hit that lovely macro button you gave me ;)
Image Image
The Naked Census Dwarves are Back.

User avatar
Bruno
Posts: 3
Joined: Tue Aug 30, 2005 4:18 pm
Location: Hyjal

Post by Bruno »

Do I need to have C++ to do this or can I just use notepad to change all that?

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Notepad should work just fine =)
phpbb:phpinfo()

User avatar
Bruno
Posts: 3
Joined: Tue Aug 30, 2005 4:18 pm
Location: Hyjal

Post by Bruno »

Thank you. Works beautifully.

Post Reply