Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Leon

TIme System, based on internal clock

Recommended Posts

Just read the header of the script, it will say everything.

#===============================================================================
#  Check_Time, By Leon_Westbrooke
#-------------------------------------------------------------------------------
#  Details:
#	Will automatically change the tint of maps that it is called on based on
#	the computer's internal clock.
#
#  Instructions:
#	Place script above main, but below other default scripts.
#	On each map you want the tint set by this script, make an event as follows:
#	 [Parallel Process Event]
#	  Turn on switch 3
#	  Loop
#		Script... Check_Time.new
#		Wait 1 frame
#	  End Loop
# 
#  Notes:
#	You must set a switch to change this parallel process if you wish to change
#	the tint of the screen on that map.
#
#===============================================================================
class Check_Time
 def initialize
@time_stamp = Time.new
if $game_switches[3] == false
  if @time_stamp.strftime("%H").to_i < 6 or @time_stamp.strftime("%H").to_i > 20
	red = -100
	green = -100
	blue = -90
	$game_screen.start_tone_change(Tone.new(red, green, blue, 20), 120)
  elsif @time_stamp.strftime("%H").to_i > 5 and @time_stamp.strftime("%H").to_i < 9
	red = -60
	green = -42
	blue = -60 
	$game_screen.start_tone_change(Tone.new(red, green, blue, 15), 120)
  elsif @time_stamp.strftime("%H").to_i > 8 and @time_stamp.strftime("%H").to_i < 18
	red = 0
	green = 0
	blue = 0
	$game_screen.start_tone_change(Tone.new(red, green, blue, 0), 120)
  elsif @time_stamp.strftime("%H").to_i >17 and @time_stamp.strftime("%H").to_i  < 21
	red = -40 
	green = -60 
	blue = -60 
	$game_screen.start_tone_change(Tone.new(red, green, blue, 15), 120)
  end
else
  if @time_stamp.strftime("%H").to_i < 6 or @time_stamp.strftime("%H").to_i > 20
	red = -100 
	green = -100 
	blue = -90 
	$game_screen.start_tone_change(Tone.new(red, green, blue, 20), 0)
	$game_switches[3] = false
  elsif @time_stamp.strftime("%H").to_i > 5 and @time_stamp.strftime("%H").to_i < 9
	red = -60 
	green = -42 
	blue = -60 
	$game_screen.start_tone_change(Tone.new(red, green, blue, 15), 0)
	$game_switches[3] = false
  elsif @time_stamp.strftime("%H").to_i > 8 and @time_stamp.strftime("%H").to_i < 18
	red = 0
	green = 0
	blue = 0
	$game_screen.start_tone_change(Tone.new(red, green, blue, 0), 0)
	$game_switches[3] = false
  elsif @time_stamp.strftime("%H").to_i >17 and @time_stamp.strftime("%H").to_i  < 21
	red = -42 
	green = -60 
	blue = -60 
	$game_screen.start_tone_change(Tone.new(red, green, blue, 15), 0)
	$game_switches[3] = false
  end
end
 end
end

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...