Issue information

Issue ID
#6665
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Sep 10, 2012 7:05
Last Post
Hercules Elf Bot
Sep 17, 2012 9:51
Confirmation
Yes (2)
No (0)

Hercules Elf Bot - Sep 10, 2012 7:05

Originally posted by [b]Emistry[/b]
[img]http://i.imgur.com/q8O6D.png[/img]

[hr]

as you can see from the picture...the timer ...stopped / didnt update after 9th seconds..which is after the last OnTimer Label is triggered.
i think the getnpctimer() only provide the updated timer if there is any OnTimer havent run / triggered ...
after the last OnTimer label triggered, the following getnpctimer() didnt display the timer and stopped at the latest triggered time.

Hercules Elf Bot - Sep 10, 2012 7:29

Originally posted by [b]Brian[/b]
This has been the behavior of [b]getnpctimer(0)[/b] as far as I can remember from eAthena -- the timer stops after the last "OnTimer<time>:" has triggered. I think the devs designed it this way because it's only meant to be a timer that triggers stuff.

If you want a continues timer where you can get the ticks that have passed, maybe use [wiki='gettimetick']. Or if you really want a NPC timer, set the last "OnTimer<time>:" to a very high number so your timer will continue ticking until it reaches it.

This post has been edited by Brian on Sep 10, 2012 7:30

Hercules Elf Bot - Sep 10, 2012 8:18

Originally posted by [b]Emistry[/b]
erm..not sure about this....but i remember in eAthena ...that the getnpctimer still continue count after the last OnTimer triggered unless we use stopnpctimer to stop/pause it....
anyway thx for the info...i think i'' just get use to this...xD

Hercules Elf Bot - Sep 10, 2012 10:05

Originally posted by [b]Kenpachi[/b]
Nah Brian, it's not working as intended. Why should a timer stop automatically?
Maybe you want to stop it by clicking on a NPC and with the condition that the timer has elapsed at least 15 second even though the last OnTimer-label was at 9 seconds.

-> Confirmed

Hercules Elf Bot - Sep 10, 2012 11:29

Originally posted by [b]GreenBox[/b]
Fixed in [rev=16769].

This post has been edited by GreenBox on Sep 10, 2012 11:30

Hercules Elf Bot - Sep 13, 2012 8:42

Originally posted by [b]kyeme[/b]
[s]Hmmmm, excuse me. Can i ask? The npctimer was not working properly on latest revision? Heres my screenshot and script[/s] nvm~~ I just changed my script :)

[CODE]
OnInit:
OnTimer1000:
delwaitingroom;
set .@total, getmapusers("pvp_y_1-2") + getmapusers("guild_vs1-1") + getmapusers("pvp_y_2-2") + getmapusers("force_1-1") + getmapusers("force_2-1") + getmapusers("force_3-1") + getmapusers("force_4-1") + getmapusers("force_5-1");
waitingroom " PvP Warper [ "+.@total+" ]", 0;
initnpctimer;
end;
[/CODE]
[attachment=3520:1.JPG]
Sorry if I'm in wrong section. Thank you.

This post has been edited by kyeme on Sep 14, 2012 16:07

Hercules Elf Bot - Sep 14, 2012 8:03

Originally posted by [b]kyeme[/b]
When i reverted to r16768 its working properly > the timer..

Hercules Elf Bot - Sep 16, 2012 1:46

Originally posted by [b]tommym[/b]
@[url="http://rathena.org/board/user/290-greenbox/"]GreenBox[/url]

I think your fix caused initnpctimer not to function fully anymore. Normally calling initnpctimer after it has already been run will reset the timer, but the timer doesn't reset any longer for the npc when initnpctimer is called again. I had to revert back to r16768(revision before you edited npc.c) to fix the problem.

Hercules Elf Bot - Sep 16, 2012 1:51

Originally posted by [b]Euphy[/b]
^ That might be a real problem. I haven't checked, but more than a few scripts depend on that feature and we shouldn't break backwards compatibility.

Hercules Elf Bot - Sep 16, 2012 16:09

Originally posted by [b]GreenBox[/b]
Actually I[color=#ffffff]'ts dolan[/color]forget that initnpctimer must restart it. Fixed in [rev=16784].

Hercules Elf Bot - Sep 17, 2012 2:54

Originally posted by [b]QQfoolsorellina[/b]
I have a question , if the scripter forgotten to stop the npc time

, after a few days, will the value become overflow, and cause server to crash ?

-----------------------------------------------------------------------------
edit: thanks for Lighta's explaining, now I understand :P

This post has been edited by QQfoolsorellina on Sep 17, 2012 5:33

Hercules Elf Bot - Sep 17, 2012 4:42

Originally posted by [b]Lighta[/b]
Na most likekly when there an overflow it's start back to 0. (well for unsigned).

Hercules Elf Bot - Sep 17, 2012 9:51

Originally posted by [b]GreenBox[/b]
As it uses the server tick, it will overflow with the server.