Jump to content
  • 0

Warm announcing


cmsm94

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

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.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  275
  • Reputation:   23
  • Joined:  01/06/13
  • Last Seen:  

-     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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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 )

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

No problem /no1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

-     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

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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.");
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  275
  • Reputation:   23
  • Joined:  01/06/13
  • Last Seen:  

try testing it for 5 seconds 1st so you can see if it works then just go on google and search like (30minutes in millesconds or something) 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

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 

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


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

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


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

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

The last version is working on rAthena last revision. It displays a message on your chat window every 30 mins.

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