Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 22.61 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <FF.au3>
  2. #include <INet.au3>
  3. #include <IE.au3>
  4. #include <String.au3>
  5. #Include <Array.au3>
  6. #include <GUIConstantsEx.au3>
  7. #include <StaticConstants.au3>
  8. #include <EditConstants.au3>
  9. #include <GUIListBox.au3>
  10. #include <WindowsConstants.au3>
  11. #include <File.au3>
  12. #include <GUIListBox.au3>
  13. #include <ListViewConstants.au3>
  14. #include <ProgressConstants.au3>
  15. #include <StaticConstants.au3>
  16. #include <TabConstants.au3>
  17. #include <WindowsConstants.au3>
  18. #Include <GuiListView.au3>
  19. #include <WinHTTP.au3>
  20.  
  21.  
  22. main ()
  23.  
  24. Func main ()
  25. ;~ startup_ini ()
  26. startup ()
  27. ;getData()
  28. ;getData_aufgabe ()
  29. ;bot ()
  30. patient_zu_kasse ()
  31.  
  32. EndFunc
  33.  
  34. Func bot ()
  35. #Region ### START Koda GUI section ### Form=
  36. $Form = GUICreate("KapiHospital", 990, 650, 192, 163)
  37. $Tab1 = GUICtrlCreateTab(16, 152, 953, 457)
  38. GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
  39.  
  40. ;#################### Erster Tab ######################
  41. $Patienten = GUICtrlCreateTabItem("Patienten")
  42. GUICtrlSetState(-1,$GUI_SHOW)
  43. $listView = GUICtrlCreateListView("Patienten ID|Bild|Sitzplatz|Geheilt|Raum|Flur|Überweisung|Anzahl der Krankheiten|Zeitaufwand", 26, 187, 934, 408)
  44. _GUICtrlListView_AddArray ($listView, $patient_list_display)
  45. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80)
  46. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 80)
  47. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 80)
  48. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 100)
  49. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 130)
  50. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 80)
  51. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 80)
  52. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 80)
  53. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 100)
  54.  
  55.  
  56. ;#################### Zweiter Tab ######################
  57. $Raume = GUICtrlCreateTabItem("Raume")
  58. $listView1 = GUICtrlCreateListView("Raum ID|Raumklasse|Level|Name|Status|Startzeit|Endzeit|Patienten ID|Medikation|Event|Putzen", 26, 187, 934, 408)
  59. _GUICtrlListView_AddArray ($listView1, $room_list_display)
  60. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 60)
  61. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60)
  62. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 60)
  63. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 130)
  64. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 60)
  65. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 60)
  66. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 60)
  67. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 100)
  68. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 8, 100)
  69. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 9, 90)
  70. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 10, 90)
  71.  
  72.  
  73.  
  74. ;#################### Dritter Tab ######################
  75. $Einkaufen = GUICtrlCreateTabItem("Medikation") ;
  76. $listView2 = GUICtrlCreateListView("ID|Classe|Anzahl im Schrank", 26, 187, 934, 408)
  77. _GUICtrlListView_AddArray ($listView2, $medi_av_list_display)
  78. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 130)
  79. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 130)
  80. GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 130)
  81.  
  82. GUICtrlCreateTabItem("")
  83.  
  84. ;#################### Beenden ######################
  85. $exit = GUICtrlCreateButton("Bot Beenden", 760, 616, 211, 25, $WS_GROUP)
  86.  
  87. ;#################### Prio ######################
  88. $prio_gruppe = GUICtrlCreateGroup("Aktuelle Prioriät", 16, 24, 153, 113)
  89.  
  90. $Radio1 = GUICtrlCreateRadio("Gewinn", 24, 52, 113, 17)
  91. GUICtrlSetState(-1, $GUI_CHECKED)
  92. $Radio2 = GUICtrlCreateRadio("Geschwindigkeit", 24, 76, 113, 17)
  93. GUICtrlCreateGroup("", -99, -99, 1, 1)
  94. $Radio3 = GUICtrlCreateRadio("Radio3", 24, 100, 113, 17)
  95.  
  96. ;#################### Tagesaufgaben ######################
  97. $Group1 = GUICtrlCreateGroup("Tagesaufgaben", 184, 24, 577, 113)
  98. $Progress1 = GUICtrlCreateProgress(199, 85, 545, 17)
  99. $Label1 = GUICtrlCreateLabel("n/a von n/a Aufgaben gelöst.", 199, 109, 250, 17)
  100. $Label2 = GUICtrlCreateLabel("15 Minuten", 312, 48, 57, 17)
  101. $Label3 = GUICtrlCreateLabel("10 Minuten", 448, 48, 57, 17)
  102. $Label4 = GUICtrlCreateLabel("5 Minuten", 584, 48, 51, 17)
  103. $Label5 = GUICtrlCreateLabel("|", 471, 64, 6, 17)
  104. $Label6 = GUICtrlCreateLabel("|", 607, 64, 6, 17)
  105. $Label7 = GUICtrlCreateLabel("|", 335, 64, 6, 17)
  106.  
  107. ;$Label2 = GUICtrlCreateLabel("Restzeit: ", 368, 85, 126, 17)
  108. GUICtrlCreateGroup("", -99, -99, 1, 1)
  109. GUISetState(@SW_SHOW)
  110. #EndRegion ### END Koda GUI section ###
  111. ;#################### Bot Notification ######################
  112. ;#################### ################ ######################
  113.  
  114. $data_reload = 0
  115. $data_reload_limit = Random (210, 720)
  116.  
  117. $auto_logout = 0 ;
  118. $auto_logout_limit = Random(6000, 9000)
  119.  
  120. $aufgabenstatus_prozent_ende = Random(105, 120)
  121.  
  122. While 1
  123.         ; ########## Statusbar berechnung der Aufgaben
  124.         If $bot_aufgaben < 2 Then
  125.                         $aufgabenstatus_prozent = $aufgabenstatus_prozent + $aufgabenstatus_prozent_schritt
  126.                         GUICtrlSetData($progress1, $aufgabenstatus_prozent)
  127.                 If $aufgabenstatus_prozent > $aufgabenstatus_prozent_ende Then
  128.                         getData_aufgabe()
  129.                         $aufgabenstatus_prozent_ende = Random(105, 120)
  130.                         GUICtrlSetData($Label1, $aufgaben_anzahl_done&' von '&$aufgaben_anzahl_max&' Tagesaufgaben wurden bereits gelöst.')
  131.                         If $bot_aufgaben = 1 Then $bot_aufgaben = 2
  132.                 EndIf
  133.  
  134.         EndIf
  135.  
  136.         ; ########## alle Daten nach 2-4 Minuten akutalisieren
  137.         $data_reload = $data_reload + 1
  138.  
  139.         If $data_reload > $data_reload_limit Then
  140.                 ;_FFAction('Reload')
  141.                 MsgBox(1, "neue daten", "Neue Daten empfangen?")
  142.                 getData ()
  143.                 _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listView))
  144.                 _GUICtrlListView_AddArray ($listView, $patient_list_display)
  145.  
  146.                 _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listView1))
  147.                 _GUICtrlListView_AddArray ($listView1, $room_list_display)
  148.  
  149.                 _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listView2))
  150.                 _GUICtrlListView_AddArray ($listView2, $medi_av_list_display)
  151.                 $data_reload = 0
  152.                 $data_reload_limit = Random (210, 720)
  153.         EndIf
  154.  
  155.  
  156.                 ; ########## Auto-Logout nach 1:10 und 1:40, dann eine Pause von 10-20 Minuten, dann wird die Seite neu gestartet
  157.  
  158.         $auto_logout = $auto_logout + 1
  159.  
  160.         If $auto_logout >  $auto_logout_limit Then
  161.                 _FFCmd("content.wrappedJSObject.parent.location.href='main.php?page=logout'")
  162.                 Sleep (Random(420000, 720000))
  163.                 startup ()
  164.                 $auto_logout = 0
  165.                 $auto_logout_limit = Random(6000, 9000)
  166.         EndIf
  167.  
  168.  
  169. $nMsg = GUIGetMsg()
  170. Switch $nMsg
  171. Case $GUI_EVENT_CLOSE
  172. Exit
  173.  
  174. Case $exit
  175.         $bot = 1
  176. Case $Radio1
  177. Case $Radio2
  178. Case $Label1
  179. EndSwitch
  180.  
  181. Sleep (1000)
  182.  
  183. WEnd
  184.  
  185.  
  186. Exit
  187. EndFunc
  188.  
  189. Func startup_ini ()
  190.  
  191. ProcessClose ( "firefox.exe")
  192. Sleep (8000)
  193. Run ("C:\Users\Coco\Daten\ff2\FirefoxPortable\FirefoxPortable.exe")
  194. _FFConnect(Default, Default, 3000)
  195. Sleep (5000)
  196. _FFOpenURL('http://www.kapihospital.de/index.php')
  197. Sleep (2000)
  198.  
  199. login ()
  200.  
  201. EndFunc
  202.  
  203. Func startup ()
  204. _FFConnect(Default, Default, 3000)
  205. ;~ _FFOpenURL('http://www.kapihospital.de/index.php') ; beim testen auskommentieren
  206. ;~ login ()             ; beim testen auskommentieren
  207.  
  208. sleep (3000)
  209.  
  210. EndFunc
  211.  
  212. Func login ()
  213.  
  214. $name = "musss"
  215. $pw = "mussmuss"
  216. $station = "2" ; Aus dem Quellcode
  217.  
  218.  
  219.         _FFClick("hotzone_login_head", "id") ; Den LogIn-Bereich betreten
  220.                 Sleep (2000)
  221.                 _FFCmd("content.wrappedJSObject.Map.displayCityMap()")
  222.                 Sleep(Random(3000, 4200))
  223.                 _FFFormOptionSelect("server", "name", $station, "value") ; Name des "Selects", Beschreibung, Wert den wir setzen wollen und Beschreibung
  224.                 Sleep(Random(2000, 3200))
  225.         _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
  226.                 Sleep(Random(2000, 3200))
  227.         _FFSetValue($pw, "l_password", "id")
  228.                 Sleep(Random(2000, 3200))
  229.                 _FFCmd("content.wrappedJSObject.checkFormAndSubmit('login_form')")
  230.                 Sleep(Random(4000, 4800))
  231.                 _FFLoadWait()
  232.                 Sleep(Random(4000, 4800))
  233.                 _FFLoadWait()
  234.  
  235. EndFunc
  236.  
  237. Func getData ()
  238.  
  239. ;########################## Start ######################################
  240.  
  241. _FFAction('Reload')
  242. $data = _FFReadHTML("body")
  243.  
  244. $data_patients = _StringBetween($data, 'Global.patients = [{', '}];;')
  245. $data_patients = StringSplit($data_patients[0], "},{", 1 )
  246.  
  247. $data_rooms = _StringBetween($data, 'Global.rooms = [{', '}];Rack')
  248. $data_rooms = StringSplit($data_rooms[0], "},{", 1 )
  249.  
  250. $data_medi_av = _StringBetween($data, 'rackItems">', '<div id="blueprint')
  251. $data_medi_av = StringSplit($data_medi_av[0], "</div></div>", 1 )
  252.  
  253. ;getData_aufgabe ()
  254. getData_rooms($data_rooms) ; Raumdaten - MUSS vor den Patienten ausgelesen werden
  255. getData_patient ($data_patients) ; Patientendaten
  256. getdata_medi ($data_medi_av)
  257.  
  258.  
  259. EndFunc
  260.  
  261.  
  262. Func getData_patient ($data_patients)
  263.  
  264. ;########################## Patienten auslesen ######################################
  265. $max_patients = $data_patients[0]
  266. $patient_count = 0
  267.  
  268. Global $patient_id[$max_patients]
  269. Global $patient_image[$max_patients]
  270. Global $patient_seat[$max_patients]
  271. Global $patient_cured[$max_patients]
  272. Global $patient_room[$max_patients]
  273. Global $patient_floor[$max_patients]
  274. Global $patient_referral[$max_patients]
  275. Global $patient_diseases[$max_patients]
  276.  
  277. for $i = 1 to $max_patients Step 1
  278.         $id_temp = _StringBetween($data_patients[$i], 'id":"', '","image')
  279.         $patient_id[$patient_count] = $id_temp[0]
  280.         $patient_count = $patient_count + 1
  281. Next
  282. ;_ArrayDisplay($patient_id, "ID")
  283. $patient_count = 0
  284.  
  285. for $i = 1 to $max_patients Step 1
  286.         $id_temp = _StringBetween($data_patients[$i], 'image":"', '","seat')
  287.         $patient_image[$patient_count] = $id_temp[0]
  288.         $patient_count = $patient_count + 1
  289. Next
  290. ;_ArrayDisplay($patient_image, "Bild")
  291. $patient_count = 0
  292.  
  293. for $i = 1 to $max_patients Step 1
  294.         $id_temp = _StringBetween($data_patients[$i], 'seat":"', '","cured')
  295.         $patient_seat[$patient_count] = $id_temp[0]
  296.         $patient_count = $patient_count + 1
  297. Next
  298. ;_ArrayDisplay($patient_seat, "Sitzplatz")
  299. $patient_count = 0
  300.  
  301. for $i = 1 to $max_patients Step 1
  302.         $id_temp = _StringBetween($data_patients[$i], 'cured":', ',"room')
  303.         $patient_cured[$patient_count] = $id_temp[0]
  304.         $patient_count = $patient_count + 1
  305. Next
  306. ;_ArrayDisplay($patient_cured, "Geheilt")
  307. $patient_count = 0
  308.  
  309. for $i = 1 to $max_patients Step 1
  310.         $id_temp = _StringBetween($data_patients[$i], 'room":', ',"floor')
  311.                 IF $id_temp[0] = "0" Then
  312.                 Else
  313.                 $id_temp = _StringBetween($id_temp[0], '"r', '"')
  314.                 EndIf
  315.         $patient_room[$patient_count] = $id_temp[0]
  316.         $patient_count = $patient_count + 1
  317. Next
  318. ;_ArrayDisplay($patient_room, "Raum")
  319. $patient_count = 0
  320.  
  321. for $i = 1 to $max_patients Step 1
  322.         $id_temp = _StringBetween($data_patients[$i], 'floor":', ',"referral')
  323.         $patient_floor[$patient_count] = $id_temp[0]
  324.         $patient_count = $patient_count + 1
  325. Next
  326. ;_ArrayDisplay($patient_floor, "Flur")
  327. $patient_count = 0
  328.  
  329. for $i = 1 to $max_patients Step 1
  330.         $id_temp = _StringBetween($data_patients[$i], 'referral":', ',"diseases')
  331.         $patient_referral[$patient_count] = $id_temp[0]
  332.         $patient_count = $patient_count + 1
  333. Next
  334. ;_ArrayDisplay($patient_referral, "Ueberweisung")
  335. $patient_count = 0
  336.  
  337. for $i = 1 to $max_patients Step 1
  338.         $id_temp = _StringBetween($data_patients[$i], 'diseases":[', ']')
  339.         $patient_diseases[$patient_count] = $id_temp[0]
  340.         $patient_count = $patient_count + 1
  341. Next
  342. ;_ArrayDisplay($patient_diseases, "Krankheiten")
  343. $patient_count = 0
  344.  
  345.  
  346. ;########################## Krankheiten ######################################
  347. Global $patient_diseasesTIME[$max_patients]
  348. Global $patient_diseasesST[$max_patients]
  349. dim $des_count = 0
  350.  
  351. for $i = 0 to $max_patients - 1 Step 1
  352.         $patient_diseasesTIME[$i] = $patient_diseases[$i]
  353.         $all_des = StringSplit( $patient_diseasesTIME[$i], ",")
  354.         ;_ArrayDisplay($all_des)
  355.         $j = 1
  356.         $des_count = 0
  357.  
  358.         While $j < $all_des[0] + 1
  359.  
  360.                 Select
  361.                         Case $all_des[$j] = 1 OR $all_des[$j] = 2 OR $all_des[$j] = 5
  362.                                 $des_count = $des_count + 160
  363.                         Case $all_des[$j] = 3 OR $all_des[$j] = 4
  364.                                 $des_count = $des_count + 20
  365.                         Case $all_des[$j] = 6
  366.                                 $des_count = $des_count + 30
  367.                         Case Else
  368.                                 $j = $all_des[0]
  369.                                 $des_count = "n/a"
  370.  
  371.                 EndSelect
  372.         ;MsgBox(1, "descount ist", $des_count)
  373.         $j = $j + 1
  374. WEnd
  375.  
  376. $patient_diseasesTIME[$i] = $des_count
  377. ;MsgBox(1, "descount final", $des_count)
  378. Next
  379.  
  380.         ;$patient_diseases[$i] = $des_count
  381.  
  382. for $i = 0 to $max_patients - 1 Step 1
  383.         $patient_diseasesST[$i] = $patient_diseases[$i]
  384.         ;_ArrayDisplay($patient_diseasesST)
  385.         $patient_diseasesST[$i] = StringReplace ($patient_diseasesST[$i], ",", "")
  386.         ;_ArrayDisplay($patient_diseasesST)
  387.         $patient_diseasesST[$i] = StringLen ($patient_diseasesST[$i])
  388.         ;_ArrayDisplay($patient_diseasesST)
  389.         Next
  390.  
  391.  
  392. ;########################## Liste für Patienten zur Ansicht im Bot ######################################
  393. Global $patient_list_display[$max_patients][9]
  394.  
  395. for $i = 0 to $max_patients - 1 Step 1
  396.         $patient_list_display[$i][0] = $patient_id[$i]
  397. Next
  398. for $i = 0 to $max_patients - 1 Step 1
  399.         $patient_list_display[$i][1] = $patient_image[$i]
  400. Next
  401. for $i = 0 to $max_patients - 1 Step 1
  402.         $patient_list_display[$i][2] = $patient_seat[$i]
  403. Next
  404. for $i = 0 to $max_patients - 1 Step 1
  405.         $patient_list_display[$i][3] = $patient_cured[$i]
  406. Next
  407. for $i = 0 to $max_patients - 1 Step 1
  408.         $raumnummer = $patient_room[$i]
  409.         $raumnummer_indi = _ArraySearch ($room_id, $raumnummer, 0, 0)
  410.         IF $raumnummer_indi = -1 Then
  411.         $patient_list_display[$i][4] = "Flur"
  412.         Else
  413.         $patient_list_display[$i][4] = $room_name[$raumnummer_indi]
  414.         EndIf
  415. Next
  416. for $i = 0 to $max_patients - 1 Step 1
  417.         $patient_list_display[$i][5] = $patient_floor[$i]
  418. Next
  419. for $i = 0 to $max_patients - 1 Step 1
  420.         $patient_list_display[$i][6] = $patient_referral[$i]
  421. Next
  422. for $i = 0 to $max_patients - 1 Step 1
  423.         $patient_list_display[$i][7] = $patient_diseasesST[$i]
  424. Next
  425. for $i = 0 to $max_patients - 1 Step 1
  426.         $patient_list_display[$i][8] = $patient_diseasesTIME[$i]
  427. Next
  428.  
  429. ;_ArrayDisplay($patient_list, "Liste")
  430. $patient_count = 0
  431.  
  432. EndFunc
  433.  
  434. Func getData_rooms ($data_rooms)
  435.         ;########################## Räume auslesen ######################################
  436. $max_rooms = $data_rooms[0]
  437. $room_count = 0
  438.  
  439. Global $room_id[$max_rooms]
  440. Global $room_class[$max_rooms]
  441. Global $room_level[$max_rooms]
  442. Global $room_name[$max_rooms]
  443. Global $room_state[$max_rooms]
  444. Global $room_ends[$max_rooms]
  445. Global $room_started[$max_rooms]
  446. Global $room_patientID[$max_rooms]
  447. Global $room_nextMED[$max_rooms]
  448. Global $room_event[$max_rooms]
  449. Global $room_cleanup[$max_rooms]
  450.  
  451.  
  452.  
  453. for $i = 1 to $max_rooms Step 1
  454.         $id_temp = _StringBetween($data_rooms[$i], '"topleft":', ',"posx')
  455.         $room_id[$room_count] = $id_temp[0]
  456.         $room_count = $room_count + 1
  457. Next
  458. ;_ArrayDisplay($room_id, "ID")
  459. $room_count = 0
  460.  
  461. for $i = 1 to $max_rooms Step 1
  462.         $id_temp = _StringBetween($data_rooms[$i], 'roomid":', ',"upgrade')
  463.         $room_class[$room_count] = $id_temp[0]
  464.         $room_count = $room_count + 1
  465. Next
  466. ;_ArrayDisplay($room_class, "ID")
  467. $room_count = 0
  468. for $i = 1 to $max_rooms Step 1
  469.         $id_temp = _StringBetween($data_rooms[$i], 'upgrade":', ',"tras')
  470.         $room_level[$room_count] = $id_temp[0]
  471.         $room_count = $room_count + 1
  472. Next
  473. ;_ArrayDisplay($room_level, "ID")
  474. $room_count = 0
  475. for $i = 1 to $max_rooms Step 1
  476.         $id_temp = _StringBetween($data_rooms[$i], '"name":"', '","state')
  477.         $room_name[$room_count] = $id_temp[0]
  478.         $room_count = $room_count + 1
  479. Next
  480. ;_ArrayDisplay($room_name, "ID")
  481. $room_count = 0
  482.  
  483. for $i = 1 to $max_rooms Step 1
  484.         $id_temp = _StringBetween($data_rooms[$i], 'state":', ',"ends')
  485.         $room_state[$room_count] = $id_temp[0]
  486.         $room_count = $room_count + 1
  487. Next
  488. ;_ArrayDisplay($room_state "ID")
  489. $room_count = 0
  490.  
  491. for $i = 1 to $max_rooms Step 1
  492.         $id_temp = _StringBetween($data_rooms[$i], '"ends":', ',"started')
  493.         $room_ends[$room_count] = $id_temp[0]
  494.         $room_count = $room_count + 1
  495. Next
  496. ;_ArrayDisplay($room_ends, "ID")
  497. $room_count = 0
  498.  
  499. for $i = 1 to $max_rooms Step 1
  500.         $id_temp = _StringBetween($data_rooms[$i], 'started":', ',"patientid')
  501.         $room_started[$room_count] = $id_temp[0]
  502.         $room_count = $room_count + 1
  503. Next
  504. ;_ArrayDisplay($room_started, "ID")
  505. $room_count = 0
  506.  
  507. for $i = 1 to $max_rooms Step 1
  508.         $id_temp = _StringBetween($data_rooms[$i], 'patientid":', ',"nextmed')
  509.         $room_patientID[$room_count] = $id_temp[0]
  510.         $room_count = $room_count + 1
  511. Next
  512. ;_ArrayDisplay($room_patientID, "ID")
  513. $room_count = 0
  514.  
  515. for $i = 1 to $max_rooms Step 1
  516.         $id_temp = _StringBetween($data_rooms[$i], 'nextmed":', ',"roomid')
  517.         $room_nextMED[$room_count] = $id_temp[0]
  518.         $room_count = $room_count + 1
  519. Next
  520. ;_ArrayDisplay($room_nextMED, "ID")
  521. $room_count = 0
  522.  
  523. for $i = 1 to $max_rooms Step 1
  524.         $id_temp = _StringBetween($data_rooms[$i], 'eventmode":', ',"cleanup')
  525.         $room_event[$room_count] = $id_temp[0]
  526.         $room_count = $room_count + 1
  527. Next
  528. ;_ArrayDisplay($room_event, "ID")
  529. $room_count = 0
  530.  
  531. for $i = 1 to $max_rooms Step 1
  532.         $id_temp = _StringBetween($data_rooms[$i], 'cleanup":', '')
  533.         $room_cleanup[$room_count] = $id_temp[0]
  534.         $room_count = $room_count + 1
  535. Next
  536. ;_ArrayDisplay($room_cleanup, "ID")
  537. $room_count = 0
  538.  
  539.  
  540. ;########################## Liste für Räume zur Anzeige im Bot ######################################
  541. Global $room_list_display[$max_rooms][11]
  542.  
  543. for $i = 0 to $max_rooms - 1 Step 1
  544.         $room_list_display[$i][0] = $room_id[$i]
  545. Next
  546. for $i = 0 to $max_rooms - 1 Step 1
  547.         $room_list_display[$i][1] = $room_class[$i]
  548. Next
  549. for $i = 0 to $max_rooms - 1 Step 1
  550.         $room_list_display[$i][2] = $room_level[$i]
  551. Next
  552. for $i = 0 to $max_rooms - 1 Step 1
  553.         $room_list_display[$i][3] = $room_name[$i]
  554. Next
  555. for $i = 0 to $max_rooms - 1 Step 1
  556.         $room_list_display[$i][4] = $room_state[$i]
  557. Next
  558. for $i = 0 to $max_rooms - 1 Step 1
  559.         $room_list_display[$i][5] = $room_started[$i]
  560. Next
  561. for $i = 0 to $max_rooms - 1 Step 1
  562.         $room_list_display[$i][6] = $room_ends[$i]
  563. Next
  564. for $i = 0 to $max_rooms - 1 Step 1
  565.         $room_list_display[$i][7] = $room_patientID[$i]
  566. Next
  567. for $i = 0 to $max_rooms - 1 Step 1
  568.         $room_list_display[$i][8] = $room_nextMED[$i]
  569. Next
  570. for $i = 0 to $max_rooms - 1 Step 1
  571.         $room_list_display[$i][9] = $room_event[$i]
  572. Next
  573. for $i = 0 to $max_rooms - 1 Step 1
  574.         $room_list_display[$i][10] = $room_cleanup[$i]
  575. Next
  576. ;~ ;_ArrayDisplay ($room_list)
  577.  
  578. EndFunc
  579.  
  580. Func getData_aufgabe ()
  581.  
  582. ;########################## Start ######################################
  583.  
  584. Sleep (2300)
  585.  
  586. ;_FFClick("citymapclickzone", "id") ; City aufrufen
  587. _FFCmd("content.wrappedJSObject.Map.displayCityMap()")
  588. Sleep (Random(2000, 4000))
  589. ;_FFClick("city1_click", "id") ; City aufrufen
  590. _FFCmd("content.wrappedJSObject.Map.jumpTo('city1')")
  591. Sleep (Random(2000, 4000))
  592. ;_FFClick("c1_icon14", "id") ; Aufgabenseite aufrufen
  593. _FFCmd("content.wrappedJSObject.show_page('garage')")
  594. Sleep (Random(2000, 4000))
  595.  
  596. ;########################## Aufgaben ######################################
  597.  
  598.  
  599. getAufgabeninfo()
  600.  
  601.  
  602. EndFunc
  603.  
  604. Func getAufgabeninfo()
  605.  
  606. $data = _FFReadHTML("body")
  607. Sleep (Random(2000, 4000))
  608.  
  609. $text = _FFreadText()
  610.  
  611. IF StringInStr ($data, "ausführen") Then
  612.         Global $bot_aufgaben = 0
  613.         $zeit = _StringBetween ($text, 'Punkte', 'Rollstuhl')
  614.         $zeit = $zeit[0]
  615.         $zeit = StringRegExpReplace($zeit, '[\v\t]+', '')
  616.         $zeit_split = StringSplit ($zeit, ':')
  617.         $zeit = ($zeit_split[1] * 3600  + $zeit_split[2] * 60 + $zeit_split[3]) / 100
  618.         $zeit = 1 / $zeit
  619.  
  620.         Global $aufgabenstatus_prozent_schritt = $zeit
  621.         ;MsgBox(1, "Aufgabenstatus Schritte", $aufgabenstatus_prozent_schritt)
  622.  
  623.         $aufgaben_anzahl = _StringBetween($text, 'eingerechnet)', 'regul')
  624.         $aufgaben_anzahl = $aufgaben_anzahl[0]
  625.         $aufgaben_anzahl = StringRegExpReplace($aufgaben_anzahl, 'von ', ';')
  626.         $aufgaben_anzahl = StringRegExpReplace($aufgaben_anzahl, '[\v\t\b]', '')
  627.         $aufgaben_anzahl = StringSplit($aufgaben_anzahl, ';')
  628.  
  629.         Global $aufgaben_anzahl_done = $aufgaben_anzahl[1]
  630.         Global $aufgaben_anzahl_max = $aufgaben_anzahl[2]
  631.  
  632.         $id_temp = _StringBetween ($data, 'ga_timerpercentspan">', '</span')
  633.         $aufgabenstatus = $id_temp[0]
  634.         Global $aufgabenstatus_prozent = $aufgabenstatus
  635.  
  636.         _FFCmd("content.wrappedJSObject.Garage.doJob()")
  637.         Sleep (Random(2000, 4000))
  638.  
  639. Else
  640.         ;MsgBox(1, "ausführen", "erste else")
  641.         IF StringInStr ($data, "Du hast heute bereits alle Einsätze abgeschlossen!") Then
  642.         Global $bot_aufgaben = 1
  643.  
  644.         $aufgaben_anzahl = _StringBetween($text, 'von ', ' regul')
  645.         $aufgaben_anzahl = $aufgaben_anzahl[0]
  646.  
  647.         Global $aufgaben_anzahl_done = $aufgaben_anzahl
  648.         Global $aufgaben_anzahl_max = $aufgaben_anzahl
  649.  
  650.         Global $aufgabenstatus_prozent = 0
  651.         Global $aufgabenstatus_prozent_schritt = 0
  652.  
  653.  
  654.         Else;
  655.                 Global $bot_aufgaben = 0
  656.                 $id_temp = _StringBetween ($data, 'ga_timerpercentspan">', '</span')
  657.                 $aufgabenstatus = $id_temp[0]
  658.                 Global $aufgabenstatus_prozent = $aufgabenstatus
  659.  
  660.                 Global $aufgabenstatus_prozent_schritt = 0.06
  661.                 Global $aufgaben_anzahl_done = 90
  662.                 Global $aufgaben_anzahl_max = 100
  663.  
  664.         EndIf
  665. EndIf
  666.  
  667. _FFAction('Reload')
  668. Sleep (3000)
  669.  
  670.  
  671. EndFunc
  672.  
  673. Func getdata_medi ($data_medi_av)
  674.  
  675.  
  676.  
  677.  getdata_medi_av ($data_medi_av)
  678.         EndFunc
  679.  
  680. Func getdata_medi_av ($data_medi_av)
  681.  
  682. $max_medi_av = $data_medi_av[0]
  683. $max_medi_av = $max_medi_av - 1
  684. $medi_count_av = 0
  685.  
  686. Global $medi_av_amount[$max_medi_av]
  687. Global $medi_av_class[$max_medi_av]
  688. Global $medi_av_id[$max_medi_av]
  689.  
  690. Global $medi_av_name
  691.  
  692.  
  693. for $i = 1 to $max_medi_av Step 1
  694.         $id_temp = _StringBetween($data_medi_av[$i], 'amount="', '" ')
  695.         $medi_av_amount[$medi_count_av] = $id_temp[0]
  696.         $medi_count_av = $medi_count_av + 1
  697. Next
  698. ;_ArrayDisplay($medi_av_amount, "ID")
  699. $medi_count_av = 0
  700.  
  701. for $i = 1 to $max_medi_av Step 1
  702.         $id_temp = _StringBetween($data_medi_av[$i], 'med ri_a ri_', '_0"')
  703.         $medi_av_class[$medi_count_av] = $id_temp[0]
  704.         $medi_count_av = $medi_count_av + 1
  705. Next
  706. ;_ArrayDisplay($medi_av_class, "ID")
  707. $medi_count_av = 0
  708.  
  709. for $i = 1 to $max_medi_av Step 1
  710.         $id_temp = _StringBetween($data_medi_av[$i], ' id="rackItem', '">')
  711.         $medi_av_id[$medi_count_av] = $id_temp[0]
  712.         $medi_count_av = $medi_count_av + 1
  713. Next
  714. ;_ArrayDisplay($medi_av_id, "ID")
  715. $medi_count_av = 0
  716.  
  717.  
  718.  
  719.  
  720. ;################### Liste der Anzeige im Bot ################
  721.  
  722. Global $medi_av_list_display[$max_medi_av][3]
  723.  
  724. for $i = 0 to $max_medi_av - 1 Step 1
  725.         $medi_av_list_display[$i][0] = $medi_av_class[$i]
  726. Next
  727. for $i = 0 to $max_medi_av - 1 Step 1
  728.         $medi_av_list_display[$i][1] = $medi_av_id[$i]
  729. Next
  730. for $i = 0 to $max_medi_av - 1 Step 1
  731.         $medi_av_list_display[$i][2] = $medi_av_amount[$i]
  732. Next
  733.  
  734. EndFunc
  735.  
  736.  
  737. func patient_zu_kasse ()
  738. ;~      _FFAction('Reload')
  739. ;~      MsgBox(1, "jetzt gehts los", "patient zur kasse")
  740.  
  741.         $send_patient_id = 2776879
  742.         $send_room_id = 157
  743.         $send_room_level = 1
  744.  
  745.  
  746. ; Einloggen
  747. $get="/service.meds.php?room=157&lvl=1&med=1"
  748. $hw_open = _WinHttpOpen("AutoITBot Einloggen")
  749. $hw_connect = _WinHttpConnect($hw_open, "s2.kapihospital.de")
  750. $h_openRequest = _WinHttpOpenRequest($hw_connect,"GET", "/service.meds.php?room=157&lvl=1&med=1","HTTP/1.1", "http://s2.kapihospital.de/main.php")
  751. _WinHttpSendRequest($h_openRequest, "Content-Type: application/json"& @CRLF, $get)
  752. _WinHttpReceiveResponse($h_openRequest)
  753.  
  754.  
  755. _WinHttpCloseHandle($h_openRequest)
  756. _WinHttpCloseHandle($hw_connect)
  757. _WinHttpCloseHandle($hw_open)
  758.  
  759.  
  760.  
  761.  
  762. EndFunc