Advertisement
MrHudson

Planechase Alpha

Jul 10th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.87 KB | None | 0 0
  1. ;Name           Planechase
  2. ;Authors        Coestar and MrHudson
  3. ;Version        0.3 alpha
  4. ;Cmp date       10.07.13
  5. ;1st cmp date       10.07.13
  6. ;
  7. ;Creative Commons - Attribution - Share-Alike (CC-BY-SA) duelmasters.com.pl 2013
  8. ;All rights reserved.
  9.  
  10. #include <ButtonConstants.au3>
  11. #include <GUIConstantsEx.au3>
  12. #include <StaticConstants.au3>
  13. #include <WindowsConstants.au3>
  14. #include <Array.au3>
  15.  
  16. global $pc[40]
  17.  
  18. $pc[0] = "The Academy"
  19. $pc[1] = "Aerial Sanctuary"
  20. $pc[2] = "Afterlife"
  21. $pc[3] = "Altar of the Ashen Idol"
  22. $pc[4] = "Aquatic Temple"
  23. $pc[5] = "Ascension and Rebirth"
  24. $pc[6] = "Astral Arena"
  25. $pc[7] = "Blue Tide"
  26. $pc[8] = "Chaotic Aether"
  27. $pc[9] = "Crystal Sea"
  28. $pc[10] = "Day of Judgment"
  29. $pc[11] = "Dragonbreath"
  30. $pc[12] = "Dwacatra"
  31. $pc[13] = "Faeries' Forest"
  32. $pc[14] = "Fields of Summer"
  33. $pc[15] = "Figurehead"
  34. $pc[16] = "Fog of War"
  35. $pc[17] = "Gift of Epiphany"
  36. $pc[18] = "Goldmeadows"
  37. $pc[19] = "Horizon Boughs"
  38. $pc[20] = "Interplanar Tunnel"
  39. $pc[21] = "Mana Leak"
  40. $pc[22] = "Panopticon"
  41. $pc[23] = "Phyrexian Garrison"
  42. $pc[24] = "Plains of Havoc"
  43. $pc[25] = "Planar Split"
  44. $pc[26] = "Planewide Disaster"
  45. $pc[27] = "Pools of Becoming"
  46. $pc[28] = "Raven's Run"
  47. $pc[29] = "Replica's Revolt"
  48. $pc[30] = "Sea of Sand"
  49. $pc[31] = "Shandalar Hives"
  50. $pc[32] = "Skybreen"
  51. $pc[33] = "Spellbound Caves"
  52. $pc[34] = "Stairs to Infinity"
  53. $pc[35] = "Stronghold Furnace"
  54. $pc[36] = "Takenuma"
  55. $pc[37] = "Time Shift"
  56. $pc[38] = "Turri Island"
  57. $pc[39] = "Victory Monument"
  58.  
  59. $n_array = _ArrayShuffle($pc)
  60. $index = 0
  61.  
  62. $form1 = GUICreate("Planechase 0.3 alpha", 538, 438, 274, 134)
  63. $obrazek = GUICtrlCreatePic(@ScriptDir & "/img/Sea of Sand.jpg", 8, 8, 523, 375)
  64. $btn1 = GUICtrlCreateButton("<<", 8, 392, 81, 41)
  65. $btn2 = GUICtrlCreateButton(">>", 448, 392, 81, 41)
  66. $btn3 = GUICtrlCreateButton("Shuffle", 96, 392, 345, 41)
  67. GUISetState(@SW_SHOW)
  68.  
  69. $msg = 0
  70. While $msg <> $GUI_EVENT_CLOSE
  71.     $msg = GUIGetMsg()
  72.     Select
  73.         Case $msg = $btn1
  74.             a_minus()
  75.             GUICtrlSetImage($obrazek, @ScriptDir & "/img/" & $n_array[$index] & ".jpg")
  76.         case $msg = $btn2
  77.             a_plus()
  78.             GUICtrlSetImage($obrazek, @ScriptDir & "/img/" & $n_array[$index] & ".jpg")
  79.         case $msg = $btn3
  80.             $n_array = _ArrayShuffle($pc)
  81.             GUICtrlSetImage($obrazek, @ScriptDir & "/img/" & $n_array[$index] & ".jpg")
  82.     EndSelect
  83. WEnd
  84.  
  85. Func _ArrayShuffle($a_array,$s_start=0,$e_end=-1)
  86.     $t_array = $a_array
  87.     $t_start = $s_start
  88.     If ($e_end<>-1) Then
  89.         $t_end = $e_end
  90.     Else
  91.         $t_end = UBound($t_array)
  92.     EndIf
  93.     For $ii = $t_start to $t_end
  94.         _ArraySwap($t_array[Random($t_start,$t_end)],$t_array[Random($t_start,$t_end)])
  95.     Next
  96.     Return $t_array
  97. EndFunc
  98.  
  99. func a_plus()
  100.     if $index == 39 Then
  101.         $index = 0
  102.     Else
  103.     $index = $index + 1
  104.     EndIf
  105. EndFunc
  106.  
  107. func a_minus()
  108.     if $index == 0 Then
  109.         $index = 39
  110.     Else
  111.     $index = $index - 1
  112.     EndIf
  113. EndFunc
  114.  
  115. ;TODO:
  116. ; * Pobieranie obrazków z FTP zamiast z folderu.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement