Kill timer
Moderator: Eowul
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Kill timer
I wanted to run some experiments and I was trying to figure out a way to collect the time it takes to kill a mob. Any thoughts on the best way to do this? And if its possible to have it output to a file?
Re: Kill timer
Don't have access to cmud right now but there is a way to timestamp every line/command. From there a simple #capture will pull it to another window. Can change the settings to log that window and review.
Re: Kill timer
If you have CMUD, you can create a trigger that fires off "you attack the *" that kicks of a tick timer. Set another trigger to fire off of "you killed the" that stops that time. Done deal.
If you want more granular measurement, I'm fairly sure you could increment the timer every half second, quarter second, etc.
If you want more granular measurement, I'm fairly sure you could increment the timer every half second, quarter second, etc.
Re: Kill timer
Thanks for the input guys and I dont mean to sound ungrateful but I put this in the Genesis Web client forum because I am trying to figure out how to do it with the Web client. I use CMud at home and am confident I could figure out a way to do it with that program. However I am at work where I use the Web client and scripting in it and Javascript is a whole different beast.
Re: Kill timer
Oops. Of course you did. I completely forgot what forum this was in. Sorry about that. There absolutely should be a way to create a solution similar to the one I described for CMUD....but I am no help in figuring it out.Caw wrote:Thanks for the input guys and I dont mean to sound ungrateful but I put this in the Genesis Web client forum because I am trying to figure out how to do it with the Web client. I use CMud at home and am confident I could figure out a way to do it with that program. However I am at work where I use the Web client and scripting in it and Javascript is a whole different beast.
Re: Kill timer
Thanks Yanus! This works perfectly.
Re: Kill timer
Hi CawCaw wrote:Thanks Yanus! This works perfectly.
Do you stil have the code proposed by Yanus? if yes, can you post it once again?
Thanks
Re: Kill timer
Sorry man, I'm in the dark as much as you are as far as what was posted, but I do know of a way to do that. You'd use javascript date objects as timestamps and compare them. I'd suggest making an alias for "kill" that starts the timer, and a trigger for "you killed" that creates another timestamp that is then compared and either print it out or save it to create an average time for a given mob. However, if you were going to do the averaging, I'd suggest also creating a trigger for "you attack" that'll grab the whole name of the mob to save it under. Since it's only saving a timestamp when you use "kill", you don't have to worry if you don't find anything to attack. It'll just make a new one when you attack something else. It's not like it'll continue counting anything in the background.kirsach wrote:Do you stil have the code proposed by Yanus? if yes, can you post it once again?
Thanks
If all you wanted to do was print the time it took, here's a way to do it:
Your kill alias would look like this:
Alias: kill
Code: Select all
if ( args[1] !== undefined){ // gotta make sure we're not just typing 'kill'
gwc.userdata.last_target = args[1];
gwc.userdata.attack_starttime = new Date();
gwc.connection.send( args[0] );
}
else{
gwc.connection.send( 'kill', false );
}
Trigger: ^You killed
Type: Regex
Code: Select all
var currentTime = new Date();
var killTime = ((currentTime - gwc.userdata.attack_starttime) / 1000).toFixed(2);
//This is a string representation that wouldn't be very good in averaging, you'd probably just save the difference between now and when you started instead.
gwc.output.append( 'It look ' + killTime + ' seconds to kill ' + gwc.userdata.last_target + '.');
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/