Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. :?:/gi::
  2. Suspend Permit
  3. SendInput, {enter}
  4. IniRead, wGebietinfo, BOTZ.CC-BINDER.ini,Sonstiges, wGebietinfo
  5. if(wGebietinfo=1)
  6. {
  7. SendChat("/gebietinfo")
  8. Sleep, 200
  9. GetChatLine(6, Chat6)
  10. GetChatLine(5, Chat5)
  11. GetChatLine(4, Chat4)
  12. GetChatLine(3, Chat3)
  13. GetChatLine(2, Chat2)
  14. GetChatLine(1, Chat1)
  15. GetChatLine(0, Chat0)
  16. if(Instr(Chat1, " Restzeit:"))
  17. {
  18. RegExMatch(Chat1, "Restzeit: (.*) Tage, (.*) Stunden und (.*) Minuten", regzeit)
  19. RegExMatch(Chat2, " Kills: (.*)", regkills)
  20. RegExMatch(Chat3, " Herausforderer: (.*)", regher)
  21. RegExMatch(Chat4, " Kills: (.*)", reg1kills)
  22. RegExMatch(Chat5, " Besitzer: (.*)", regbe)
  23. sleep 1100
  24.  
  25. SendChat("/f -> Gebietinfo von " regher1 " - " regbe1 " <-")
  26. SendChat("/f " regbe1 ": " reg1kills1 " Kills - " regher1 ": " regkills1 " Kills")
  27. SendChat("/f Restzeit: " regzeit1 " Tage " regzeit2 " Stunden " regzeit3 " Minuten")
  28.  
  29. tagehour := regzeit1 * 24 * 60
  30. hourhour := regzeit2 * 60
  31. endcalc := tagehour + hourhour + regzeit3
  32. Jetztx := A_Hour ":" A_Min
  33. Jetztmin := 60 - A_Min
  34. Arbeitszeitx := addTime(Jetztx, endcalc)
  35. Stunde := a_hour
  36. if(regzeit1 = -1)
  37. {
  38. chat := "/f Das Gebiet endet in ca. " Jetztmin " Minuten"
  39. SendChat("" chat "")
  40. return
  41. }
  42. StringSplit, xDD, Arbeitszeitx, :
  43. if(xDD2 != 59 or 00)
  44. {
  45. Istbug := "Bugstunde !"
  46. }
  47. else
  48. {
  49. istbug := "Keine Bugstunde !"
  50. }
  51. time_array := StrSplit(Arbeitszeitx, ":")
  52. if(stunde > Arbeitszeitx) or (xDD1 = Stunde)
  53. {
  54. chat := "/f Das Gebiet endet morgen ca. um: " Arbeitszeitx " Uhr | " istbug
  55. endtimestamp = UnixTimeStamp(A_YYYY A_MM A_DD time_array(0) time_array(1) "00"
  56. }
  57. else
  58. {
  59. chat := "/f Das Gebiet endet heute ca. um: " Arbeitszeitx " Uhr | " istbug
  60. endtimestamp = UnixTimeStamp(A_YYYY A_MM A_DD+1 time_array(0) time_array(1) "00"
  61. }
  62. SendChat("" chat "")
  63.  
  64. If(!imp_table_exist("Gebiete"))
  65. imp_create_table("Gebiete","Wo,Wer1,Wer2,Ende,Eingetragenum,endtimestamp")
  66.  
  67. if(!imp_row_exist("Gebiete",zone))
  68. {
  69. imp_create_row("Gebiete",zone)
  70. }
  71.  
  72.  
  73.  
  74. uffyaa1 := "" regher1 " : " regkills1 ""
  75. uffyaa2 := "" regbe1 " : " reg1kills1 ""
  76. asdiufhasdf := "" regzeit2 ":" regzeit3 ""
  77. imp_hurensohn("Gebiete",zone,"Wer1", uffyaa1)
  78. imp_hurensohn("Gebiete",zone,"Wer2", uffyaa2)
  79. imp_hurensohn("Gebiete",zone,"Ende", Arbeitszeitx)
  80. imp_hurensohn("Gebiete",zone,"Eingetragenum", a_dd "." a_MM "." A_YYYY " - " A_Hour ":" A_Min)
  81. imp_hurensohn("Gebiete",zone,"timestamp", endtimestamp)
  82. }
  83. return
  84. }
  85. else
  86. {
  87. SendChat("/gebietinfo")
  88. }
  89. Suspend Off
  90. return
  91.  
  92.  
  93.  
  94.  
  95.  
  96. UnixTimeStamp(time_orig)
  97. {
  98. StringLen, date_len, time_orig
  99. If date_len<>14
  100. return "The input parameter has incorrect length or is an incorrect number format."
  101. If time_orig is not integer
  102. return "The input parameter is an incorrect number format."
  103.  
  104. StringLeft, now_year, time_orig, 4
  105. StringMid, now_month, time_orig, 5, 2
  106. StringMid, now_day, time_orig, 7, 2
  107. StringMid, now_hour, time_orig, 9, 2
  108. StringMid, now_min, time_orig, 11, 2
  109. StringRight, now_sec, time_orig, 2
  110.  
  111. ;Get year seconds
  112. year_sec := 31536000*(now_year - 1970)
  113.  
  114. ;Determine how many leap days
  115. leap_days := (now_year - 1972)/4 + 1
  116. Transform, leap_days, Floor, %leap_days%
  117.  
  118. ;Determine if date is in a leap year, and if the leap day has been yet
  119. this_leap := now_year/4
  120. Transform, this_leap_round, Floor, %this_leap%
  121. If (this_leap = this_leap_round)
  122. {
  123. If now_month <= 2
  124. leap_days-- ;subtracts 1 because this year's leap day hasn't been yet
  125. }
  126. leap_sec := leap_days*86400
  127.  
  128. ;Determine fully completed months
  129. If now_month = 01
  130. month_sec = 0
  131. If now_month = 02
  132. month_sec = 2678400
  133. If now_month = 03
  134. month_sec = 5097600
  135. If now_month = 04
  136. month_sec = 7776000
  137. If now_month = 05
  138. month_sec = 10368000
  139. If now_month = 06
  140. month_sec = 13046400
  141. If now_month = 07
  142. month_sec = 15638400
  143. If now_month = 08
  144. month_sec = 18316800
  145. If now_month = 09
  146. month_sec = 20995200
  147. If now_month = 10
  148. month_sec = 23587200
  149. If now_month = 11
  150. month_sec = 26265600
  151. If now_month = 12
  152. month_sec = 28857600
  153.  
  154.  
  155. ;Determine fully completed days
  156. day_sec := (now_day - 1)*86400
  157.  
  158. ;Determine fully completed hours
  159. hour_sec := now_hour*3600 ;don't subtract 1 because it starts at 0
  160.  
  161. ;Determine fully completed minutes
  162. min_sec := now_min*60
  163.  
  164. ;Calculate total seconds
  165. date_sec := year_sec + month_sec + day_sec + leap_sec + hour_sec + min_sec + now_sec
  166.  
  167. return date_sec
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement