Jump to content
  • 0

Warm announcing


Question

Posted

Hi all,

 

pleaseee I would like a announcer to a character. For example, let say i played for 30 minutes the npc will announced to me" i have played 30 minutes and please slow down. We care about your health. "

 

Something like that a simple script. To all Character's, perfer if it works with id or ip.

 

pretty please thank youuu very much.

14 answers to this question

Recommended Posts

Posted
-     warmmessage     -1{
OnPCLoginEvent:
attachnpctimer ""+strcharinfo+"";
initnpctimer;
end;

OnTimer1800000: // 30mins change this to whatever you want
//mes "I have played 30 minutes and please slow down. We care about your health";
//dispbottom "I have played 30 minutes and please slow down. We care about your health";
//announce "I have played 30 minutes and please slow down. We care about your health";
stopnpctimer;
initnpctimer;
end;
}

Uncomment "mes" if you want it to be a dialog box (like when you click an npc)

Uncomment "dispbottom" if you want it to display at the bottom of your screen (like a normal chat)

Uncomment "announce" if you want it to announce to the whole server ( personally i don't recommend it since there will be a lot of players and frequent announcements are kind of irrirtating)

  • Upvote 1
Posted
-     warmmessage     -1{
OnPCLoginEvent:
attachnpctimer ""+strcharinfo+"";
initnpctimer;
end;

OnTimer1800000: // 30mins change this to whatever you want
//mes "I have played 30 minutes and please slow down. We care about your health";
//dispbottom "I have played 30 minutes and please slow down. We care about your health";
//announce "I have played 30 minutes and please slow down. We care about your health";
stopnpctimer;
initnpctimer;
end;
}

Uncomment "mes" if you want it to be a dialog box (like when you click an npc)

Uncomment "dispbottom" if you want it to display at the bottom of your screen (like a normal chat)

Uncomment "announce" if you want it to announce to the whole server ( personally i don't recommend it since there will be a lot of players and frequent announcements are kind of irrirtating)

Awesome scripting bro.!!!!

hmm where and how can i know about the time? How can i set it? Whats the number ahh T.T

 

forexample u just posted OnTimer1800000: means 30 minutes. Meaning i have to 1800000 + 1800000 = 1 hour? 1 minute how many?

Posted

OnTimer<milliseconds>:

 

So on his script 1800000 is in milliseconds.

 

The computation there is : 

( milliseconds / 1000 ) / 60 = XX Minute

 

Therefore : 

( 1800000 / 1000 ) / 60 = 30 Minutes ( https://www.google.com/search?q=1800000+milliseconds+to+minutes&oq=1800000+milliseconds+to+minutes&aqs=chrome..69i57.5715j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#es_sm=93&espv=210&q=(+1800000+%2F+1000+)+%2F+60 )

 

Vice versa computation will be : 

( minute * 1000 ) * 60 = XX milliseconds

 

Therefore if you want to know how many milliseconds there will be in 60 minutes : 

( 60 * 1000 ) * 60 = 3600000 millisecondshttps://www.google.com/search?q=1800000+milliseconds+to+minutes&oq=1800000+milliseconds+to+minutes&aqs=chrome..69i57.5715j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#es_sm=93&espv=210&q=(+60+*+1000+)+*+60 )

Posted

OnTimer<milliseconds>:

 

So on his script 1800000 is in milliseconds.

 

The computation there is : 

( milliseconds / 1000 ) / 60 = XX Minute

 

Therefore : 

( 1800000 / 1000 ) / 60 = 30 Minutes ( https://www.google.com/search?q=1800000+milliseconds+to+minutes&oq=1800000+milliseconds+to+minutes&aqs=chrome..69i57.5715j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#es_sm=93&espv=210&q=(+1800000+%2F+1000+)+%2F+60 )

 

Vice versa computation will be : 

( minute * 1000 ) * 60 = XX milliseconds

 

Therefore if you want to know how many milliseconds there will be in 60 minutes : 

( 60 * 1000 ) * 60 = 3600000 millisecondshttps://www.google.com/search?q=1800000+milliseconds+to+minutes&oq=1800000+milliseconds+to+minutes&aqs=chrome..69i57.5715j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#es_sm=93&espv=210&q=(+60+*+1000+)+*+60 )

 

Yeah thank you so much. For clearing that up.

Posted
-     warmmessage     -1{
OnPCLoginEvent:
attachnpctimer ""+strcharinfo+"";
initnpctimer;
end;

OnTimer1800000: // 30mins change this to whatever you want
//mes "I have played 30 minutes and please slow down. We care about your health";
//dispbottom "I have played 30 minutes and please slow down. We care about your health";
//announce "I have played 30 minutes and please slow down. We care about your health";
stopnpctimer;
initnpctimer;
end;
}

Uncomment "mes" if you want it to be a dialog box (like when you click an npc)

Uncomment "dispbottom" if you want it to display at the bottom of your screen (like a normal chat)

Uncomment "announce" if you want it to announce to the whole server ( personally i don't recommend it since there will be a lot of players and frequent announcements are kind of irrirtating)

 

 

OnTimer<milliseconds>:

 

So on his script 1800000 is in milliseconds.

 

The computation there is : 

( milliseconds / 1000 ) / 60 = XX Minute

 

Therefore : 

( 1800000 / 1000 ) / 60 = 30 Minutes ( https://www.google.com/search?q=1800000+milliseconds+to+minutes&oq=1800000+milliseconds+to+minutes&aqs=chrome..69i57.5715j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#es_sm=93&espv=210&q=(+1800000+%2F+1000+)+%2F+60 )

 

Vice versa computation will be : 

( minute * 1000 ) * 60 = XX milliseconds

 

Therefore if you want to know how many milliseconds there will be in 60 minutes : 

( 60 * 1000 ) * 60 = 3600000 millisecondshttps://www.google.com/search?q=1800000+milliseconds+to+minutes&oq=1800000+milliseconds+to+minutes&aqs=chrome..69i57.5715j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#es_sm=93&espv=210&q=(+60+*+1000+)+*+60 )

 

 

 

 

This is not working. I waited for 1 minute. There is a Bug or Error, i not sure i cannot detected it.

 

 

 

-    warmmessage    -1{
OnPCLoginEvent:
attachnpctimer ""+strcharinfo+"";
initnpctimer;
end;
 
OnTimer60000: // 30mins change this to whatever you want
//mes "I have played 1 minutes and please slow down. We care about your health";
dispbottom "You have played 1 minutes and better slow down. We care about your health.";
//announce "I have played 30 minutes and please slow down. We care about your health";
stopnpctimer;
initnpctimer;
end;
}

 

I dont know is it the time or the script

Posted

1000 milliseconds is equal to 1 second.

 

MillSec | Sec | Min | Converted Milliseconds

  1000  *  60 * 30 = 1800000

 

-	warmmessage	-1,{
OnPCLoginEvent: addtimer(1800000,"warmmessage::On30Min"); end;
On30Min: message(strcharinfo(0),"You've been playing for 30 minutes please concider taking a break.");
}
Posted

1000 milliseconds is equal to 1 second.

 

MillSec | Sec | Min | Converted Milliseconds

  1000  *  60 * 30 = 1800000

 

-	warmmessage	-1,{
OnPCLoginEvent: addtimer(1800000,"warmmessage::On30Min"); end;
On30Min: message(strcharinfo(0),"You've been playing for 30 minutes please concider taking a break.");
}

Mr. Skorm, This script means that a player played for 30minute it will announce to him. How about let say if he continue playing to an hour. Is it possible to make it say you have been playing for another 30 minutes please consider taking a break?

and so on 

Posted


- warmmessage -1,{

function hourmin {

.@hour = @timeonline / 60;

.@min = @timeonline - @timeonline * ( @timeonline / 60 );

return ( ( .@hour ? .@hour +" hour(s)" : "" ) + ( .@hour && .@min ? " and " : "" ) + ( .@min ? .@min +" minutes" : "" ) );

}

On30Min:

@timeonline += 30;

message(strcharinfo(0),"You've been playing for "+ hourmin() +" please concider taking a break.");

OnPCLoginEvent:

addtimer(1800000,"warmmessage::On30Min");

end;

}

Posted
-	warmmessage	-1,{
function hourmin {
	.@hour = @timeonline / 60;
	.@min = @timeonline - @timeonline * ( @timeonline / 60 );
	return ( ( .@hour ? .@hour +" hour(s)" : "" ) + ( .@hour && .@min ? " and " : "" ) + ( .@min ? .@min +" minutes" : "" ) );
}

On30Min:
	@timeonline += 30;
	message(strcharinfo(0),"You've been playing for "+ hourmin() +" please concider taking a break.");
	
OnPCLoginEvent:
	addtimer(1800000,"warmmessage::On30Min");
	end;
}

Did it work for you? It didnt work for me.... if it worked for you kindly pleeeeaaaassseeee!!!! take a picture of it. There is no error in that script but i dont see the announce or pm or anything.

Posted


- script warmmessage -1,{

function s { return ( getarg(0) > 1 ? "s" : "" ); }

function hourmin {

.@hour = @timeonline / 60;

.@min = @timeonline % 60;

return ( ( .@hour ? .@hour +" hour"+ s(.@hour) : "" ) + ( .@hour && .@min ? " and " : "" ) + ( .@min ? .@min +" minute"+ s(.@min) : "" ) );

}

On30Min:

@timeonline += 30;

message(strcharinfo(0),"You've been playing for "+ hourmin() +" please concider taking a break.");

OnPCLoginEvent:

addtimer(1800000,"warmmessage::On30Min");

end;

}

Posted
-	script	warmmessage	-1,{
function s { return ( getarg(0) > 1 ? "s" : "" ); }
function hourmin {
	.@hour = @timeonline / 60;
	.@min = @timeonline % 60;
	return ( ( .@hour ? .@hour +" hour"+ s(.@hour) : "" ) + ( .@hour && .@min ? " and " : "" ) + ( .@min ? .@min +" minute"+ s(.@min) : "" ) );
}

On30Min:
	@timeonline += 30;
	message(strcharinfo(0),"You've been playing for "+ hourmin() +" please concider taking a break.");
	
OnPCLoginEvent:
	addtimer(1800000,"warmmessage::On30Min");
	end;
}

Still there is no error but it didnt pm me or msg anything. Did it work for you?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...