DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: DONE: script to prevent near-sightedness!  (Read 14,750 times)

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
DONE: script to prevent near-sightedness!
« on: December 01, 2005, 09:52 PM »
Thanks to mouser I found this:

Quote
14. Prevent near-sightedness!

Poor distance vision is rarely caused by genetics, says Anne Barber, O.D., an optometrist in Tacoma, Washington. "It's usually caused by near-point stress." In other words, staring at your computer screen for too long. So flex your way to 20/20 vision. Every few hours during the day, close your eyes, tense your body, take a deep breath, and, after a few seconds, release your breath and muscles at the same time. Tightening and releasing muscles such as the biceps and glutes can trick involuntary muscles -- like the eyes -- into relaxing as well.

So all we need is a bit of code what would let the user set the interval and a way it will alert the user to do exactly what's necessary! :)

This seems not only to be healthy but would also be a cool program to mention on lots of different sites, including lifehacker and stuff.


Source: http://www.menshealth.com/cda/article.do?site=MensHealth&channel=health&category=other.diseases.ailments&conitem=98f183b403517010VgnVCM200000cee793cd____&page=4

Thank you.
« Last Edit: December 02, 2005, 09:30 AM by brotherS »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: IDEA: script to prevent near-sightedness!
« Reply #1 on: December 01, 2005, 10:04 PM »
perhaps a more general solution would be a program that you could set the interval (and enable/disable), and it would blank the screen and place up one random picture from a set, until you hit a key; the pictures would be illustrations and text of different such techniques, whether they be like this, or repetetive strain excercises, etc.

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: IDEA: script to prevent near-sightedness!
« Reply #2 on: December 01, 2005, 10:09 PM »
I prefer to not being forcefully interrupted in what I'm doing at that moment, but maybe a nagging popup or something like that would be nice :)
Thank you.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA: script to prevent near-sightedness!
« Reply #3 on: December 02, 2005, 02:41 AM »
:) How about my TakeABreak v1.1?

It supports user defined messages.

Skrommel

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: IDEA: script to prevent near-sightedness!
« Reply #4 on: December 02, 2005, 09:32 AM »
:) How about my TakeABreak v1.1?

It supports user defined messages.

Skrommel
I read about TakeABreak, that's why I posted this new IDEA post: I would need a tool that won't block my desktop access completely, as useful as that may be for others :)
Thank you.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA: script to prevent near-sightedness!
« Reply #5 on: December 02, 2005, 10:28 AM »
:) Here's a little AHK script, I feel it's a bit simple for a full app.

Skrommel


Code
;EyesSore.ahk
; Show a message at a user defined interval
;Skrommel @2005    www.dcmembers.com


;Settings
interval=1                              ;time in minutes
message=How about a little break?       ;message to show

;Main
interval*=60000
Loop
{
  Sleep,%interval%
  MsgBox,%message%
}

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: IDEA: script to prevent near-sightedness!
« Reply #6 on: December 02, 2005, 04:50 PM »
Thanks for the ideas, I changed it a bit to still know the details (about what to do) later and added
Code
#Persistent
AutoExec5:
because I have to use "GoSub, AutoExec1" etc. in my AutoHotkey.ini to run more than one auto-execute script from it without problems.


Code
;2005-12-02
;prevent near-sightedness
;Show a message at a user defined interval
;http://www.donationcoder.com/forum/index.php?topic=1676.new;topicseen#new
;Skrommel @2005    www.dcmembers.com
#Persistent
AutoExec5:
;Settings
interval=60   ;time in minutes
message=Poor distance vision is usually caused by near-point stress`n-------------------------------------------------------------------------------------------`nIn other words, staring at your computer screen for too long.`nSo flex your way to 20/20 vision. Every few hours, close your`neyes, tense your body, take a deep breath, and, after a few`nseconds, release your breath and muscles at the same time.`nTightening and releasing muscles such as the biceps and glutes`ncan trick involuntary muscles - like the eyes - into relaxing as`nwell.                                             -- Anne Barber, O.D.
;Main
interval*=60000
Loop
{
  Sleep,%interval%
  MsgBox,%message%
}
Thank you.

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: DONE: script to prevent near-sightedness!
« Reply #7 on: January 02, 2006, 06:26 PM »
I almost went crazy when trying to add another script - AutoExec6 - below that script from my last post. Somehow it prevents other autoexec scripts below it from being executed... :(

Any idea why and how to fix it?
Thank you.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: DONE: script to prevent near-sightedness!
« Reply #8 on: January 03, 2006, 12:43 AM »
:tellme: You could replace the Loop with a SetTimer...

Skrommel

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: DONE: script to prevent near-sightedness!
« Reply #9 on: January 03, 2006, 06:50 AM »
Thanks, that works! I just wonder why the AHK page does not warn about using loops then...
Thank you.

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: DONE: script to prevent near-sightedness!
« Reply #10 on: January 03, 2006, 07:28 AM »
Hmm, I have another problem with this: When I use

Code
Sleep,%interval%
SetTimer, EYES, %interval%

to prevent the timer being executed immediately after starting the script if will prevent the timer in the script below from being set correctly. How do I prevent this?
Thank you.

Original address: https://www.donationcoder.com/forum/index.php?topic=1676.0