Page 1 of 1

I Need fast help (pls)

Posted: Sun Dec 15, 2013 5:25 pm
by Pofatlan
My problem normal attack speed test I want to test the working of raid rune in talisman.
So I need your help for this testing. I need a programme to test how many hits per unit time. (e.g:hits/min)
I want to test my hits/min against "kentiaru deffense tower"

Sorry for my openning this new topic... :)

Re: I Need fast help (pls)

Posted: Sun Dec 15, 2013 6:04 pm
by lisa
just use a dps addon

Re: I Need fast help (pls)

Posted: Sun Dec 15, 2013 6:05 pm
by Bill D Cat
This is untested, but I believe the theory is sound. You'll have to edit the beginning to enter the Tower ID or name in whatever native language you run the game. Edit the coordinates for the first waypoint and it should run. If you just let it run, it will output the results every five minutes.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="RUN">
	<waypoint x="xxxx" z="zzzz" y="yyyy">				-- Enter the proper coordinates here.
		local tower = player:findNearestNameOrId(xxxxxx)	-- Enter the Name or ID of the tower here.
      if tower and 150 > distance(tower, player) then
         player:target_NPC(tower.Id)
         local startTime = os.clock()
         local now = os.clock()
         local hitCount = 0
         repeat
            Attack()
            hitCount = hitCount + 1
            now = os.clock()
         until (now - startTime) > 60 -- 1 minute
         print("Hits per minute = "..hitCount)
      end
   </waypoint>
</waypoints>

Re: I Need fast help (pls)

Posted: Sun Dec 15, 2013 7:23 pm
by Pofatlan
Bill D Cat thanks help!

There is a small problem run the bot and after two hits:
Image

Re: I Need fast help (pls)

Posted: Sun Dec 15, 2013 7:45 pm
by Bill D Cat
Fixed the code in my last post.

Re: I Need fast help (pls)

Posted: Sun Dec 15, 2013 7:49 pm
by Bill D Cat
lisa wrote:just use a dps addon
I don't think a DPS addon will tell you how many times you hit your target, only the sustained damage output.

Re: I Need fast help (pls)

Posted: Sun Dec 15, 2013 7:54 pm
by Bill D Cat
I just tested this myself on a mud newt with a level 5 character, and it said I had over 500 hits per minute! :o

I think the loop isn't blocking at each Attack() and so it cycles the counter more often than is intended. Not sure how to go about fixing that without putting more code in that could skew the results just as badly. The only option that comes to mind is to watch the in-game messages for the combat log and count how many hits (and misses) were recorded.

Re: I Need fast help (pls)

Posted: Sun Dec 15, 2013 8:42 pm
by lisa
an addon is the only way you will get an accurate count of hits.

You won't be able to create code in the bot to accurately count hits, the code bill posted would do the repeat loop at an insane rate and even though you could add in yrest() that wouldn't be accurate for actual hits, the count would purely be set by the time in the rests.

I guess you could monitor the combat chat and then filter it out to be just normal attacks, which is what I would do in an addon.

CHAT_MSG_COMBAT

Re: I Need fast help (pls)

Posted: Tue Dec 17, 2013 3:17 am
by lisa
add this to a userfunction, then start bot with commandline

at command prompt do
comlog(time)
time is in seconds, it will start counting when you enter combat and finish each calculation at intervals of time you set when calling the function. So bigger numbers should get more accurate times.

comlog(30)

This only counts normal attacks from your character and will ignore all other attacks, so you can freely use any skills you want.
example

Code: Select all

Type in 'q' (without quotes) to quit.
Command> comlog(5)
event monitoring
Hits :7 Hits per second: 1.3980427401638
event monitoring
Hits :5 Hits per second: 0.99820323417848
event monitoring
Hits :8 Hits per second: 1.5961691939346
event monitoring


Command> comlog(20)
event monitoring
Hits :32 Hits per second: 1.6001600160016

Code: Select all

function comlog(ttime)
	while (true) do
		repeat
			yrest(500)
			player:update()
		until player.Battling
		EventMonitorStart("clwhispers", "CHAT_MSG_COMBAT");
		local starttime = os.clock()
		print("event monitoring")
		yrest(ttime*1000)
		local endtime = os.clock()
		local count = 0
		repeat
			local time, moreToCome, name, msg = EventMonitorCheck("clwhispers", "4,1")
			if msg and string.find(msg,player.Name.." attacks") then
				count = count + 1
			end
		until moreToCome == false
		EventMonitorStop("clwhispers")
		print("Hits :".. count.." Hits per second: "..count/(endtime-starttime))
	end
end

Re: I Need fast help (pls)

Posted: Fri Jan 10, 2014 10:52 am
by Pofatlan
Dear Lisa and Bill D Cat!
Thank you very much for your help!
Does not work a raid runes in talisman... :S