Jump to content
  • 0

how to change the time interval in auto event npc


dmonrey002

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  38
  • Reputation:   0
  • Joined:  10/31/14
  • Last Seen:  

Help plsss.. i have a auto event npc and i want it to start every 3 hrs interval.. im confuse on the script  OnMinute:  what number i put to make it every 3hrs interval?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

if you'd like to make it run on every (times)3 hours, like 03.00, 06.00, 09.00, 12.00, 15.00, 18.00, 21.00 and 00.00 (24.00), then you can use this:

OnHour00:
OnHour03:
OnHour06:
OnHour09:
OnHour12:
OnHour15:
OnHour18:
OnHour21:
// event begins

If you want to be floating, like 3 hrs after the event is done, then this should do the trick:

OnInit:
startnpctimer;
end;

OnTimer7200000:
    if(!.@a) {
        setnpctimer -3600000;
        set .@a, 1;
        end;
    }
    
    //event script

 

upon NPC done, add this on before end;

stopnpctimer;
initnpctimer;
set .@a, 0;

IDK if there is OnTimer10800000 or not, as I know, they don't have it. so, it will subtract the timer by 1 hour on the 2nd hour, then on the next 2nd hour (which will be the 3rd hour), it will do the event script.

 

not tested

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  38
  • Reputation:   0
  • Joined:  10/31/14
  • Last Seen:  

if you'd like to make it run on every (times)3 hours, like 03.00, 06.00, 09.00, 12.00, 15.00, 18.00, 21.00 and 00.00 (24.00), then you can use this:

OnHour00:
OnHour03:
OnHour06:
OnHour09:
OnHour12:
OnHour15:
OnHour18:
OnHour21:
// event begins

If you want to be floating, like 3 hrs after the event is done, then this should do the trick:

OnInit:
startnpctimer;
end;

OnTimer7200000:
    if(!.@a) {
        setnpctimer -3600000;
        set .@a, 1;
        end;
    }
    
    //event script

upon NPC done, add this on before end;

stopnpctimer;
initnpctimer;
set .@a, 0;

IDK if there is OnTimer10800000 or not, as I know, they don't have it. so, it will subtract the timer by 1 hour on the 2nd hour, then on the next 2nd hour (which will be the 3rd hour), it will do the event script.

 

not tested

  THNX alot i try this..

PS: haha how can i check if the NPC running the event every after 3hrs

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

insert this:

OnWhisperGlobal:
if(@whispervar0$=="tick") {
    dispbottom "My current tick: "+getnpctimer 0;
    end;
}

then, whisper to: NPC::<npc name>  message: tick.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...