Macro Scheduler Interstellar Travel Simulator? Why Not?

Anything Really. Just keep it clean!

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Macro Scheduler Interstellar Travel Simulator? Why Not?

Post by JRL » Tue Jun 03, 2014 4:36 am

Plummeting toward our nearest neighboring star Alpha Centauri at a speed approaching that of light. The star will still remain a pinpoint of light for at least the next four years. Passing through heated interstellar gas clouds hoping we don't encounter anything solid larger than a couple of molecules in size.

What would the view be like peering out the front porthole?

Press Esc to abort the trip.

Code: Select all

OnEvent>key_down,VK27,0,Quit

Dialog>Dialog1
object Dialog1: TForm
  AlphaBlend = True
  AlphaBlendValue = 1
  Caption = 'Base'
  ClientHeight = 800
  ClientWidth = 800
  Color = 3
    object MSImage1: tMSImage
      Left = 0
      Top = 0
      Width = 800
      Height = 800
    end
  end
end
EndDialog>Dialog1

Dialog>Dialog2
object Dialog2: TForm
  Position = poScreenCenter
  BorderStyle = bsNone
  Caption = 'Mirror'
  ClientHeight = 800
  ClientWidth = 800
  Color = 3
  OnTaskBar = True
end
EndDialog>Dialog2


AddDialogHandler>Dialog1,,OnClose,Quit

LibFunc>user32,GetDC,HDC1,%Dialog1.handle%
LibFunc>user32,GetDC,HDC2,%Dialog2.handle%
LibFunc>Gdi32,SetStretchBltMode,SSBMres,HDC2,4
LibFunc>Gdi32,SetBrushOrgEx,SBOEres,HDC2,30,30,

SetDialogProperty>Dialog1,,AlphaBlendValue,0
Show>Dialog1
Show>Dialog2
CloseDialog>Dialog2
Let>WIN_USEHANDLE=1
GetWindowPos>dialog2.handle,WinX,WinY
Let>WIN_USEHANDLE=0
Let>LRX=%WinX%+800
Let>LRY=%WinY%+800
ScreenCapture>WinX,WinY,LRX,LRY,%temp_dir%BaseToMirror.jpg
Show>Dialog2

GoSub>Reflect
Random>8,Xlocation
Add>Xlocation,390
Let>Ylocation={%XLocation%+(%XLocation%-393)}
Random>16777215,color
GoSub>DrawArc,Dialog1.Handle,1,color,398,398,401,401,398,398,398,398
Let>kk=0
Label>Loop
  Add>kk,1
  If>kk=4
    Let>kk=0
    Random>8,Xlocation
    Add>Xlocation,390
    Let>Ylocation=%XLocation%+19
    Random>16777215,color
  EndIf
  Let>WIN_USEHANDLE=1
    GetWindowPos>dialog2.handle,WinX,WinY
  Let>WIN_USEHANDLE=0
  Let>LRX=%WinX%+800
  Let>LRY=%WinY%+800
  ScreenCapture>WinX,WinY,LRX,LRY,%temp_dir%BaseToMirror.jpg
  SetDialogProperty>Dialog1,MSimage1,LoadImage,%temp_dir%BaseToMirror.jpg
  GoSub>DrawArc,Dialog1.Handle,1,color,398,398,401,401,398,398,398,398
  GoSub>Reflect
  //Wait>0.01
Goto>Loop

//////////////////  Start Projection Sub  //////////////////
SRT>Reflect
  LibFunc>Gdi32,StretchBlt,SBres,HDC2,-40,-40,880,880,HDC1,0,0,800,800,13369376
END>Reflect
//////////////////  End Projection Sub  //////////////////

//DrawArc Usage:
//GoSub>DrawArc,WindowHandle,PenSize,PenColor,ULXLoc,ULYLoc,LRXLoc,LRYLoc,SXLoc,SYLoc,EXLoc,EYLoc
SRT>DrawArc
  LibFunc>user32,GetDC,HDC,%DrawArc_var_1%
  LibFunc>gdi32,CreatePen,Penres,0,%DrawArc_var_2%,%DrawArc_var_3%
  LibFunc>gdi32,SelectObject,SOPres,hdc,Penres
  Libfunc>gdi32,Arc,ARCres,HDC,%DrawArc_var_4%,%DrawArc_var_5%,%DrawArc_var_6%,%DrawArc_var_7%,%DrawArc_var_8%,%DrawArc_var_9%,%DrawArc_var_10%,%DrawArc_var_11%
  LibFunc>gdi32,DeleteObject,DOres,Penres
  LibFunc>user32,ReleaseDC,RDCres,HDC_1,HDC
END>DrawArc
//////////////////  End JRL's Draw Function Subs  //////////////////

SRT>Quit
  LibFunc>user32,ReleaseDC,RDCres1,HDC1_1,HDC1
  LibFunc>user32,ReleaseDC,RDCres1,HDC2_1,HDC2
  LibFunc>GDI32,DeleteObject,DOres,LIres
  DeleteFile>%temp_dir%BaseToMirror.jpg
  Exit>0
END>Quit

User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Re: Macro Scheduler Interstellar Travel Simulator? Why Not?

Post by Djek » Tue Jun 03, 2014 8:47 am

Cool !!
8)
iv made something similar a time ago. Not that cool though.
See to tide it up and if its postable.
.. ehm ? postable does not wordcheck properly.
I mean if its worth posting...
:D

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Macro Scheduler Interstellar Travel Simulator? Why Not?

Post by JRL » Tue Jun 03, 2014 3:24 pm

Excellent! I'd like to see it. "Cool" is in the eye of the beholder.

I got to work this morning and copied my own code (above) to my work computer and was very disappointed. I have my monitor brightness turned down so low that all I see is a black box with a dot in the middle of it. Had I been looking at someone else's program I would have wondered why they bothered.

I've been staring at computer screens pretty much all day long for close to 30 years. I learned a long time ago that dimming the brightness helps with eye strain, especially when the background has a lot of white.

Even though a black background is easier on the eyes, I still hate it when I come upon a website where the background is black and the text is a color that makes everything difficult to read. Generally I'll just move on. I have found that if there is info that I need its easier to read if the whole page is highlighted.

PaulSR
Pro Scripter
Posts: 65
Joined: Mon Aug 05, 2013 2:58 pm
Location: Edinburgh/Peterborough

Re: Macro Scheduler Interstellar Travel Simulator? Why Not?

Post by PaulSR » Thu Jun 05, 2014 1:48 pm

If I do select all and copy that script it pastes into MS on a single line and won't execute :x

edit: Got it by quoting the post first then copying all the code.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Re: Macro Scheduler Interstellar Travel Simulator? Why Not?

Post by jpuziano » Mon Jun 16, 2014 4:06 pm

PaulSR wrote:If I do select all and copy that script it pastes into MS on a single line and won't execute :x

edit: Got it by quoting the post first then copying all the code.
Same experience here but your workaround above made it possible to grab the code and try this out - thanks PaulSR and thanks for sharing JRL.

Hmm... on a brand new forum it would be nice if when we clicked "Select All"...

Code: Select all

...if it would copy the lines as separate lines... so then we could just paste them in and give the code a try...

...but I am using IE8 here so perhaps THAT is the problem and perhaps this works just fine on all the other browsers so I'll leave it at that...

Thanks again :D
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts