Jump to content
  • 0

Help on countdown chatroom timer.


Lil Troll

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

turbo_room,113,89,3    script    Server Time    1193,{
end;
OnInit:
    while ( 1 ) {
        delwaitingroom strnpcinfo(0);
        waitingroom gettimestr( "[D%d]%I:%M:%S %p",21 ),0;
        sleep 1000;
    }
    end;
}

If this ^ ^ ^ is Server Time

 

How can you do countdown BEFORE WOE and countdown WHEN WOE END?

Bump...

Heres the main idea..

prontera,150,150    script    Woe Countdown Board#1    999,{

OnClock1900:
hideonnpc "Woe Countdown Board#1"; // Appear One Hour Before WOE
OnAgitStart:
hideoffnpc "Woe Countdown Board#1";
end;

OnInit:
    while ( 1 ) {
        delwaitingroom strnpcinfo(0);
        waitingroom gettimestr( "[WOE STARTS]%I:%M:%S %p",21 ),0;          //How to make countdown to woe start?
        sleep 1000;
    }
    end;
}
// When WOE OnAgitStart Script #1 Will be gone, then OnAgitStart same NPC will appear replacing
prontera,150,150    script    Woe Countdown Board#2    999,{
OnAgitStart:
hideoffnpc "Woe Countdown Board#1";
OnAgitEnd:
hideonnpc "Woe Countdown Board#1";
end;

OnInit:
    while ( 1 ) {
        delwaitingroom strnpcinfo(0);
        waitingroom gettimestr( "[WOE ENDS]%I:%M:%S %p",21 ),0;          //How to make countdown woe to end?
        sleep 1000;
    }
    end;
}
Edited by Lil Troll
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  56
  • Reputation:   9
  • Joined:  09/22/12
  • Last Seen:  

I dont have the time to write a script right now, but that function was present in Xeons WoE Setter v3, heres how he did it:

while (1) {
		delwaitingroom; //Memory vortex restraining bolt, please don't remove it for the sake of humanity.
		if (.@woe_e-gettimetick(2) <= 0 || !$woe_chatinfo) { set .@timeset, query_sql("select st,et from `woe_times` order by `st` ASC",.@woe_s,.@woe_e); set $woe_chatinfo, 1; }
		if (.@timeset) {
			if (gettimetick(2)>.@woe_s) {
				set .@sec, .@woe_e-gettimetick(2);
				set .@day, .@sec / 86400;
				set .@hr, .@sec % 86400 / 3600;
				set .@min, .@sec % 3600 / 60;
				set .@sec, .@sec % 60;
				waitingroom "Ends: "+.@day+"d "+((.@hr<10)?"0":"")+.@hr+":"+((.@min<10)?"0":"")+.@min+((!.@hr&&!.@min&&.@sec<60)?":"+((.@sec<10)?"0":"")+.@sec:""),0;
			} else {
				set .@sec, .@woe_s-gettimetick(2);
				set .@day, .@sec / 86400;
				set .@hr, .@sec % 86400 / 3600;
				set .@min, .@sec % 3600 / 60;
				set .@sec, .@sec % 60;
				waitingroom "Next: "+.@day+"d "+((.@hr<10)?"0":"")+.@hr+":"+((.@min<10)?"0":"")+.@min+((!.@hr&&!.@min&&.@sec<60)?":"+((.@sec<10)?"0":"")+.@sec:""),0;
			}
			if (.@hr||.@min>1) { sleep 60000-(gettime(1)*1000); } else { sleep 1000; }
		} else { waitingroom "Next: N/A, none set!",0; sleep 60000-(gettime(1)*1000); }
	}

Maybe this will help you to get an idea how you could do it.

Source: http://www.eathena.ws/board/WoE-Setter-3-t198420.html

Edited by Reynard
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  163
  • Reputation:   7
  • Joined:  01/07/12
  • Last Seen:  

i have question about this also.

 

Could someone tell me how the time for woe start and woe stop stored since it must be change periodically and convert it to UNIX right?

 

Because if we use condition that sub woe start with current time tick, when woe have been passed it will always have negative value right?

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...