Jump to content
  • 0

@events Timer Problem


Bringer

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  737
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

Every time i restart server  event timer will become negative
How can i avoid this from happening? That even if i restarted the server, event timer will remain as is and it will not show negative result or a negative time.

 

OnMinute00:
	$EVT_Dice_Timer = gettimetick(2);
	$EVT_Dice = 1;
	if( gettime(3) % 1 != 0 ) end;
	if (.EventStatus) end;
	.EventOnJoin = 1;
	.EventStatus = 1;
	announce "Dice: We are going to have a Dice event.",0;
	sleep 10000;
	announce "Dice: For those who wants to join, use @dice",0;
	sleep 10000;
	announce "Dice: After 1 Minute Event will close.",0;
	sleep 10000;
	announce "Dice: So please if you want to join. use @dice",0;
	initnpctimer;
	end;


OnTimer46000:
	announce "[ Dice ] Event Time's up.",0;
	.EventOnJoin = 0;
	$EVT_Dice = 0;
	$EVT_Dice_Status = 0;
	end;

 

-	script	eventstatus	-1,{

OnAtStatusEvent:
	.@evt_lim_time = $EVT_Dice_Timer + .RunEvery;
	.@evt_cur_time = gettimetick(2);
	.@evt_ent_t = (.@evt_lim_time - .@evt_cur_time);
	.@evt_h = (.@evt_ent_t / 3600);
	.@evt_m = (.@evt_ent_t - (.@evt_h * 3600)) / 60;
	.@evt_s = .@evt_ent_t - ((.@evt_h * 3600) + (.@evt_m * 60));

	mes " [ Event Status ] ";
		if ($EVT_Dice == 0) mes " Dice Event [^FF0000"+.@evt_h+"h "+.@evt_m+"m "+.@evt_s+"s^000000]";
		if ($EVT_Dice == 1) mes " Dice Event [^FF0000"+.@evt_h+"h "+.@evt_m+"m "+.@evt_s+"s^000000]";

	switch(select(
		"Dice Event - " + ($EVT_Dice ? "^FF0000Not Available":"^00FF00Join Event!") + "^000000")) 
	{
	case 1:
		break;
	}
	end;

OnInit:
	bindatcmd "event",strnpcinfo(0)+"::OnAtStatusEvent";
	.RunEvery = 3600; // second
	end;
}

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Change the variables from global permanent to global temp

$EVT_Dice_Timer to $@EVT_Dice_Timer

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  737
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

1 hour ago, Mabuhay said:

Change the variables from global permanent to global temp

$EVT_Dice_Timer to $@EVT_Dice_Timer

still same

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

You could try my own version of dice. 

I just took an old dice event script and modified it the way how I understand how your script works.

https://pastebin.com/UZ1R2ZM1

I will be posting my own version in rathena downloads in a bit.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  737
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

58 minutes ago, Mabuhay said:

You could try my own version of dice. 

I just took an old dice event script and modified it the way how I understand how your script works.

https://pastebin.com/UZ1R2ZM1

I will be posting my own version in rathena downloads in a bit.

here my dice script

https://pastebin.com/iPMpP4c5

i want to copy this ideas

27497481_1539994936116984_882781207_n.png?_nc_cat=110&_nc_oc=AQmBtLWG3EuEQn8_pBOmRafYr8jD-Hoodk37DLvo_v2XVvSDoP-Vc3RjAkKXuGY9xm4&_nc_ht=scontent.fmnl4-3.fna&oh=9ec1d012917f301fc4c33bba14d9e485&oe=5DC5108B

Credit : SarahRO 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

That's obviously an event manager script. 

It's quite tedious to do. I will have to think about making a simple one for free. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  737
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

17 minutes ago, Mabuhay said:

That's obviously an event manager script. 

It's quite tedious to do. I will have to think about making a simple one for free. 

i already made like on photo but my only problem the tick timer alwys negative when restart server

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