The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird Timer Issue
Author Message
pinku
Journeyman
*

Posts: 118
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Apr 2013
Reputation: 4



Post: #1
Weird Timer Issue
Hey everyone! How's your day? =P

Something is driving me insane.

I currently have a problem with a very, very old script, that used to work just fine back in the days (or maybe I fooled myself all this time?! Sad)

Code:
[function rareSpawn]
if (0<var.rareSpawn.l1>)
try uid.<var.rareSpawn.l1>.remove
endif
if (0<var.rareSpawn.l1.uid>)
try uid.<var.rareSpawn.l1.uid>.remove
endif
newitem i_rareSpawn_l1
new.p 5448,1079
new.timer 1

[ITEMDEF i_rareSpawn_l1]
ID=01ed2
TYPE=t_eq_script
Name=Rare Spawn Level 1 Manager

ON=@CREATE
timer = 5
attr=08090
var.rareSpawn.l1.uid = <uid>
       

ON=@TIMER
if (0<var.rareSpawn.l1>)
try uid.<var.rareSpawn.l1>.remove
endif
       
dorand 5
tag.pos = 4171,3697
tag.pos = 4290,752
tag.pos = 3333,333,4
tag.pos = 1274,534,30
tag.pos = 1162,2906
enddo
       
dorand 3
tag.type = horse
tag.type = llama
tag.type = ostard
enddo
       
dorand 3
tag.race = frost
tag.race = earth
tag.race = fire
enddo
       
newitem i_worldgem_bit
var.rareSpawn.l1 = <new.uid>
new.p = <tag.pos>
new.type 34
new.amount 1
new.more c_<tag.race>_<tag.type>
new.morep 1440 1441 15
new.attr 00b0
new.timer 1
timer = 86400 // 24 HOURS
return 1

As you can see, it is a random spawner. It picks a POS, TYPE and RACE and spawns. After the timer in the manager, it removes the spawn and picks another POS, TYPE and RACE.

Problem is: Apparently, it is working, but it's not!

When I check locations, they have the same mount as the day before after the 24 hours have passed.
I then, check the manager with .tweak/.info and the time for the next spawn is exactly and always the 86400 (24 hours).
Alright, I go back to the locations and boom, a new POS/TYPE/RACE was picked...

But the weirdest thing is that if you test with lower times, it will work just fine, without me having to .info it!

Now I wonder, why is .info triggering it? Why does it work with low times and not with high times?

Thanks everyone for reading!
(This post was last modified: 08-31-2013 07:41 PM by pinku.)
08-31-2013 07:39 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Weird Timer Issue - pinku - 08-31-2013 07:39 PM
RE: Weird Timer Issue - darksun84 - 08-31-2013, 10:14 PM
RE: Weird Timer Issue - RanXerox - 09-01-2013, 12:30 AM
RE: Weird Timer Issue - Mordaunt - 09-02-2013, 11:55 AM
RE: Weird Timer Issue - pinku - 09-02-2013, 07:03 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)