Jump to content
  • 0
Sign in to follow this  
madtoyz

How to setup cluck event by Keale of VoidRO with time ?

Question

How to setup cluck event by Keale of VoidRO with time ?

I mean the cluck event will Auto start every 4Hours.

 

//===== Athena Script =====================================//= Cluck! Cluck! Boom!//===== By Keale of VoidRO ================================//= http://voidro.com//===== Description =======================================//= Click the chicken and try retrieve the item at a low //= chance. If you fail he will nuke, freeze, stone, //= stun, or make you fall asleep.//= The prize is configurable and triggered by the NPC.//===== Credits ===========================================//= LuTze for his 'Chicken of Punishment' script.//= BrianL for suggesting the 'switch' command.//===== Version ===========================================//= v1.1//=========================================================//= v1.0 - First release.//= v1.1 - Using 'switch rand' instead.//=========================================================izlude,127,132,7	script	Cluckers	800,{if ($@startcluck == 1) goto L_playcluck;cluckcluck:	if (getgmlevel() >= 60) goto cluckadmin;		mes "[Cluckers]";		mes "Cluck cluck! Cluuuuuck?";		mes "Cluck....";	close;	cluckadmin:		mes "[Cluckers]";		mes "Cluck cluck! Cluuuuuck? ^FF0000~Hi GM " + strcharinfo(0) + ", Wanna play today?~^000000";		mes "Cluck cluck... CLUCK! ^FF0000~Just tell me what to do!~^000000";		switch(select("Start Event:Check Prize:Set Prize:Not today Cluckers")) {case 1:		next;		mes "[Cluckers]";		mes "CLUCK! ^FF0000~Sure thing!~^000000";		emotion 33;		close2;		goto L_cluckannounce;case 2:		next;		mes "[Cluckers]";		mes "Cluck, cluck cluck... Cluck! ^FF0000~The current prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +".^000000";		next;		goto cluckadmin;case 3:		next;		mes "[Cluckers]";		mes "Cluck cluck? Cluck??? ^FF0000~What should the prize for winning be? Please input the ID.~^000000";		input $cluck_item_id;		next;		mes "[Cluckers]";		mes "Cluck? cluuuck? ^FF0000~How many if this item should I give away?~^000000";		input $cluck_item_amount;		next;		mes "[Cluckers]";		mes "Cluck cluck..? Cluck. ^FF0000~So, the prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +"^000000? ^FF0000Great.~^000000";		emotion 33;		next;		goto cluckadmin;case 4:		next;		mes "[Cluckers]";		mes "Cluck cluck cluck...";		close;}L_cluckannounce:		announce "[Cluck! Cluck! Boom!] is about to start in izlude 127 132!",bc_blue;		initnpctimer;		end;OnTimer10000:		announce "Please proceed to the izlude 127 132 if you want to play with the crazy chicken!",bc_blue;		end;OnTimer20000:		announce "Cluckers has eaten one of my items! I'm too scared to retrieve it!",bc_blue;		end;OnTimer30000:		announce "Click the insane chicken and try squeeze out the item, if you're lucky you'll win! Are you ready?",bc_blue;		end;OnTimer40000:		announce "GO! Click the chicken to get the prize!",bc_blue;		set $@startcluck,1;		end;		L_playcluck:		specialeffect2 2;		switch( rand(15) ) {case 0:		npctalk "CLUUUUUUCK!!!";		emotion 23;		atcommand "@nuke "+strcharinfo(0);		break;case 1:		npctalk "Cluuuuuck!~";		break;case 2:		atcommand "@nuke "+strcharinfo(0);		break;case 3:		sc_start SC_Freeze,10000,0;		break;case 4:		npctalk "CLUUUUUUUUUCK!!!";		emotion 23;		atcommand "@nuke "+strcharinfo(0);		break;case 5:		sc_start SC_Sleep,10000,0;		break;case 6:		emotion 29;		sc_start SC_Stone,10000,0;		break;case 7:		npctalk "CLUUUUUUCK!!!";		emotion 23;		atcommand "@nuke "+strcharinfo(0);		break;case 8:		npctalk "Cluck! CLUUUCK!!";		emotion 23;		atcommand "@nuke "+strcharinfo(0);		break;case 9:		sc_start SC_Stun,10000,0;		break;case 10:		emotion 29;		sc_start SC_Sleep,10000,0;		break;case 11:		npctalk "Cluck! Cluck!";		break;case 12:		sc_start SC_Stun,10000,0;		break;case 13:		atcommand "@nuke "+strcharinfo(0);		break;default:		if( rand(50) < 3 ) {			npctalk "WOOF!...........";			specialeffect2 72;			announce "[Cluck! Cluck! Boom!] " + strcharinfo(0) + " Squeezed out the prize! Well done!",0;			getitem $cluck_item_id,$cluck_item_amount;			set $@startcluck,0;		} else {			npctalk "Cluck! CLUUUCK!!";			atcommand "@nuke "+strcharinfo(0);			}		break;	}}

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

If you want it to trigger exactly every 4 hours, you could make it start. For example, given you've configured your script (an OnInit label is missing so you'll have to configure it by hand), you could set OnHourXX labels just along with the starting label on the script, which is L_cluckannounce.

 

Keep in mind this part of doc/script_commands.txt for following script adaptations:

OnClock<hour><minute>:OnMinute<minute>:OnHour<hour>:On<weekday><hour><minute>:OnDay<month><day>:This will execute when the server clock hits the specified date or time. Hours and minutes are given in military time. ('0105' will mean 01:05 AM). Weekdays are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 to 31. Remember the zero. 

 

Example with hours 00, 04, 08, 12, 16 and 20 (hour 24 doesn't exist), and also adding the OnInit quick configuration. I've changed the permanent server variables for NPC variables. Its only drawback is that prize changes are temporary until server reboot, so you'll have to change them on the if you want them to be permanently changed:

//===== Athena Script =====================================//= Cluck! Cluck! Boom!//===== By Keale of VoidRO ================================//= http://voidro.com//===== Description =======================================//= Click the chicken and try retrieve the item at a low //= chance. If you fail he will nuke, freeze, stone, //= stun, or make you fall asleep.//= The prize is configurable and triggered by the NPC.//===== Credits ===========================================//= LuTze for his 'Chicken of Punishment' script.//= BrianL for suggesting the 'switch' command.//= jaBote for v1.2 changes.//===== Version ===========================================//= v1.2//=========================================================//= v1.0 - First release.//= v1.1 - Using 'switch rand' instead.//= v1.2 - Changed some spacing for better comprehension //= and added some features per madtoyz request.//=========================================================izlude,127,132,7	script	Cluckers	800,{	if (.startcluck == 1) goto L_playcluck;cluckcluck:	if (getgmlevel() >= 60) goto cluckadmin;		mes "[Cluckers]";		mes "Cluck cluck! Cluuuuuck?";		mes "Cluck....";	close;	cluckadmin:		mes "[Cluckers]";		mes "Cluck cluck! Cluuuuuck? ^FF0000~Hi GM " + strcharinfo(0) + ", Wanna play today?~^000000";		mes "Cluck cluck... CLUCK! ^FF0000~Just tell me what to do!~^000000";		switch(select("Start Event:Check Prize:Set Prize:Not today Cluckers")) {			case 1:				next;				mes "[Cluckers]";				mes "CLUCK! ^FF0000~Sure thing!~^000000";				emotion 33;				close2;				goto L_cluckannounce;			case 2:				next;				mes "[Cluckers]";				mes "Cluck, cluck cluck... Cluck! ^FF0000~The current prize is^000000 ^008000"+ .cluck_item_amount +" "+ getitemname(.cluck_item_id) +".^000000";				next;				goto cluckadmin;			case 3:				next;				mes "[Cluckers]";				mes "Cluck cluck? Cluck??? ^FF0000~What should the prize for winning be? Please input the ID.~^000000";				input .cluck_item_id;				next;				mes "[Cluckers]";				mes "Cluck? cluuuck? ^FF0000~How many if this item should I give away?~^000000";				input .cluck_item_amount;				next;				mes "[Cluckers]";				mes "Cluck cluck..? Cluck. ^FF0000~So, the prize is^000000 ^008000"+ .cluck_item_amount +" "+ getitemname(.cluck_item_id) +"^000000? ^FF0000Great.~^000000";				emotion 33;				next;				goto cluckadmin;			case 4:				next;				mes "[Cluckers]";				mes "Cluck cluck cluck...";				close;		}L_cluckannounce:OnHour00:OnHour04:OnHour08:OnHour12:OnHour16:OnHour20:	announce "[Cluck! Cluck! Boom!] is about to start in izlude 127 132!",bc_blue;	initnpctimer;	end;OnTimer10000:	announce "Please proceed to the izlude 127 132 if you want to play with the crazy chicken!",bc_blue;	end;OnTimer20000:	announce "Cluckers has eaten one of my items! I'm too scared to retrieve it!",bc_blue;	end;OnTimer30000:	announce "Click the insane chicken and try squeeze out the item, if you're lucky you'll win! Are you ready?",bc_blue;	end;OnTimer40000:	announce "GO! Click the chicken to get the prize!",bc_blue;	set .startcluck,1;	end;		L_playcluck:	specialeffect2 2;	switch( rand(15) ) {		case 0:			npctalk "CLUUUUUUCK!!!";			emotion 23;			atcommand "@nuke "+strcharinfo(0);			break;		case 1:			npctalk "Cluuuuuck!~";			break;		case 2:			atcommand "@nuke "+strcharinfo(0);			break;		case 3:			sc_start SC_Freeze,10000,0;			break;		case 4:			npctalk "CLUUUUUUUUUCK!!!";			emotion 23;			atcommand "@nuke "+strcharinfo(0);			break;		case 5:			sc_start SC_Sleep,10000,0;			break;		case 6:			emotion 29;			sc_start SC_Stone,10000,0;			break;		case 7:			npctalk "CLUUUUUUCK!!!";			emotion 23;			atcommand "@nuke "+strcharinfo(0);			break;		case 8:			npctalk "Cluck! CLUUUCK!!";			emotion 23;			atcommand "@nuke "+strcharinfo(0);			break;		case 9:			sc_start SC_Stun,10000,0;		break;		case 10:			emotion 29;			sc_start SC_Sleep,10000,0;			break;		case 11:			npctalk "Cluck! Cluck!";			break;		case 12:			sc_start SC_Stun,10000,0;			break;		case 13:			atcommand "@nuke "+strcharinfo(0);			break;		default:			if( rand(50) < 3 ) {				npctalk "WOOF!...........";				specialeffect2 72;				announce "[Cluck! Cluck! Boom!] " + strcharinfo(0) + " Squeezed out the prize! Well done!",0;				getitem .cluck_item_id,.cluck_item_amount;				set .startcluck,0;			} else {				npctalk "Cluck! CLUUUCK!!";				atcommand "@nuke "+strcharinfo(0);			}	}end; // Script ending was missing.OnInit: //Change this for configuration	set .cluck_item_id, 512;	set .cluck_item_amount, 30;	end;}

 

Change the contents of OnInit label for permanent configuration. Untested but should work.

Share this post


Link to post
Share on other sites
  • 0

just change this stuff  ?

OnHour00:OnHour04:OnHour08:OnHour12:OnHour16:OnHour20:

thats mean if use every OnHour that you give it,event will start on 00:00am, 4am, 8am, 12am, 16:00pm, 20:00pm

right ?

Share this post


Link to post
Share on other sites
  • 0

just change this stuff  ?

OnHour00:OnHour04:OnHour08:OnHour12:OnHour16:OnHour20:
thats mean if use every OnHour that you give it,event will start on 00:00am, 4am, 8am, 12am, 16:00pm, 20:00pm

right ?

 

 

Yes

Share this post


Link to post
Share on other sites
  • 0

If you want it to trigger exactly every 4 hours, you could make it start. For example, given you've configured your script (an OnInit label is missing so you'll have to configure it by hand), you could set OnHourXX labels just along with the starting label on the script, which is L_cluckannounce.

 

Keep in mind this part of doc/script_commands.txt for following script adaptations:

OnClock<hour><minute>:OnMinute<minute>:OnHour<hour>:On<weekday><hour><minute>:OnDay<month><day>:This will execute when the server clock hits the specified date or time. Hours and minutes are given in military time. ('0105' will mean 01:05 AM). Weekdays are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 to 31. Remember the zero. 

 

Example with hours 00, 04, 08, 12, 16 and 20 (hour 24 doesn't exist), and also adding the OnInit quick configuration. I've changed the permanent server variables for NPC variables. Its only drawback is that prize changes are temporary until server reboot, so you'll have to change them on the if you want them to be permanently changed:

//===== Athena Script =====================================//= Cluck! Cluck! Boom!//===== By Keale of VoidRO ================================//= http://voidro.com//===== Description =======================================//= Click the chicken and try retrieve the item at a low //= chance. If you fail he will nuke, freeze, stone, //= stun, or make you fall asleep.//= The prize is configurable and triggered by the NPC.//===== Credits ===========================================//= LuTze for his 'Chicken of Punishment' script.//= BrianL for suggesting the 'switch' command.//= jaBote for v1.2 changes.//===== Version ===========================================//= v1.2//=========================================================//= v1.0 - First release.//= v1.1 - Using 'switch rand' instead.//= v1.2 - Changed some spacing for better comprehension //= and added some features per madtoyz request.//=========================================================izlude,127,132,7	script	Cluckers	800,{	if (.startcluck == 1) goto L_playcluck;cluckcluck:	if (getgmlevel() >= 60) goto cluckadmin;		mes "[Cluckers]";		mes "Cluck cluck! Cluuuuuck?";		mes "Cluck....";	close;	cluckadmin:		mes "[Cluckers]";		mes "Cluck cluck! Cluuuuuck? ^FF0000~Hi GM " + strcharinfo(0) + ", Wanna play today?~^000000";		mes "Cluck cluck... CLUCK! ^FF0000~Just tell me what to do!~^000000";		switch(select("Start Event:Check Prize:Set Prize:Not today Cluckers")) {			case 1:				next;				mes "[Cluckers]";				mes "CLUCK! ^FF0000~Sure thing!~^000000";				emotion 33;				close2;				goto L_cluckannounce;			case 2:				next;				mes "[Cluckers]";				mes "Cluck, cluck cluck... Cluck! ^FF0000~The current prize is^000000 ^008000"+ .cluck_item_amount +" "+ getitemname(.cluck_item_id) +".^000000";				next;				goto cluckadmin;			case 3:				next;				mes "[Cluckers]";				mes "Cluck cluck? Cluck??? ^FF0000~What should the prize for winning be? Please input the ID.~^000000";				input .cluck_item_id;				next;				mes "[Cluckers]";				mes "Cluck? cluuuck? ^FF0000~How many if this item should I give away?~^000000";				input .cluck_item_amount;				next;				mes "[Cluckers]";				mes "Cluck cluck..? Cluck. ^FF0000~So, the prize is^000000 ^008000"+ .cluck_item_amount +" "+ getitemname(.cluck_item_id) +"^000000? ^FF0000Great.~^000000";				emotion 33;				next;				goto cluckadmin;			case 4:				next;				mes "[Cluckers]";				mes "Cluck cluck cluck...";				close;		}L_cluckannounce:OnHour00:OnHour04:OnHour08:OnHour12:OnHour16:OnHour20:	announce "[Cluck! Cluck! Boom!] is about to start in izlude 127 132!",bc_blue;	initnpctimer;	end;OnTimer10000:	announce "Please proceed to the izlude 127 132 if you want to play with the crazy chicken!",bc_blue;	end;OnTimer20000:	announce "Cluckers has eaten one of my items! I'm too scared to retrieve it!",bc_blue;	end;OnTimer30000:	announce "Click the insane chicken and try squeeze out the item, if you're lucky you'll win! Are you ready?",bc_blue;	end;OnTimer40000:	announce "GO! Click the chicken to get the prize!",bc_blue;	set .startcluck,1;	end;		L_playcluck:	specialeffect2 2;	switch( rand(15) ) {		case 0:			npctalk "CLUUUUUUCK!!!";			emotion 23;			atcommand "@nuke "+strcharinfo(0);			break;		case 1:			npctalk "Cluuuuuck!~";			break;		case 2:			atcommand "@nuke "+strcharinfo(0);			break;		case 3:			sc_start SC_Freeze,10000,0;			break;		case 4:			npctalk "CLUUUUUUUUUCK!!!";			emotion 23;			atcommand "@nuke "+strcharinfo(0);			break;		case 5:			sc_start SC_Sleep,10000,0;			break;		case 6:			emotion 29;			sc_start SC_Stone,10000,0;			break;		case 7:			npctalk "CLUUUUUUCK!!!";			emotion 23;			atcommand "@nuke "+strcharinfo(0);			break;		case 8:			npctalk "Cluck! CLUUUCK!!";			emotion 23;			atcommand "@nuke "+strcharinfo(0);			break;		case 9:			sc_start SC_Stun,10000,0;		break;		case 10:			emotion 29;			sc_start SC_Sleep,10000,0;			break;		case 11:			npctalk "Cluck! Cluck!";			break;		case 12:			sc_start SC_Stun,10000,0;			break;		case 13:			atcommand "@nuke "+strcharinfo(0);			break;		default:			if( rand(50) < 3 ) {				npctalk "WOOF!...........";				specialeffect2 72;				announce "[Cluck! Cluck! Boom!] " + strcharinfo(0) + " Squeezed out the prize! Well done!",0;				getitem .cluck_item_id,.cluck_item_amount;				set .startcluck,0;			} else {				npctalk "Cluck! CLUUUCK!!";				atcommand "@nuke "+strcharinfo(0);			}	}end; // Script ending was missing.OnInit: //Change this for configuration	set .cluck_item_id, 512;	set .cluck_item_amount, 30;	end;}

 

Change the contents of OnInit label for permanent configuration. Untested but should work.

 

thanks,its working

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.