home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDG-CT1.DMS / in.adf / CT.run / Scripts2 / 5 / LightningBolts < prev    next >
Encoding:
Text File  |  1995-10-17  |  1.9 KB  |  97 lines

  1. /*
  2.                         Control Tower Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1995 Merlin's Software
  5. Lines=5
  6. 01=Lightning Bolts
  7. 02= 
  8. 03=This script loads each image of the File List Window
  9. 04=into ImageFX and adds simulated lightning bolts over
  10. 05=a series of frames or a Flyer clip.
  11.  
  12. */
  13.  
  14. options results
  15.  
  16. arg FrameNum TotalNum
  17. address "IMAGEFX.1"
  18. ScreenToFront
  19. if FrameNum = 0 then do
  20.     FrameNum = 1
  21.     call PickLine()
  22.     call open TempFile,"RAM:CT-IFLB",W
  23.     call writeln TempFile,Answer
  24.     call close TempFile
  25.     end
  26. else do
  27.     call open TempFile,"RAM:CT-IFLB",R
  28.     line = readln(TempFile)
  29.     parse var line X1 Y1 X2 Y2
  30.     call close TempFile
  31.     end
  32.  
  33. call GetXYCords
  34. d = (42 * FrameNum % TotalNum)
  35. GetMain
  36. PARSE VAR result name wid ht .
  37.  
  38. outerglow = ((wid + ht) % 2) % 50
  39. IF outerglow < 1 THEN outerglow = 1
  40.  
  41. Hook Lightning X1 Y1 0 X Y 255 OGlowRad outerglow Deviation d Probability 36 Seed 3711
  42.  
  43. exit
  44.  
  45.  
  46. GetXYCords:
  47.     TotalKey = 1
  48.     NumKey = (TotalNum/TotalKey)
  49.     FirstNum = ((NumKey - (NumKey-(FrameNum-1)))%NumKey)+1
  50.     SecNum = FirstNum+1
  51.     if FirstNum = TotalKey then do
  52.         NumKey = NumKey - 1
  53.         NewNum = (((FrameNum-((FirstNum-1)*NumKey)))-(TotalKey-1))
  54.         end
  55.     else 
  56.         NewNum = ((FrameNum-((FirstNum-1)*NumKey)))
  57.     if X2 < X1 then do
  58.         DiffX = -((X1-X2)/(NumKey))
  59.         end
  60.     else do
  61.         DiffX = ((X2-X1)/(NumKey))
  62.         end
  63.     if Y2 < Y1 then do
  64.         DiffY = -((Y1-Y2)/(NumKey))
  65.         end
  66.     else do
  67.         DiffY = ((Y2-Y1)/(NumKey))
  68.         end
  69.     X = (X1 + (DiffX*NewNum))-DiffX
  70.     Y = (Y1 + (DiffY*NewNum))-DiffY
  71.     X = X % 1
  72.     Y = Y % 1
  73. return
  74.  
  75. PickLine:
  76.     Menu ToolBox
  77.     RequestNotify "Draw Line From Point A To Point B For Lightning!"
  78.     DrawTool Line
  79.     HidePanel
  80.     Undo On
  81.     WaitFor SELECTDOWN
  82.     parse var result X1 Y1
  83.     WaitFor SELECTUP
  84.     parse var result X2 Y2
  85.     Undo
  86.     ShowPanel
  87.     Undo Off
  88.     X1 = strip(X1)
  89.     Y1 = strip(Y1)
  90.     X2 = strip(X2)
  91.     Y2 = strip(Y2)
  92.     Answer = X1" "Y1" "X2" "Y2
  93.     RequestResponse "Is The Line You Have Drawn Correct?"
  94.     if rc ~= 0 then call PickLine()
  95.  
  96. return
  97.