Advertisement
pastamaker

gdip_tele

May 27th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5.  
  6.  
  7.  
  8. #SingleInstance,force
  9. #Include,<gdip>
  10. SetBatchLines, -1
  11. time_time_time := 250
  12. global width:=[]
  13. width[1]:=30
  14. mass_x:=[]
  15. mass_y:=[]
  16. global mass_x:=[2,3,4,5,6,7,7]
  17.  
  18. global mass_y:=[2,2,2,2,2,2,3]
  19.  
  20. pToken := Gdip_Startup()
  21. global game:={h:500,w:500,x:400,y:100}
  22.  
  23. gui,1:  -caption +lastfound -dpiscale +E0x80000    +AlwaysOnTop
  24. GUI,1:Show,% "x" game.x " y" game.y " w" game.w " h" game.h
  25.  
  26. global hwndl:=WinExist()
  27.  
  28. hbm := CreateDIBSection(game.w, game.h)
  29.  
  30. global hdc:=CreateCompatibleDC()
  31.  
  32. obm:=SelectObject(hdc,hbm )
  33.  
  34. global G := Gdip_GraphicsFromHDC(hdc)
  35.  
  36. Gdip_SetSmoothingMode(G, 4)
  37.  
  38.  
  39. global pbrush1:=Gdip_BrushCreateSolid("0xffaf0c0b")
  40. global pbrush2:=Gdip_BrushCreateSolid("0xff00ff00")
  41. global pbrush3:=Gdip_BrushCreateSolid("0xff0000ff")
  42. global pbrush4:=Gdip_BrushCreateSolid("0x00ffffff")
  43. global pbrush5:=Gdip_BrushCreateSolid("0xffffffff")
  44. global pbrush6:=Gdip_BrushCreateSolid("0xff0c00b0")
  45. global pbrush7:=Gdip_BrushCreateSolid("0xff000000")
  46.  
  47. ;~ pPen1 := Gdip_CreatePenFromBrush(pBrush1, 5)
  48. ;~ pPen2 := Gdip_CreatePenFromBrush(pBrush7, 1)
  49. ;~ pPen3 := Gdip_CreatePenFromBrush(pBrush7, 3)
  50. Gdip_FillRectangle(g, pBrush7, 0, 0, game.w, game.h)
  51.  
  52. UpdateLayeredWindow(hwndl, hdc, game.x, game.y, game.w, game.h)
  53.  
  54.  
  55. SetTimer,main_loop,1000
  56. return
  57.  
  58.  
  59. main_loop:
  60.  
  61. move_chain(mass_x.MaxIndex())
  62.  
  63. return
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. ; check odd ; if returns true it's an odd number like 1,3 ,,7 so on, if false it's an even number , for instance: 2,4,6.. (2018 as well)
  75. ch_odd(x){
  76.     if(mod(x,2) == 1)
  77.         return true
  78.     return false
  79. }
  80.  
  81. ; function create an array that is used while showing pictures , to show all the motion of telepostation you need to execute as many steps as this massive has, and
  82. ; every element of the array shows from what element you must start showing ellements and function show_right_odd(even - difference only in the number in terms of "oddness" &
  83. ; "evenness" ) shows where you have to stop (actually programme have, not you ,but never mind )
  84. ; as it's gpid version. we don't need to use hide functions as we just create everything on the screen from the ashes, from the very beginning, I hope you understand what i'm trying
  85. ; to say
  86.  
  87. Show_Left_ODD(byref mass,x){
  88.     mass:=[]
  89.     loop % (x-1)/2 {
  90. mass.insert(1)
  91. mass.insert(2)
  92. }
  93. t:=0
  94.     loop % x {
  95.         t++
  96. mass.insert(t)
  97. }
  98. mass.insert(0)
  99.  
  100. }
  101.  
  102.  
  103. Show_Right_ODD(byref mass,x){
  104.     mass:=[]
  105.     t:=0
  106.     loop % x {
  107.         t++
  108. mass.insert(t)
  109. }
  110.     loop % (x-1)/2 {
  111. mass.insert(x-1)
  112. mass.insert(x)
  113. }
  114.  
  115. mass.insert(0)
  116.  
  117. }
  118.  
  119.  
  120.  
  121.  
  122. Show_Left_EVEN(byref mass,x){
  123.     mass:=[]
  124.     loop % (x-2)/2 {
  125. mass.insert(1)
  126. mass.insert(2)
  127. }
  128. t:=0
  129.     loop % x {
  130.         t++
  131. mass.insert(t)
  132. }
  133. mass.insert(0)
  134.  
  135. }
  136.  
  137. Show_Right_EVEN(byref mass,x){
  138.     mass:=[]
  139.     t:=0
  140.     loop % x {
  141.         t++
  142. mass.insert(t)
  143. }
  144.     loop % (x-2)/2 {
  145. mass.insert(x-1)
  146. mass.insert(x)
  147. }
  148.  
  149. mass.insert(0)
  150.  
  151. }
  152.  
  153. ;**************************************************************************************************************\
  154.  
  155.  
  156. ;**************************************************************************************************************
  157. ;**************************************************************************************************************
  158.  
  159. move_chain(x){
  160.    
  161.     global time_time_time
  162.    
  163.         mass_S_L:=[]
  164.         mass_S_R:=[]
  165.    
  166.     if(ch_odd(x)){
  167.        
  168.         Show_Left_ODD( mass_S_L,x)
  169.        
  170.         Show_right_ODD( mass_S_R,x)
  171.        
  172.  
  173.        
  174.     }
  175.     else{
  176.         Show_Left_EVEN( mass_S_L,x)
  177.        
  178.         Show_right_EVEN( mass_S_R,x)
  179.        
  180.    
  181.    
  182.     }
  183.         QUA:=mass_S_L.MaxIndex()
  184.         t:=0
  185.         loop %qua% {
  186.             Sleep time_time_time
  187.             t++
  188.         Gdip_FillRectangle(g, pBrush7, 0, 0, game.w, game.h)
  189.         ;show - draw
  190.         a:=mass_S_L[t]
  191.         i:=a
  192.         b:=mass_S_R[t]
  193.        
  194.         while( a<>0 and i<=b ) {
  195.             ;~ GuiControl,show,chain%i%
  196.             draw_a_piece_of_the_chain(i)
  197.             i+=2
  198.     }
  199.     UpdateLayeredWindow(hwndl, hdc)
  200.     }
  201. }
  202.  
  203.  
  204. draw_a_piece_of_the_chain(i){
  205.     ToolTip,% i
  206.     w:=width[1]
  207.     x:=mass_x[i] * w
  208.     y:=mass_y[i] * w
  209.     Gdip_FillRectangle(g, pBrush5, x, y, w, w)
  210.    
  211.  
  212.    
  213.     }
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223. x::
  224. Gdip_Shutdown(pToken)
  225. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement