- #include <FF.au3>
- #include <INet.au3>
- #include <IE.au3>
- #include <String.au3>
- #Include <Array.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <EditConstants.au3>
- #include <GUIListBox.au3>
- #include <WindowsConstants.au3>
- #include <File.au3>
- #include <GUIListBox.au3>
- #include <ListViewConstants.au3>
- #include <ProgressConstants.au3>
- #include <StaticConstants.au3>
- #include <TabConstants.au3>
- #include <WindowsConstants.au3>
- #Include <GuiListView.au3>
- #include <WinHTTP.au3>
- main ()
- Func main ()
- ;~ startup_ini ()
- startup ()
- ;getData()
- ;getData_aufgabe ()
- ;bot ()
- patient_zu_kasse ()
- EndFunc
- Func bot ()
- #Region ### START Koda GUI section ### Form=
- $Form = GUICreate("KapiHospital", 990, 650, 192, 163)
- $Tab1 = GUICtrlCreateTab(16, 152, 953, 457)
- GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
- ;#################### Erster Tab ######################
- $Patienten = GUICtrlCreateTabItem("Patienten")
- GUICtrlSetState(-1,$GUI_SHOW)
- $listView = GUICtrlCreateListView("Patienten ID|Bild|Sitzplatz|Geheilt|Raum|Flur|Überweisung|Anzahl der Krankheiten|Zeitaufwand", 26, 187, 934, 408)
- _GUICtrlListView_AddArray ($listView, $patient_list_display)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 80)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 80)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 100)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 130)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 80)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 80)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 80)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 100)
- ;#################### Zweiter Tab ######################
- $Raume = GUICtrlCreateTabItem("Raume")
- $listView1 = GUICtrlCreateListView("Raum ID|Raumklasse|Level|Name|Status|Startzeit|Endzeit|Patienten ID|Medikation|Event|Putzen", 26, 187, 934, 408)
- _GUICtrlListView_AddArray ($listView1, $room_list_display)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 60)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 60)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 130)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 60)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 60)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 60)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 100)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 8, 100)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 9, 90)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 10, 90)
- ;#################### Dritter Tab ######################
- $Einkaufen = GUICtrlCreateTabItem("Medikation") ;
- $listView2 = GUICtrlCreateListView("ID|Classe|Anzahl im Schrank", 26, 187, 934, 408)
- _GUICtrlListView_AddArray ($listView2, $medi_av_list_display)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 130)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 130)
- GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 130)
- GUICtrlCreateTabItem("")
- ;#################### Beenden ######################
- $exit = GUICtrlCreateButton("Bot Beenden", 760, 616, 211, 25, $WS_GROUP)
- ;#################### Prio ######################
- $prio_gruppe = GUICtrlCreateGroup("Aktuelle Prioriät", 16, 24, 153, 113)
- $Radio1 = GUICtrlCreateRadio("Gewinn", 24, 52, 113, 17)
- GUICtrlSetState(-1, $GUI_CHECKED)
- $Radio2 = GUICtrlCreateRadio("Geschwindigkeit", 24, 76, 113, 17)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Radio3 = GUICtrlCreateRadio("Radio3", 24, 100, 113, 17)
- ;#################### Tagesaufgaben ######################
- $Group1 = GUICtrlCreateGroup("Tagesaufgaben", 184, 24, 577, 113)
- $Progress1 = GUICtrlCreateProgress(199, 85, 545, 17)
- $Label1 = GUICtrlCreateLabel("n/a von n/a Aufgaben gelöst.", 199, 109, 250, 17)
- $Label2 = GUICtrlCreateLabel("15 Minuten", 312, 48, 57, 17)
- $Label3 = GUICtrlCreateLabel("10 Minuten", 448, 48, 57, 17)
- $Label4 = GUICtrlCreateLabel("5 Minuten", 584, 48, 51, 17)
- $Label5 = GUICtrlCreateLabel("|", 471, 64, 6, 17)
- $Label6 = GUICtrlCreateLabel("|", 607, 64, 6, 17)
- $Label7 = GUICtrlCreateLabel("|", 335, 64, 6, 17)
- ;$Label2 = GUICtrlCreateLabel("Restzeit: ", 368, 85, 126, 17)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- ;#################### Bot Notification ######################
- ;#################### ################ ######################
- $data_reload = 0
- $data_reload_limit = Random (210, 720)
- $auto_logout = 0 ;
- $auto_logout_limit = Random(6000, 9000)
- $aufgabenstatus_prozent_ende = Random(105, 120)
- While 1
- ; ########## Statusbar berechnung der Aufgaben
- If $bot_aufgaben < 2 Then
- $aufgabenstatus_prozent = $aufgabenstatus_prozent + $aufgabenstatus_prozent_schritt
- GUICtrlSetData($progress1, $aufgabenstatus_prozent)
- If $aufgabenstatus_prozent > $aufgabenstatus_prozent_ende Then
- getData_aufgabe()
- $aufgabenstatus_prozent_ende = Random(105, 120)
- GUICtrlSetData($Label1, $aufgaben_anzahl_done&' von '&$aufgaben_anzahl_max&' Tagesaufgaben wurden bereits gelöst.')
- If $bot_aufgaben = 1 Then $bot_aufgaben = 2
- EndIf
- EndIf
- ; ########## alle Daten nach 2-4 Minuten akutalisieren
- $data_reload = $data_reload + 1
- If $data_reload > $data_reload_limit Then
- ;_FFAction('Reload')
- MsgBox(1, "neue daten", "Neue Daten empfangen?")
- getData ()
- _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listView))
- _GUICtrlListView_AddArray ($listView, $patient_list_display)
- _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listView1))
- _GUICtrlListView_AddArray ($listView1, $room_list_display)
- _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listView2))
- _GUICtrlListView_AddArray ($listView2, $medi_av_list_display)
- $data_reload = 0
- $data_reload_limit = Random (210, 720)
- EndIf
- ; ########## Auto-Logout nach 1:10 und 1:40, dann eine Pause von 10-20 Minuten, dann wird die Seite neu gestartet
- $auto_logout = $auto_logout + 1
- If $auto_logout > $auto_logout_limit Then
- _FFCmd("content.wrappedJSObject.parent.location.href='main.php?page=logout'")
- Sleep (Random(420000, 720000))
- startup ()
- $auto_logout = 0
- $auto_logout_limit = Random(6000, 9000)
- EndIf
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $exit
- $bot = 1
- Case $Radio1
- Case $Radio2
- Case $Label1
- EndSwitch
- Sleep (1000)
- WEnd
- Exit
- EndFunc
- Func startup_ini ()
- ProcessClose ( "firefox.exe")
- Sleep (8000)
- Run ("C:\Users\Coco\Daten\ff2\FirefoxPortable\FirefoxPortable.exe")
- _FFConnect(Default, Default, 3000)
- Sleep (5000)
- _FFOpenURL('http://www.kapihospital.de/index.php')
- Sleep (2000)
- login ()
- EndFunc
- Func startup ()
- _FFConnect(Default, Default, 3000)
- ;~ _FFOpenURL('http://www.kapihospital.de/index.php') ; beim testen auskommentieren
- ;~ login () ; beim testen auskommentieren
- sleep (3000)
- EndFunc
- Func login ()
- $name = "musss"
- $pw = "mussmuss"
- $station = "2" ; Aus dem Quellcode
- _FFClick("hotzone_login_head", "id") ; Den LogIn-Bereich betreten
- Sleep (2000)
- _FFCmd("content.wrappedJSObject.Map.displayCityMap()")
- Sleep(Random(3000, 4200))
- _FFFormOptionSelect("server", "name", $station, "value") ; Name des "Selects", Beschreibung, Wert den wir setzen wollen und Beschreibung
- Sleep(Random(2000, 3200))
- _FFSetValue($name, "l_loginname", "id") ; Ohne Verschlüsselung, da ich davon ausgehe, dass ihr den Bot für Eigengebrauch programmiert und sonst selbst wisst, wie das einfach realisierbar ist
- Sleep(Random(2000, 3200))
- _FFSetValue($pw, "l_password", "id")
- Sleep(Random(2000, 3200))
- _FFCmd("content.wrappedJSObject.checkFormAndSubmit('login_form')")
- Sleep(Random(4000, 4800))
- _FFLoadWait()
- Sleep(Random(4000, 4800))
- _FFLoadWait()
- EndFunc
- Func getData ()
- ;########################## Start ######################################
- _FFAction('Reload')
- $data = _FFReadHTML("body")
- $data_patients = _StringBetween($data, 'Global.patients = [{', '}];;')
- $data_patients = StringSplit($data_patients[0], "},{", 1 )
- $data_rooms = _StringBetween($data, 'Global.rooms = [{', '}];Rack')
- $data_rooms = StringSplit($data_rooms[0], "},{", 1 )
- $data_medi_av = _StringBetween($data, 'rackItems">', '<div id="blueprint')
- $data_medi_av = StringSplit($data_medi_av[0], "</div></div>", 1 )
- ;getData_aufgabe ()
- getData_rooms($data_rooms) ; Raumdaten - MUSS vor den Patienten ausgelesen werden
- getData_patient ($data_patients) ; Patientendaten
- getdata_medi ($data_medi_av)
- EndFunc
- Func getData_patient ($data_patients)
- ;########################## Patienten auslesen ######################################
- $max_patients = $data_patients[0]
- $patient_count = 0
- Global $patient_id[$max_patients]
- Global $patient_image[$max_patients]
- Global $patient_seat[$max_patients]
- Global $patient_cured[$max_patients]
- Global $patient_room[$max_patients]
- Global $patient_floor[$max_patients]
- Global $patient_referral[$max_patients]
- Global $patient_diseases[$max_patients]
- for $i = 1 to $max_patients Step 1
- $id_temp = _StringBetween($data_patients[$i], 'id":"', '","image')
- $patient_id[$patient_count] = $id_temp[0]
- $patient_count = $patient_count + 1
- Next
- ;_ArrayDisplay($patient_id, "ID")
- $patient_count = 0
- for $i = 1 to $max_patients Step 1
- $id_temp = _StringBetween($data_patients[$i], 'image":"', '","seat')
- $patient_image[$patient_count] = $id_temp[0]
- $patient_count = $patient_count + 1
- Next
- ;_ArrayDisplay($patient_image, "Bild")
- $patient_count = 0
- for $i = 1 to $max_patients Step 1
- $id_temp = _StringBetween($data_patients[$i], 'seat":"', '","cured')
- $patient_seat[$patient_count] = $id_temp[0]
- $patient_count = $patient_count + 1
- Next
- ;_ArrayDisplay($patient_seat, "Sitzplatz")
- $patient_count = 0
- for $i = 1 to $max_patients Step 1
- $id_temp = _StringBetween($data_patients[$i], 'cured":', ',"room')
- $patient_cured[$patient_count] = $id_temp[0]
- $patient_count = $patient_count + 1
- Next
- ;_ArrayDisplay($patient_cured, "Geheilt")
- $patient_count = 0
- for $i = 1 to $max_patients Step 1
- $id_temp = _StringBetween($data_patients[$i], 'room":', ',"floor')
- IF $id_temp[0] = "0" Then
- Else
- $id_temp = _StringBetween($id_temp[0], '"r', '"')
- EndIf
- $patient_room[$patient_count] = $id_temp[0]
- $patient_count = $patient_count + 1
- Next
- ;_ArrayDisplay($patient_room, "Raum")
- $patient_count = 0
- for $i = 1 to $max_patients Step 1
- $id_temp = _StringBetween($data_patients[$i], 'floor":', ',"referral')
- $patient_floor[$patient_count] = $id_temp[0]
- $patient_count = $patient_count + 1
- Next
- ;_ArrayDisplay($patient_floor, "Flur")
- $patient_count = 0
- for $i = 1 to $max_patients Step 1
- $id_temp = _StringBetween($data_patients[$i], 'referral":', ',"diseases')
- $patient_referral[$patient_count] = $id_temp[0]
- $patient_count = $patient_count + 1
- Next
- ;_ArrayDisplay($patient_referral, "Ueberweisung")
- $patient_count = 0
- for $i = 1 to $max_patients Step 1
- $id_temp = _StringBetween($data_patients[$i], 'diseases":[', ']')
- $patient_diseases[$patient_count] = $id_temp[0]
- $patient_count = $patient_count + 1
- Next
- ;_ArrayDisplay($patient_diseases, "Krankheiten")
- $patient_count = 0
- ;########################## Krankheiten ######################################
- Global $patient_diseasesTIME[$max_patients]
- Global $patient_diseasesST[$max_patients]
- dim $des_count = 0
- for $i = 0 to $max_patients - 1 Step 1
- $patient_diseasesTIME[$i] = $patient_diseases[$i]
- $all_des = StringSplit( $patient_diseasesTIME[$i], ",")
- ;_ArrayDisplay($all_des)
- $j = 1
- $des_count = 0
- While $j < $all_des[0] + 1
- Select
- Case $all_des[$j] = 1 OR $all_des[$j] = 2 OR $all_des[$j] = 5
- $des_count = $des_count + 160
- Case $all_des[$j] = 3 OR $all_des[$j] = 4
- $des_count = $des_count + 20
- Case $all_des[$j] = 6
- $des_count = $des_count + 30
- Case Else
- $j = $all_des[0]
- $des_count = "n/a"
- EndSelect
- ;MsgBox(1, "descount ist", $des_count)
- $j = $j + 1
- WEnd
- $patient_diseasesTIME[$i] = $des_count
- ;MsgBox(1, "descount final", $des_count)
- Next
- ;$patient_diseases[$i] = $des_count
- for $i = 0 to $max_patients - 1 Step 1
- $patient_diseasesST[$i] = $patient_diseases[$i]
- ;_ArrayDisplay($patient_diseasesST)
- $patient_diseasesST[$i] = StringReplace ($patient_diseasesST[$i], ",", "")
- ;_ArrayDisplay($patient_diseasesST)
- $patient_diseasesST[$i] = StringLen ($patient_diseasesST[$i])
- ;_ArrayDisplay($patient_diseasesST)
- Next
- ;########################## Liste für Patienten zur Ansicht im Bot ######################################
- Global $patient_list_display[$max_patients][9]
- for $i = 0 to $max_patients - 1 Step 1
- $patient_list_display[$i][0] = $patient_id[$i]
- Next
- for $i = 0 to $max_patients - 1 Step 1
- $patient_list_display[$i][1] = $patient_image[$i]
- Next
- for $i = 0 to $max_patients - 1 Step 1
- $patient_list_display[$i][2] = $patient_seat[$i]
- Next
- for $i = 0 to $max_patients - 1 Step 1
- $patient_list_display[$i][3] = $patient_cured[$i]
- Next
- for $i = 0 to $max_patients - 1 Step 1
- $raumnummer = $patient_room[$i]
- $raumnummer_indi = _ArraySearch ($room_id, $raumnummer, 0, 0)
- IF $raumnummer_indi = -1 Then
- $patient_list_display[$i][4] = "Flur"
- Else
- $patient_list_display[$i][4] = $room_name[$raumnummer_indi]
- EndIf
- Next
- for $i = 0 to $max_patients - 1 Step 1
- $patient_list_display[$i][5] = $patient_floor[$i]
- Next
- for $i = 0 to $max_patients - 1 Step 1
- $patient_list_display[$i][6] = $patient_referral[$i]
- Next
- for $i = 0 to $max_patients - 1 Step 1
- $patient_list_display[$i][7] = $patient_diseasesST[$i]
- Next
- for $i = 0 to $max_patients - 1 Step 1
- $patient_list_display[$i][8] = $patient_diseasesTIME[$i]
- Next
- ;_ArrayDisplay($patient_list, "Liste")
- $patient_count = 0
- EndFunc
- Func getData_rooms ($data_rooms)
- ;########################## Räume auslesen ######################################
- $max_rooms = $data_rooms[0]
- $room_count = 0
- Global $room_id[$max_rooms]
- Global $room_class[$max_rooms]
- Global $room_level[$max_rooms]
- Global $room_name[$max_rooms]
- Global $room_state[$max_rooms]
- Global $room_ends[$max_rooms]
- Global $room_started[$max_rooms]
- Global $room_patientID[$max_rooms]
- Global $room_nextMED[$max_rooms]
- Global $room_event[$max_rooms]
- Global $room_cleanup[$max_rooms]
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], '"topleft":', ',"posx')
- $room_id[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_id, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], 'roomid":', ',"upgrade')
- $room_class[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_class, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], 'upgrade":', ',"tras')
- $room_level[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_level, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], '"name":"', '","state')
- $room_name[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_name, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], 'state":', ',"ends')
- $room_state[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_state "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], '"ends":', ',"started')
- $room_ends[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_ends, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], 'started":', ',"patientid')
- $room_started[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_started, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], 'patientid":', ',"nextmed')
- $room_patientID[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_patientID, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], 'nextmed":', ',"roomid')
- $room_nextMED[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_nextMED, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], 'eventmode":', ',"cleanup')
- $room_event[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_event, "ID")
- $room_count = 0
- for $i = 1 to $max_rooms Step 1
- $id_temp = _StringBetween($data_rooms[$i], 'cleanup":', '')
- $room_cleanup[$room_count] = $id_temp[0]
- $room_count = $room_count + 1
- Next
- ;_ArrayDisplay($room_cleanup, "ID")
- $room_count = 0
- ;########################## Liste für Räume zur Anzeige im Bot ######################################
- Global $room_list_display[$max_rooms][11]
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][0] = $room_id[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][1] = $room_class[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][2] = $room_level[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][3] = $room_name[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][4] = $room_state[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][5] = $room_started[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][6] = $room_ends[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][7] = $room_patientID[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][8] = $room_nextMED[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][9] = $room_event[$i]
- Next
- for $i = 0 to $max_rooms - 1 Step 1
- $room_list_display[$i][10] = $room_cleanup[$i]
- Next
- ;~ ;_ArrayDisplay ($room_list)
- EndFunc
- Func getData_aufgabe ()
- ;########################## Start ######################################
- Sleep (2300)
- ;_FFClick("citymapclickzone", "id") ; City aufrufen
- _FFCmd("content.wrappedJSObject.Map.displayCityMap()")
- Sleep (Random(2000, 4000))
- ;_FFClick("city1_click", "id") ; City aufrufen
- _FFCmd("content.wrappedJSObject.Map.jumpTo('city1')")
- Sleep (Random(2000, 4000))
- ;_FFClick("c1_icon14", "id") ; Aufgabenseite aufrufen
- _FFCmd("content.wrappedJSObject.show_page('garage')")
- Sleep (Random(2000, 4000))
- ;########################## Aufgaben ######################################
- getAufgabeninfo()
- EndFunc
- Func getAufgabeninfo()
- $data = _FFReadHTML("body")
- Sleep (Random(2000, 4000))
- $text = _FFreadText()
- IF StringInStr ($data, "ausführen") Then
- Global $bot_aufgaben = 0
- $zeit = _StringBetween ($text, 'Punkte', 'Rollstuhl')
- $zeit = $zeit[0]
- $zeit = StringRegExpReplace($zeit, '[\v\t]+', '')
- $zeit_split = StringSplit ($zeit, ':')
- $zeit = ($zeit_split[1] * 3600 + $zeit_split[2] * 60 + $zeit_split[3]) / 100
- $zeit = 1 / $zeit
- Global $aufgabenstatus_prozent_schritt = $zeit
- ;MsgBox(1, "Aufgabenstatus Schritte", $aufgabenstatus_prozent_schritt)
- $aufgaben_anzahl = _StringBetween($text, 'eingerechnet)', 'regul')
- $aufgaben_anzahl = $aufgaben_anzahl[0]
- $aufgaben_anzahl = StringRegExpReplace($aufgaben_anzahl, 'von ', ';')
- $aufgaben_anzahl = StringRegExpReplace($aufgaben_anzahl, '[\v\t\b]', '')
- $aufgaben_anzahl = StringSplit($aufgaben_anzahl, ';')
- Global $aufgaben_anzahl_done = $aufgaben_anzahl[1]
- Global $aufgaben_anzahl_max = $aufgaben_anzahl[2]
- $id_temp = _StringBetween ($data, 'ga_timerpercentspan">', '</span')
- $aufgabenstatus = $id_temp[0]
- Global $aufgabenstatus_prozent = $aufgabenstatus
- _FFCmd("content.wrappedJSObject.Garage.doJob()")
- Sleep (Random(2000, 4000))
- Else
- ;MsgBox(1, "ausführen", "erste else")
- IF StringInStr ($data, "Du hast heute bereits alle Einsätze abgeschlossen!") Then
- Global $bot_aufgaben = 1
- $aufgaben_anzahl = _StringBetween($text, 'von ', ' regul')
- $aufgaben_anzahl = $aufgaben_anzahl[0]
- Global $aufgaben_anzahl_done = $aufgaben_anzahl
- Global $aufgaben_anzahl_max = $aufgaben_anzahl
- Global $aufgabenstatus_prozent = 0
- Global $aufgabenstatus_prozent_schritt = 0
- Else;
- Global $bot_aufgaben = 0
- $id_temp = _StringBetween ($data, 'ga_timerpercentspan">', '</span')
- $aufgabenstatus = $id_temp[0]
- Global $aufgabenstatus_prozent = $aufgabenstatus
- Global $aufgabenstatus_prozent_schritt = 0.06
- Global $aufgaben_anzahl_done = 90
- Global $aufgaben_anzahl_max = 100
- EndIf
- EndIf
- _FFAction('Reload')
- Sleep (3000)
- EndFunc
- Func getdata_medi ($data_medi_av)
- getdata_medi_av ($data_medi_av)
- EndFunc
- Func getdata_medi_av ($data_medi_av)
- $max_medi_av = $data_medi_av[0]
- $max_medi_av = $max_medi_av - 1
- $medi_count_av = 0
- Global $medi_av_amount[$max_medi_av]
- Global $medi_av_class[$max_medi_av]
- Global $medi_av_id[$max_medi_av]
- Global $medi_av_name
- for $i = 1 to $max_medi_av Step 1
- $id_temp = _StringBetween($data_medi_av[$i], 'amount="', '" ')
- $medi_av_amount[$medi_count_av] = $id_temp[0]
- $medi_count_av = $medi_count_av + 1
- Next
- ;_ArrayDisplay($medi_av_amount, "ID")
- $medi_count_av = 0
- for $i = 1 to $max_medi_av Step 1
- $id_temp = _StringBetween($data_medi_av[$i], 'med ri_a ri_', '_0"')
- $medi_av_class[$medi_count_av] = $id_temp[0]
- $medi_count_av = $medi_count_av + 1
- Next
- ;_ArrayDisplay($medi_av_class, "ID")
- $medi_count_av = 0
- for $i = 1 to $max_medi_av Step 1
- $id_temp = _StringBetween($data_medi_av[$i], ' id="rackItem', '">')
- $medi_av_id[$medi_count_av] = $id_temp[0]
- $medi_count_av = $medi_count_av + 1
- Next
- ;_ArrayDisplay($medi_av_id, "ID")
- $medi_count_av = 0
- ;################### Liste der Anzeige im Bot ################
- Global $medi_av_list_display[$max_medi_av][3]
- for $i = 0 to $max_medi_av - 1 Step 1
- $medi_av_list_display[$i][0] = $medi_av_class[$i]
- Next
- for $i = 0 to $max_medi_av - 1 Step 1
- $medi_av_list_display[$i][1] = $medi_av_id[$i]
- Next
- for $i = 0 to $max_medi_av - 1 Step 1
- $medi_av_list_display[$i][2] = $medi_av_amount[$i]
- Next
- EndFunc
- func patient_zu_kasse ()
- ;~ _FFAction('Reload')
- ;~ MsgBox(1, "jetzt gehts los", "patient zur kasse")
- $send_patient_id = 2776879
- $send_room_id = 157
- $send_room_level = 1
- ; Einloggen
- $get="/service.meds.php?room=157&lvl=1&med=1"
- $hw_open = _WinHttpOpen("AutoITBot Einloggen")
- $hw_connect = _WinHttpConnect($hw_open, "s2.kapihospital.de")
- $h_openRequest = _WinHttpOpenRequest($hw_connect,"GET", "/service.meds.php?room=157&lvl=1&med=1","HTTP/1.1", "http://s2.kapihospital.de/main.php")
- _WinHttpSendRequest($h_openRequest, "Content-Type: application/json"& @CRLF, $get)
- _WinHttpReceiveResponse($h_openRequest)
- _WinHttpCloseHandle($h_openRequest)
- _WinHttpCloseHandle($hw_connect)
- _WinHttpCloseHandle($hw_open)
- EndFunc