Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :?:/gi::
- Suspend Permit
- SendInput, {enter}
- IniRead, wGebietinfo, BOTZ.CC-BINDER.ini,Sonstiges, wGebietinfo
- if(wGebietinfo=1)
- {
- SendChat("/gebietinfo")
- Sleep, 200
- GetChatLine(6, Chat6)
- GetChatLine(5, Chat5)
- GetChatLine(4, Chat4)
- GetChatLine(3, Chat3)
- GetChatLine(2, Chat2)
- GetChatLine(1, Chat1)
- GetChatLine(0, Chat0)
- if(Instr(Chat1, " Restzeit:"))
- {
- RegExMatch(Chat1, "Restzeit: (.*) Tage, (.*) Stunden und (.*) Minuten", regzeit)
- RegExMatch(Chat2, " Kills: (.*)", regkills)
- RegExMatch(Chat3, " Herausforderer: (.*)", regher)
- RegExMatch(Chat4, " Kills: (.*)", reg1kills)
- RegExMatch(Chat5, " Besitzer: (.*)", regbe)
- sleep 1100
- SendChat("/f -> Gebietinfo von " regher1 " - " regbe1 " <-")
- SendChat("/f " regbe1 ": " reg1kills1 " Kills - " regher1 ": " regkills1 " Kills")
- SendChat("/f Restzeit: " regzeit1 " Tage " regzeit2 " Stunden " regzeit3 " Minuten")
- tagehour := regzeit1 * 24 * 60
- hourhour := regzeit2 * 60
- endcalc := tagehour + hourhour + regzeit3
- Jetztx := A_Hour ":" A_Min
- Jetztmin := 60 - A_Min
- Arbeitszeitx := addTime(Jetztx, endcalc)
- Stunde := a_hour
- if(regzeit1 = -1)
- {
- chat := "/f Das Gebiet endet in ca. " Jetztmin " Minuten"
- SendChat("" chat "")
- return
- }
- StringSplit, xDD, Arbeitszeitx, :
- if(xDD2 != 59 or 00)
- {
- Istbug := "Bugstunde !"
- }
- else
- {
- istbug := "Keine Bugstunde !"
- }
- time_array := StrSplit(Arbeitszeitx, ":")
- if(stunde > Arbeitszeitx) or (xDD1 = Stunde)
- {
- chat := "/f Das Gebiet endet morgen ca. um: " Arbeitszeitx " Uhr | " istbug
- endtimestamp = UnixTimeStamp(A_YYYY A_MM A_DD time_array(0) time_array(1) "00"
- }
- else
- {
- chat := "/f Das Gebiet endet heute ca. um: " Arbeitszeitx " Uhr | " istbug
- endtimestamp = UnixTimeStamp(A_YYYY A_MM A_DD+1 time_array(0) time_array(1) "00"
- }
- SendChat("" chat "")
- If(!imp_table_exist("Gebiete"))
- imp_create_table("Gebiete","Wo,Wer1,Wer2,Ende,Eingetragenum,endtimestamp")
- if(!imp_row_exist("Gebiete",zone))
- {
- imp_create_row("Gebiete",zone)
- }
- uffyaa1 := "" regher1 " : " regkills1 ""
- uffyaa2 := "" regbe1 " : " reg1kills1 ""
- asdiufhasdf := "" regzeit2 ":" regzeit3 ""
- imp_hurensohn("Gebiete",zone,"Wer1", uffyaa1)
- imp_hurensohn("Gebiete",zone,"Wer2", uffyaa2)
- imp_hurensohn("Gebiete",zone,"Ende", Arbeitszeitx)
- imp_hurensohn("Gebiete",zone,"Eingetragenum", a_dd "." a_MM "." A_YYYY " - " A_Hour ":" A_Min)
- imp_hurensohn("Gebiete",zone,"timestamp", endtimestamp)
- }
- return
- }
- else
- {
- SendChat("/gebietinfo")
- }
- Suspend Off
- return
- UnixTimeStamp(time_orig)
- {
- StringLen, date_len, time_orig
- If date_len<>14
- return "The input parameter has incorrect length or is an incorrect number format."
- If time_orig is not integer
- return "The input parameter is an incorrect number format."
- StringLeft, now_year, time_orig, 4
- StringMid, now_month, time_orig, 5, 2
- StringMid, now_day, time_orig, 7, 2
- StringMid, now_hour, time_orig, 9, 2
- StringMid, now_min, time_orig, 11, 2
- StringRight, now_sec, time_orig, 2
- ;Get year seconds
- year_sec := 31536000*(now_year - 1970)
- ;Determine how many leap days
- leap_days := (now_year - 1972)/4 + 1
- Transform, leap_days, Floor, %leap_days%
- ;Determine if date is in a leap year, and if the leap day has been yet
- this_leap := now_year/4
- Transform, this_leap_round, Floor, %this_leap%
- If (this_leap = this_leap_round)
- {
- If now_month <= 2
- leap_days-- ;subtracts 1 because this year's leap day hasn't been yet
- }
- leap_sec := leap_days*86400
- ;Determine fully completed months
- If now_month = 01
- month_sec = 0
- If now_month = 02
- month_sec = 2678400
- If now_month = 03
- month_sec = 5097600
- If now_month = 04
- month_sec = 7776000
- If now_month = 05
- month_sec = 10368000
- If now_month = 06
- month_sec = 13046400
- If now_month = 07
- month_sec = 15638400
- If now_month = 08
- month_sec = 18316800
- If now_month = 09
- month_sec = 20995200
- If now_month = 10
- month_sec = 23587200
- If now_month = 11
- month_sec = 26265600
- If now_month = 12
- month_sec = 28857600
- ;Determine fully completed days
- day_sec := (now_day - 1)*86400
- ;Determine fully completed hours
- hour_sec := now_hour*3600 ;don't subtract 1 because it starts at 0
- ;Determine fully completed minutes
- min_sec := now_min*60
- ;Calculate total seconds
- date_sec := year_sec + month_sec + day_sec + leap_sec + hour_sec + min_sec + now_sec
- return date_sec
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement