Jump to content

slaughter

Active Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by slaughter

  1. How to get users logon information. User name, domain, password... etc... I have program witch is based on Domain user names and paswords. So i nead to know curent username and pasword. Or to check is user curently loged on domain not to local computer. Thats shuld be done in client side, not server. What allredy i know: @UserName - ID of the currently logged on user. @UserProfileDir - Path to current user's Profile folder. @LogonDNSDomain - Logon DNS Domain. @LogonDomain - Logon Domain. @LogonServer - Logon server. So how to extract current user password ? Or is it possible at all?
  2. nice muttley Maybe you can put your pice of code?
  3. OLD one found on forum maybe later will find updated one Public. Neads translation muttley No coments no adds. If you good enuog it will work for you auto atack, Build list quea. All is doen just work aruond to make all functions workinkg. to make all buttons work neads abuot 20 lines functions_v3.au3 Global $oIE, $hListView_0[255] Func inital_starup() Global $hListView_0, $Link = InputBox("Serveris", "Serveris","http://s3.travian.lt"), $User = InputBox("Varototojas", "Vartotojo vardas",""), $Pass = InputBox("Varototojas", "Vartotojo slaptazodis", "","*") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "yes") Global $oIE = _IECreate($Link, 1, 1) _IENavigate ($oIE, $Link) Login($User, $Pass) data_update() EndFunc Func data_update() _IENavigate ($oIE, $Link & "/dorf1.php") ;~ $oTable = _IETableGetCollection ($oIE, 0) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "0") ;~ $oTable = _IETableGetCollection ($oIE, 1) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "1") ;~ $oTable = _IETableGetCollection ($oIE, 2) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "2") ;~ $oTable = _IETableGetCollection ($oIE, 3) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "3") ;~ $oTable = _IETableGetCollection ($oIE, 4) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "4") ;~ $oTable = _IETableGetCollection ($oIE, 5) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "5") ;~ $oTable = _IETableGetCollection ($oIE, 6) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "6") ;~ $oTable = _IETableGetCollection ($oIE, 7) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "7") Global $Label1, $Label4, $Label6, $Label8, $Label11, $Label12, $Label13, $Label16 ;~ $Source = _IEDocReadHTML($oIE) $Source = _INetGetSource($Link & "/dorf1.php") ;~ FW("souce",$Source) $result = StringInStr($Source, "jimas:") ;~ MsgBox(1, "pulimas", $result ) if $result = 0 Then $puolimas = 0 else $puolimas = 1 EndIf $oTable = _IETableGetCollection ($oIE, 1+$puolimas) $aTableData2 = _IETableWriteToArray ($oTable, True) $line = $aTableData2[0][2] GUICtrlSetData($Label1,$line) $line = $aTableData2[1][2] GUICtrlSetData($Label4,$line) $line = $aTableData2[2][2] GUICtrlSetData($Label6,$line) $line = $aTableData2[3][2] GUICtrlSetData($Label8,$line) $Source = _IEDocReadHTML($oIE) $data = _StringBetween($Source, '<a href="?newdid=', '</a>') if Not @Error Then ;~ ------------------------------------> JEIGU YRA DAUGIAU MIESTU $oTable = _IETableGetCollection ($oIE, 2+$puolimas) $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "Armija") $Source = _IEDocReadHTML($oIE) $result = StringInStr($Source, "Statybos pabaiga") if $result = 0 Then $statybos = 0 else $statybos = 1 EndIf If $statybos = 0 Then $line = "" GUICtrlSetData($Label17,$line) $oTable = _IETableGetCollection ($oIE, 3+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "Miestai") $kiek_miestu = UBound($aTableData3)+1 $oTable = _IETableGetCollection ($oIE, $kiek_miestu+3+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "sandelis arba statybos 3") $oTable = _IETableGetCollection ($oIE, $kiek_miestu+4+$puolimas) $aTableData4 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData4, "jei statybos sandelis") Else $oTable = _IETableGetCollection ($oIE, 4+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "Miestai") $kiek_miestu = UBound($aTableData3)+1 $oTable = _IETableGetCollection ($oIE, 3+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "statybos") $oTable = _IETableGetCollection ($oIE, $kiek_miestu+4+$puolimas) $aTableData4 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData4, "sandelis") EndIf If $statybos = 0 Then $line = "" GUICtrlSetData($Label17,$line) $line = $aTableData3[0][1] GUICtrlSetData($Label11,$line) $line = $aTableData3[0][3] GUICtrlSetData($Label12,$line) $line = $aTableData3[0][5] GUICtrlSetData($Label13,$line) $line = $aTableData3[0][7] & " " & $aTableData3[0][8] GUICtrlSetData($Label16,$line) EndIf If $statybos = 1 Then $line = "Statoma: " & $aTableData3[0][1] & @CRLF & "Baigimo laikas: " & $aTableData3[0][3] GUICtrlSetData($Label17,$line) $line = $aTableData4[0][1] GUICtrlSetData($Label11,$line) $line = $aTableData4[0][3] GUICtrlSetData($Label12,$line) $line = $aTableData4[0][5] GUICtrlSetData($Label13,$line) $line = $aTableData4[0][7] & " " & $aTableData4[0][8] GUICtrlSetData($Label16,$line) EndIf Else ;~ ------------------------------------> Jeigu nera daugiau miestu $oTable = _IETableGetCollection ($oIE, 2+$puolimas) $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "Armija") $oTable = _IETableGetCollection ($oIE, 3+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "Sandelis arba Statybos") $oTable = _IETableGetCollection ($oIE, 4+$puolimas) $aTableData4 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData4, "Jei vyksta statybos tada sandelis") $oTable = _IETableGetCollection ($oIE, 5+$puolimas) $aTableData5 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData5, "belekas") if IsArray($aTableData4) Then $statybos = 1 else $statybos = 0 EndIf If $statybos = 0 Then $line = "" GUICtrlSetData($Label17,$line) $line = $aTableData3[0][1] GUICtrlSetData($Label11,$line) $line = $aTableData3[0][3] GUICtrlSetData($Label12,$line) $line = $aTableData3[0][5] GUICtrlSetData($Label13,$line) $line = $aTableData3[0][7] & " " & $aTableData3[0][8] GUICtrlSetData($Label16,$line) EndIf If $statybos = 1 Then $line = "Statoma: " & $aTableData3[0][1] & @CRLF & "Baigimo laikas: " & $aTableData3[0][3] GUICtrlSetData($Label17,$line) $line = $aTableData4[0][1] GUICtrlSetData($Label11,$line) $line = $aTableData4[0][3] GUICtrlSetData($Label12,$line) $line = $aTableData4[0][5] GUICtrlSetData($Label13,$line) $line = $aTableData4[0][7] & " " & $aTableData4[0][8] GUICtrlSetData($Label16,$line) EndIf EndIf EndFunc func get_buldings_kaimas() _IENavigate($oIE ,$Link & "/dorf1.php") $Source = _IEDocReadHTML($oIE) $data2 = _StringBetween($Source, '<MAP name=rx>', '</map>') $buldings_name = _StringBetween($data2[0], '<AREA title="', '" shape=') $buldings_link = _StringBetween($data2[0], 'href="', '">') Dim $ret_rray[UBound($buldings_name)][3] For $r = 0 to UBound($buldings_name)-1 $ret_rray[$r][0] = $buldings_name[$r] $ret_rray[$r][1] = $buldings_link[$r] Next return $ret_rray EndFunc Func get_buldings_miestas() _IENavigate($oIE ,$Link & "/dorf2.php") $Source = _IEDocReadHTML($oIE) $data = _StringBetween($Source, '<MAP name=map2>', '</map>') $data2 = _StringBetween($Source, '<MAP name=map1>', '</map>') $buldings_name = _StringBetween($data2[0], '<AREA title="', '" shape=') $buldings_link = _StringBetween($data2[0], 'href="', '">') Dim $ret_rray[UBound($buldings_name)][3] For $r = 0 to UBound($buldings_name)-1 $ret_rray[$r][0] = $buldings_name[$r] $ret_rray[$r][1] = $buldings_link[$r] Next return $ret_rray EndFunc Func FW($filename, $data) $file = FileOpen($filename, 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $data & @CRLF) FileClose($file) EndFunc Func Login($Username, $Password) $oForm = _IEFormGetCollection($oIE, 0) $oQuery = _IEFormElementGetCollection($oForm, 2) _IEFormElementSetValue($oQuery, $Username) $oQuery = _IEFormElementGetCollection($oForm, 3) _IEFormElementSetValue($oQuery, $Password) _IEFormSubmit($oForm) $Source = _IEDocReadHTML($oIE) If Not StringInStr($Source, '<DIV id=ltime>Atnaujinta per <B>') Then MsgBox("", "Error!", "Vartotojo vardas arba slaptazodis blogi!") Exit EndIf EndFunc Func build_menu($array) Global $selitemd $list = "" $Build = GUICreate("Statom", 244, 282, 331, 166) GUICtrlCreateLabel("Statybos",100,3,230) Global $List1 = GUICtrlCreateListView("", 8, 33, 225, 193) _GUICtrlListView_InsertColumn($List1, 0, "Pavadinimas", 200) _GUICtrlListView_InsertColumn($List1, 1, "Link", 1) For $r=0 to UBound($array)-1 If NOT StringInStr($array[$r][0], "statybos") Then $selitemd = GUICtrlCreateListViewItem($array[$r][0] &"|"&$array[$r][1],$List1) EndIf Next GUICtrlSetData($List1, $list) $Button1 = GUICtrlCreateButton("Statyti", 8, 232, 227, 17, 0) $Button2 = GUICtrlCreateButton("Atgal", 8, 256, 227, 17, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Build) list_watch() ExitLoop Case $Button2 GUIDelete($Build) list_watch() ExitLoop Case $Button1 $selitem =GUICtrlRead(GUICtrlRead($List1)) ;~ _GUICtrlListView_GetItemText($List1, 1) add_upgrade($selitem, $array) EndSwitch WEnd EndFunc func list_watch() Global $hListView $aItem = _GUICtrlListView_GetItemTextArray ($hListView, 0) start_building_upgrade("dorf1.php", $aItem[5]) $Source = _INetGetSource($Link & "/dorf1.php") $result = StringInStr($Source, "iuo metu statoma") if $result = 0 Then If start_building_upgrade($aItem[3], "Statyti") = 1 Then _GUICtrlListView_DeleteItem($hListView,0) data_update() EndIf EndIf EndFunc func miestai_list() $combo_dat = "" ;~ _IENavigate($oIE ,$Link & "/dorf1.php") $Source = _INetGetSource($Link & "/dorf1.php") ;~ $Source = _IEDocReadHTML($oIE) $Source = StringReplace($Source, ' class="active_vl"', '') $data = _StringBetween($Source, '<a href="?newdid=', '</a>') ;~ _ArrayDisplay($data,"Gyvenvietes") if Not @Error Then Dim $ret_rray[UBound($data)][3] For $r = 0 to UBound($data)-1 $miestu_list = StringSplit($data[$r], '">', 1) $ret_rray[$r][0] = $miestu_list[1] $ret_rray[$r][1] = $miestu_list[2] $combo_dat = $combo_dat & "|" & $miestu_list[2] Next GUICtrlSetData($Combo1, $combo_dat) if GUICtrlRead($Combo1) = "" Then start_building_upgrade("dorf1.php", $miestu_list[2]) GUICtrlSetData($Combo1, $miestu_list[2]) EndIf return $ret_rray EndIf EndFunc Func Time_t() $time_is_noe = @HOUR&":"&@MIN Return $time_is_noe EndFunc Func add_upgrade($name, $array) $datas = StringSplit($name, "|") Global $List1, $hListView_0 For $r=0 to UBound($array)-1 If StringReplace($array[$r][1], "|", "") = StringReplace($datas[2], "|", "") Then ;~ $linej = $r &"|"& $array[$r][0] &"|"& $array[$r][1] &"|"& Time_t() & "|" & GUICtrlRead($Combo1) $countf =_GUICtrlListView_GetItemCount($hListView) _GUICtrlListView_AddItem ($hListView, $r) _GUICtrlListView_AddSubItem ($hListView, $countf, $array[$r][0], 1) _GUICtrlListView_AddSubItem ($hListView, $countf, $array[$r][1], 2) _GUICtrlListView_AddSubItem ($hListView, $countf, Time_t(), 3) _GUICtrlListView_AddSubItem ($hListView, $countf, GUICtrlRead($Combo1), 4) EndIf Next EndFunc Func start_building_upgrade($page, $name) _IENavigate($oIE ,$Link & "/" & $page) ;~ _IELinkClickByText ($oIE, $name) $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $name) Then _IELinkClickByText ($oIE, $sLinkText) Return 1 ExitLoop EndIf Next EndFunc func a2b() Dim $ret_rray[26][2] _IENavigate($oIE, $Link & "/a2b.php") $oTable = _IETableGetCollection ($oIE, 2) $aTableData = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData) ;~ Input_name #Region ### START Koda GUI section ### Form= $Form_a2b = GUICreate("Armijos atutomatizavimas! Sio lango prasau neuzdaryti Jeigu norit kad vyktu puldinejimas!", 409, 164, 234, 154) $T1 = GUICtrlCreateInput("", 8, 8, 41, 21) $T2 = GUICtrlCreateInput("", 8, 32, 41, 21) $T4 = GUICtrlCreateInput("", 56, 8, 41, 21) $T7 = GUICtrlCreateInput("", 104, 8, 41, 21) $T9 = GUICtrlCreateInput("", 152, 8, 41, 21) $T5 = GUICtrlCreateInput("", 56, 32, 41, 21) $T8 = GUICtrlCreateInput("", 104, 32, 41, 21) $T10 = GUICtrlCreateInput("", 152, 32, 41, 21) $T3 = GUICtrlCreateInput("", 8, 56, 41, 21) $T6 = GUICtrlCreateInput("", 56, 56, 41, 21) $dname = GUICtrlCreateInput("", 336, 8, 57, 21) $Label1 = GUICtrlCreateLabel("Gyvenviete:", 248, 8, 84, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") $C2 = GUICtrlCreateRadio("Pastiprinimas", 208, 32, 81, 17) $C3 = GUICtrlCreateRadio("Ataka", 208, 56, 81, 17) $C4 = GUICtrlCreateRadio("Reidas", 208, 80, 81, 17) $Label2 = GUICtrlCreateLabel("arba", 344, 32, 25, 17) $X = GUICtrlCreateInput("", 344, 48, 25, 21) $Y = GUICtrlCreateInput("", 344, 80, 25, 21) $Label3 = GUICtrlCreateLabel("X:", 320, 48, 19, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") $Label4 = GUICtrlCreateLabel("Y:", 320, 80, 19, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") $intervalas = GUICtrlCreateInput("", 80, 104, 33, 21) $Label5 = GUICtrlCreateLabel("Kartoti kas", 8, 104, 72, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") $Label6 = GUICtrlCreateLabel("minuciu", 120, 104, 51, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") $Button1 = GUICtrlCreateButton("Pradeti", 224, 120, 145, 25, 0) $kiek = GUICtrlCreateInput("", 56, 128, 33, 21) $Label7 = GUICtrlCreateLabel("Kartoti", 8, 128, 46, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") $Label8 = GUICtrlCreateLabel("kartu", 96, 128, 37, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;~ StringReplace(StringReplace(,"(",""),")","") GUICtrlSetData($T1, StringReplace(StringReplace($aTableData[0][2],"(",""),")","")) GUICtrlSetData($T2, StringReplace(StringReplace($aTableData[1][2],"(",""),")","")) GUICtrlSetData($T3, StringReplace(StringReplace($aTableData[2][2],"(",""),")","")) GUICtrlSetData($T4, StringReplace(StringReplace($aTableData[0][5],"(",""),")","")) GUICtrlSetData($T5, StringReplace(StringReplace($aTableData[1][5],"(",""),")","")) GUICtrlSetData($T6, StringReplace(StringReplace($aTableData[2][5],"(",""),")","")) GUICtrlSetData($T7, StringReplace(StringReplace($aTableData[0][8],"(",""),")","")) GUICtrlSetData($T8, StringReplace(StringReplace($aTableData[1][8],"(",""),")","")) GUICtrlSetData($T9, StringReplace(StringReplace($aTableData[0][11],"(",""),")","")) GUICtrlSetData($T10, StringReplace(StringReplace($aTableData[1][11],"(",""),")","")) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form_a2b) ExitLoop Case $Button1 for $r=1 to GUICtrlRead($kiek) _IENavigate($oIE, $Link & "/a2b.php") _IELoadWait ($oIE) $o_form = _IEFormGetObjByName($oIE, "snd") $c = 0 If BitAND(GUICtrlRead($C2), $GUI_CHECKED) = $GUI_CHECKED Then _IEFormElementRadioSelect ($o_form, "2", "c", 1, "byValue") $c = 1 EndIf If BitAND(GUICtrlRead($C3), $GUI_CHECKED) = $GUI_CHECKED Then _IEFormElementRadioSelect ($o_form, "3", "c", 1, "byValue") $c = 1 EndIf If BitAND(GUICtrlRead($C4), $GUI_CHECKED) = $GUI_CHECKED Then _IEFormElementRadioSelect ($o_form, "4", "c", 1, "byValue") $c = 1 EndIf if $c <> 1 Then _IEFormElementRadioSelect ($o_form, "3", "c", 1, "byValue") EndIf ; get pointers to the login form and username and password fields $o_t1 = _IEFormElementGetObjByName($o_form, "T1") $o_t2 = _IEFormElementGetObjByName($o_form, "T2") $o_t3 = _IEFormElementGetObjByName($o_form, "T3") $o_t4 = _IEFormElementGetObjByName($o_form, "T4") $o_t5 = _IEFormElementGetObjByName($o_form, "T5") $o_t6 = _IEFormElementGetObjByName($o_form, "T6") $o_t7 = _IEFormElementGetObjByName($o_form, "T7") $o_t8 = _IEFormElementGetObjByName($o_form, "T8") $o_t9 = _IEFormElementGetObjByName($o_form, "T9") $o_t10 = _IEFormElementGetObjByName($o_form, "T10") $o_dname = _IEFormElementGetObjByName($o_form, "dname") $o_x = _IEFormElementGetObjByName($o_form, "x") $o_y = _IEFormElementGetObjByName($o_form, "y") ; Set field values and submit the form _IEFormElementSetValue($o_t1, gr($T1)) _IEFormElementSetValue($o_t2, gr($T2)) _IEFormElementSetValue($o_t3, gr($T3)) _IEFormElementSetValue($o_t4, gr($T4)) _IEFormElementSetValue($o_t5, gr($T5)) _IEFormElementSetValue($o_t6, gr($T6)) _IEFormElementSetValue($o_t7, gr($T7)) _IEFormElementSetValue($o_t8, gr($T8)) _IEFormElementSetValue($o_t7, gr($T9)) _IEFormElementSetValue($o_t8, gr($T10)) _IEFormElementSetValue($o_dname, gr($dname)) _IEFormElementSetValue($o_x, gr($X)) _IEFormElementSetValue($o_y, gr($Y)) _IEFormSubmit($o_form) _IELoadWait ($oIE) $oForm = _IEFormGetCollection ($oIE, 0) $oQuery = _IEFormElementGetCollection ($oForm, 1) _IEFormSubmit ($oForm) $begin = TimerInit() While 1 $dif = TimerDiff($begin) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form_a2b) $r = GUICtrlRead($kiek) ExitLoop EndSwitch if $dif > GUICtrlRead($intervalas)*1000*60 Then ExitLoop ;~ cw("Kariu puolimai baikti!") EndIf WEnd Next EndSwitch WEnd EndFunc func gr($id) return GUICtrlRead($id) EndFunc travian_v3.au3
  4. InetGet($reklama , "version.txt", 1,1); does save file to version.txt file
  5. #include <Array.au3> $avArray = _ArrayCreate( "average" ) $server = "lirknvd-11"; Host from whre $reklama = "http://"& $server &"/files/8.1.10.50.EXE"; Full link formation $size = InetGetSize($reklama); Geting size of remote file Global $i = 0;Varible Global $new = 0;Varible Global $speed = 0;Varible Global $left = 0;Varible $begin = TimerInit(); Timer start for 1 second determination $start = TimerInit(); Timer for link speed counting InetGet($reklama , "version.txt", 1,1); start downloading file to version txt file While @InetGetActive;;P Read manual noooby;) $dif = TimerDiff($begin); time difrence If $dif >= 1000 Then; If difrence hiher tyhen 1 sec if $i >0 Then $rr = TimerDiff($start) /1000/ $i $left = (100-$i) * Round($rr,1) else $left = "Skaicuojama..."; text to output whn speed is counting and no vaible to show EndIf $last = $new $new = @InetGetBytesRead $speed = Round(($new - $last) /1024) _ArrayAdd( $avArray,$speed); Add cur speed to array $begin = TimerInit() EndIf $i = round(100 / $size * @InetGetBytesRead) ;displaying ; $i = percent downloaded ; $left = left seconds to complete to download ; $speed = curent link speed ; sp_average($avArray) = Speed average of all download time TrayTip("Atsiunciamas atnaujinimo failas", " PARSIUSTA: " & $i & "% Liko: " & $left & " sek Greitis: " & $speed & " kB/s Vidurkis: "& sp_average($avArray) & "kB/s" , 10, 16) MsgBox(1, "Status", " PARSIUSTA: " & $i & "% Liko: " & $left & " Greitis: " & $speed & " kB/s Vidurkis: "& sp_average($avArray) & "kB/s", 2) Sleep(500) Wend Func sp_average($arr) ;~ _ArrayDisplay($arr) $average = 0 $count = UBound($arr) -1 For $r = 1 to UBound($arr,1) - 1 $average = $average + $arr[$r] ConsoleWrite("$average=" & $average & @CRLF) ConsoleWrite("$r=" & $r & @CRLF) Next $averagex = $average / ($r -1) ConsoleWrite("$average=" & $averagex & @CRLF) Return Round($averagex) EndFunc Update: ________Addeded average of speed (thanks Michel Claveau for idea) Bugs: ________Some how Tray tip does not displays for me?????? Why? Inprove ideas ect?
  6. I gues its working fine if there is no any post anymore
  7. You nead translation to your language
  8. Good night seay tomorrow for coding experence ;D (drunk)
  9. Nice... Posible addadon in future for script!! If whant to chant in LT PM me or use skype. culd be usefull for us tu chat nad show eatch other scripts Sori a bit tu much coctails after club ;D Some letters may be missing Keap a good healp gor me and we will make someting good! If someody have good bot culd share with me it will stay private. It just for coding experience
  10. When you using guictrlread($edit) & $new_text it makes program rn wery slow if its updatingg very often or give very mutch output. Use smth like tu clean edit alibbenable or smth look to my script
  11. Yes shuld be but now is not working. When you finish English GUI post it here
  12. This is travian automation script. Only source. Totaly free. suports: *auto atack *bulding que *Multiple cities *All data in script just nead work aruond to make ai or smth else This is where i will put my updates SRC SRC DIRECT Compiled for .LT servers Externeal link from my server to src to file Language file with explames: [LT] Text_when_login_ok=<DIV id=ltime>Atnaujinta per <B> // This part of text show only whn login is ok. Text liek updated in... ect Army_attack=jimas: // Text witch shows only whn army movment is detected Active_constructions=Statybos pabaiga //Text shown when is active construction Constructions_yard=statybos //Smth...;D Nead take a look to script List_watch_is_active_construction=iuo metu statoma //This for auto bulding. If this prt of text apears it will not try to start new construction Build_link_text=Statyti //Text or part of it in start new bulding link [Display] //Gui or display mesages Build_in_progres=Statoma: Build_end_time=Baigimo laikas: [GUI] Build_menu_title=Ka statom? Constructions=Statom Name=Pavadinimas Link=Nuoruoda Build=Statyti Back=Atgal Army_autoatacker_title=Armijos atutomatizavimas! Sio lango prasau neuzdaryti Jeigu norit kad vyktu puldinejimas! City_name=Gyvenviete: Support=Pastiprinimas Attack=Puolimas Raid=Reidas Repeat_delay=Kartoti kas Mins=minuciu Start=Pradeti Repeat=Kartoti Times=Kartu or=arba
  13. Updated. Suports multi language. Just edit file or make newone in language folder. This is just beta test. Give som feat back Bot Src [fixed] Lithuanian.txt Updated [LT] Text_when_login_ok=<DIV id=ltime>Atnaujinta per <B> // This part of text show only whn login is ok. Text liek updated in... ect Army_attack=jimas: // Text witch shows only whn army movment is detected Active_constructions=Statybos pabaiga //Text shown when is active construction Constructions_yard=statybos //Smth...;D Nead take a look to script List_watch_is_active_construction=iuo metu statoma //This for auto bulding. If this prt of text apears it will not try to start new construction Build_link_text=Statyti //Text or part of it in start new bulding link [Display] //Gui or display mesages Build_in_progres=Statoma: Build_end_time=Baigimo laikas: [GUI] Build_menu_title=Ka statom? Constructions=Statom Name=Pavadinimas Link=Nuoruoda Build=Statyti Back=Atgal Army_autoatacker_title=Armijos atutomatizavimas! Sio lango prasau neuzdaryti Jeigu norit kad vyktu puldinejimas! City_name=Gyvenviete: Support=Pastiprinimas Attack=Puolimas Raid=Reidas Repeat_delay=Kartoti kas Mins=minuciu Start=Pradeti Repeat=Kartoti Times=Kartu or=arba Moving my scripts here: http://www.autoitscript.com/forum/index.php?showtopic=66981 All updates else waiting post for other translations
  14. Production
  15. Ok lets make a deal I make it multilanguagual and you all help us to inprove script give me you made scripts functions to make one perfect agree?
  16. Translated alredy? No? :/ Maybe I shuld do a translation file like multilangual?
  17. Thanks for help
  18. your welcome just when you donw with trlansation share with us it
  19. Public. Neads translation No coments no adds. If you good enuog it will work for you auto atack, Build list quea. All is doen just work aruond to make all functions workinkg. to make all buttons work neads abuot 20 lines functions_v3.au3 Global $oIE, $hListView_0[255] Func inital_starup() Global $hListView_0, $Link = InputBox("Serveris", "Serveris","http://s3.travian.lt"), $User = InputBox("Varototojas", "Vartotojo vardas",""), $Pass = InputBox("Varototojas", "Vartotojo slaptazodis", "","*") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "yes") Global $oIE = _IECreate($Link, 1, 1) _IENavigate ($oIE, $Link) Login($User, $Pass) data_update() EndFunc Func data_update() _IENavigate ($oIE, $Link & "/dorf1.php") ;~ $oTable = _IETableGetCollection ($oIE, 0) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "0") ;~ $oTable = _IETableGetCollection ($oIE, 1) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "1") ;~ $oTable = _IETableGetCollection ($oIE, 2) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "2") ;~ $oTable = _IETableGetCollection ($oIE, 3) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "3") ;~ $oTable = _IETableGetCollection ($oIE, 4) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "4") ;~ $oTable = _IETableGetCollection ($oIE, 5) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "5") ;~ $oTable = _IETableGetCollection ($oIE, 6) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "6") ;~ $oTable = _IETableGetCollection ($oIE, 7) ;~ $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "7") Global $Label1, $Label4, $Label6, $Label8, $Label11, $Label12, $Label13, $Label16 ;~ $Source = _IEDocReadHTML($oIE) $Source = _INetGetSource($Link & "/dorf1.php") ;~ FW("souce",$Source) $result = StringInStr($Source, "jimas:") ;~ MsgBox(1, "pulimas", $result ) if $result = 0 Then $puolimas = 0 else $puolimas = 1 EndIf $oTable = _IETableGetCollection ($oIE, 1+$puolimas) $aTableData2 = _IETableWriteToArray ($oTable, True) $line = $aTableData2[0][2] GUICtrlSetData($Label1,$line) $line = $aTableData2[1][2] GUICtrlSetData($Label4,$line) $line = $aTableData2[2][2] GUICtrlSetData($Label6,$line) $line = $aTableData2[3][2] GUICtrlSetData($Label8,$line) $Source = _IEDocReadHTML($oIE) $data = _StringBetween($Source, '<a href="?newdid=', '</a>') if Not @Error Then ;~ ------------------------------------> JEIGU YRA DAUGIAU MIESTU $oTable = _IETableGetCollection ($oIE, 2+$puolimas) $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "Armija") $Source = _IEDocReadHTML($oIE) $result = StringInStr($Source, "Statybos pabaiga") if $result = 0 Then $statybos = 0 else $statybos = 1 EndIf If $statybos = 0 Then $line = "" GUICtrlSetData($Label17,$line) $oTable = _IETableGetCollection ($oIE, 3+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "Miestai") $kiek_miestu = UBound($aTableData3)+1 $oTable = _IETableGetCollection ($oIE, $kiek_miestu+3+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "sandelis arba statybos 3") $oTable = _IETableGetCollection ($oIE, $kiek_miestu+4+$puolimas) $aTableData4 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData4, "jei statybos sandelis") Else $oTable = _IETableGetCollection ($oIE, 4+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "Miestai") $kiek_miestu = UBound($aTableData3)+1 $oTable = _IETableGetCollection ($oIE, 3+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "statybos") $oTable = _IETableGetCollection ($oIE, $kiek_miestu+4+$puolimas) $aTableData4 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData4, "sandelis") EndIf If $statybos = 0 Then $line = "" GUICtrlSetData($Label17,$line) $line = $aTableData3[0][1] GUICtrlSetData($Label11,$line) $line = $aTableData3[0][3] GUICtrlSetData($Label12,$line) $line = $aTableData3[0][5] GUICtrlSetData($Label13,$line) $line = $aTableData3[0][7] & " " & $aTableData3[0][8] GUICtrlSetData($Label16,$line) EndIf If $statybos = 1 Then $line = "Statoma: " & $aTableData3[0][1] & @CRLF & "Baigimo laikas: " & $aTableData3[0][3] GUICtrlSetData($Label17,$line) $line = $aTableData4[0][1] GUICtrlSetData($Label11,$line) $line = $aTableData4[0][3] GUICtrlSetData($Label12,$line) $line = $aTableData4[0][5] GUICtrlSetData($Label13,$line) $line = $aTableData4[0][7] & " " & $aTableData4[0][8] GUICtrlSetData($Label16,$line) EndIf Else ;~ ------------------------------------> Jeigu nera daugiau miestu $oTable = _IETableGetCollection ($oIE, 2+$puolimas) $aTableData2 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData2, "Armija") $oTable = _IETableGetCollection ($oIE, 3+$puolimas) $aTableData3 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData3, "Sandelis arba Statybos") $oTable = _IETableGetCollection ($oIE, 4+$puolimas) $aTableData4 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData4, "Jei vyksta statybos tada sandelis") $oTable = _IETableGetCollection ($oIE, 5+$puolimas) $aTableData5 = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData5, "belekas") if IsArray($aTableData4) Then $statybos = 1 else $statybos = 0 EndIf If $statybos = 0 Then $line = "" GUICtrlSetData($Label17,$line) $line = $aTableData3[0][1] GUICtrlSetData($Label11,$line) $line = $aTableData3[0][3] GUICtrlSetData($Label12,$line) $line = $aTableData3[0][5] GUICtrlSetData($Label13,$line) $line = $aTableData3[0][7] & " " & $aTableData3[0][8] GUICtrlSetData($Label16,$line) EndIf If $statybos = 1 Then $line = "Statoma: " & $aTableData3[0][1] & @CRLF & "Baigimo laikas: " & $aTableData3[0][3] GUICtrlSetData($Label17,$line) $line = $aTableData4[0][1] GUICtrlSetData($Label11,$line) $line = $aTableData4[0][3] GUICtrlSetData($Label12,$line) $line = $aTableData4[0][5] GUICtrlSetData($Label13,$line) $line = $aTableData4[0][7] & " " & $aTableData4[0][8] GUICtrlSetData($Label16,$line) EndIf EndIf EndFunc func get_buldings_kaimas() _IENavigate($oIE ,$Link & "/dorf1.php") $Source = _IEDocReadHTML($oIE) $data2 = _StringBetween($Source, '<MAP name=rx>', '</map>') $buldings_name = _StringBetween($data2[0], '<AREA title="', '" shape=') $buldings_link = _StringBetween($data2[0], 'href="', '">') Dim $ret_rray[UBound($buldings_name)][3] For $r = 0 to UBound($buldings_name)-1 $ret_rray[$r][0] = $buldings_name[$r] $ret_rray[$r][1] = $buldings_link[$r] Next return $ret_rray EndFunc Func get_buldings_miestas() _IENavigate($oIE ,$Link & "/dorf2.php") $Source = _IEDocReadHTML($oIE) $data = _StringBetween($Source, '<MAP name=map2>', '</map>') $data2 = _StringBetween($Source, '<MAP name=map1>', '</map>') $buldings_name = _StringBetween($data2[0], '<AREA title="', '" shape=') $buldings_link = _StringBetween($data2[0], 'href="', '">') Dim $ret_rray[UBound($buldings_name)][3] For $r = 0 to UBound($buldings_name)-1 $ret_rray[$r][0] = $buldings_name[$r] $ret_rray[$r][1] = $buldings_link[$r] Next return $ret_rray EndFunc Func FW($filename, $data) $file = FileOpen($filename, 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $data & @CRLF) FileClose($file) EndFunc Func Login($Username, $Password) $oForm = _IEFormGetCollection($oIE, 0) $oQuery = _IEFormElementGetCollection($oForm, 2) _IEFormElementSetValue($oQuery, $Username) $oQuery = _IEFormElementGetCollection($oForm, 3) _IEFormElementSetValue($oQuery, $Password) _IEFormSubmit($oForm) $Source = _IEDocReadHTML($oIE) If Not StringInStr($Source, '<DIV id=ltime>Atnaujinta per <B>') Then MsgBox("", "Error!", "Vartotojo vardas arba slaptazodis blogi!") Exit EndIf EndFunc Func build_menu($array) Global $selitemd $list = "" $Build = GUICreate("Statom", 244, 282, 331, 166) GUICtrlCreateLabel("Statybos",100,3,230) Global $List1 = GUICtrlCreateListView("", 8, 33, 225, 193) _GUICtrlListView_InsertColumn($List1, 0, "Pavadinimas", 200) _GUICtrlListView_InsertColumn($List1, 1, "Link", 1) For $r=0 to UBound($array)-1 If NOT StringInStr($array[$r][0], "statybos") Then $selitemd = GUICtrlCreateListViewItem($array[$r][0] &"|"&$array[$r][1],$List1) EndIf Next GUICtrlSetData($List1, $list) $Button1 = GUICtrlCreateButton("Statyti", 8, 232, 227, 17, 0) $Button2 = GUICtrlCreateButton("Atgal", 8, 256, 227, 17, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Build) list_watch() ExitLoop Case $Button2 GUIDelete($Build) list_watch() ExitLoop Case $Button1 $selitem =GUICtrlRead(GUICtrlRead($List1)) ;~ _GUICtrlListView_GetItemText($List1, 1) add_upgrade($selitem, $array) EndSwitch WEnd EndFunc func list_watch() Global $hListView $aItem = _GUICtrlListView_GetItemTextArray ($hListView, 0) start_building_upgrade("dorf1.php", $aItem[5]) $Source = _INetGetSource($Link & "/dorf1.php") $result = StringInStr($Source, "iuo metu statoma") if $result = 0 Then If start_building_upgrade($aItem[3], "Statyti") = 1 Then _GUICtrlListView_DeleteItem($hListView,0) data_update() EndIf EndIf EndFunc func miestai_list() $combo_dat = "" ;~ _IENavigate($oIE ,$Link & "/dorf1.php") $Source = _INetGetSource($Link & "/dorf1.php") ;~ $Source = _IEDocReadHTML($oIE) $Source = StringReplace($Source, ' class="active_vl"', '') $data = _StringBetween($Source, '<a href="?newdid=', '</a>') ;~ _ArrayDisplay($data,"Gyvenvietes") if Not @Error Then Dim $ret_rray[UBound($data)][3] For $r = 0 to UBound($data)-1 $miestu_list = StringSplit($data[$r], '">', 1) $ret_rray[$r][0] = $miestu_list[1] $ret_rray[$r][1] = $miestu_list[2] $combo_dat = $combo_dat & "|" & $miestu_list[2] Next GUICtrlSetData($Combo1, $combo_dat) if GUICtrlRead($Combo1) = "" Then start_building_upgrade("dorf1.php", $miestu_list[2]) GUICtrlSetData($Combo1, $miestu_list[2]) EndIf return $ret_rray EndIf EndFunc Func Time_t() $time_is_noe = @HOUR&":"&@MIN Return $time_is_noe EndFunc Func add_upgrade($name, $array) $datas = StringSplit($name, "|") Global $List1, $hListView_0 For $r=0 to UBound($array)-1 If StringReplace($array[$r][1], "|", "") = StringReplace($datas[2], "|", "") Then ;~ $linej = $r &"|"& $array[$r][0] &"|"& $array[$r][1] &"|"& Time_t() & "|" & GUICtrlRead($Combo1) $countf =_GUICtrlListView_GetItemCount($hListView) _GUICtrlListView_AddItem ($hListView, $r) _GUICtrlListView_AddSubItem ($hListView, $countf, $array[$r][0], 1) _GUICtrlListView_AddSubItem ($hListView, $countf, $array[$r][1], 2) _GUICtrlListView_AddSubItem ($hListView, $countf, Time_t(), 3) _GUICtrlListView_AddSubItem ($hListView, $countf, GUICtrlRead($Combo1), 4) EndIf Next EndFunc Func start_building_upgrade($page, $name) _IENavigate($oIE ,$Link & "/" & $page) ;~ _IELinkClickByText ($oIE, $name) $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $name) Then _IELinkClickByText ($oIE, $sLinkText) Return 1 ExitLoop EndIf Next EndFunc func a2b() Dim $ret_rray[26][2] _IENavigate($oIE, $Link & "/a2b.php") $oTable = _IETableGetCollection ($oIE, 2) $aTableData = _IETableWriteToArray ($oTable, True) ;~ _ArrayDisplay($aTableData) ;~ Input_name #Region ### START Koda GUI section ### Form= $Form_a2b = GUICreate("Armijos atutomatizavimas! Sio lango prasau neuzdaryti Jeigu norit kad vyktu puldinejimas!", 409, 164, 234, 154) $T1 = GUICtrlCreateInput("", 8, 8, 41, 21) $T2 = GUICtrlCreateInput("", 8, 32, 41, 21) $T4 = GUICtrlCreateInput("", 56, 8, 41, 21) $T7 = GUICtrlCreateInput("", 104, 8, 41, 21) $T9 = GUICtrlCreateInput("", 152, 8, 41, 21) $T5 = GUICtrlCreateInput("", 56, 32, 41, 21) $T8 = GUICtrlCreateInput("", 104, 32, 41, 21) $T10 = GUICtrlCreateInput("", 152, 32, 41, 21) $T3 = GUICtrlCreateInput("", 8, 56, 41, 21) $T6 = GUICtrlCreateInput("", 56, 56, 41, 21) $dname = GUICtrlCreateInput("", 336, 8, 57, 21) $Label1 = GUICtrlCreateLabel("Gyvenviete:", 248, 8, 84, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") $C2 = GUICtrlCreateRadio("Pastiprinimas", 208, 32, 81, 17) $C3 = GUICtrlCreateRadio("Ataka", 208, 56, 81, 17) $C4 = GUICtrlCreateRadio("Reidas", 208, 80, 81, 17) $Label2 = GUICtrlCreateLabel("arba", 344, 32, 25, 17) $X = GUICtrlCreateInput("", 344, 48, 25, 21) $Y = GUICtrlCreateInput("", 344, 80, 25, 21) $Label3 = GUICtrlCreateLabel("X:", 320, 48, 19, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") $Label4 = GUICtrlCreateLabel("Y:", 320, 80, 19, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") $intervalas = GUICtrlCreateInput("", 80, 104, 33, 21) $Label5 = GUICtrlCreateLabel("Kartoti kas", 8, 104, 72, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") $Label6 = GUICtrlCreateLabel("minuciu", 120, 104, 51, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") $Button1 = GUICtrlCreateButton("Pradeti", 224, 120, 145, 25, 0) $kiek = GUICtrlCreateInput("", 56, 128, 33, 21) $Label7 = GUICtrlCreateLabel("Kartoti", 8, 128, 46, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") $Label8 = GUICtrlCreateLabel("kartu", 96, 128, 37, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;~ StringReplace(StringReplace(,"(",""),")","") GUICtrlSetData($T1, StringReplace(StringReplace($aTableData[0][2],"(",""),")","")) GUICtrlSetData($T2, StringReplace(StringReplace($aTableData[1][2],"(",""),")","")) GUICtrlSetData($T3, StringReplace(StringReplace($aTableData[2][2],"(",""),")","")) GUICtrlSetData($T4, StringReplace(StringReplace($aTableData[0][5],"(",""),")","")) GUICtrlSetData($T5, StringReplace(StringReplace($aTableData[1][5],"(",""),")","")) GUICtrlSetData($T6, StringReplace(StringReplace($aTableData[2][5],"(",""),")","")) GUICtrlSetData($T7, StringReplace(StringReplace($aTableData[0][8],"(",""),")","")) GUICtrlSetData($T8, StringReplace(StringReplace($aTableData[1][8],"(",""),")","")) GUICtrlSetData($T9, StringReplace(StringReplace($aTableData[0][11],"(",""),")","")) GUICtrlSetData($T10, StringReplace(StringReplace($aTableData[1][11],"(",""),")","")) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form_a2b) ExitLoop Case $Button1 for $r=1 to GUICtrlRead($kiek) _IENavigate($oIE, $Link & "/a2b.php") _IELoadWait ($oIE) $o_form = _IEFormGetObjByName($oIE, "snd") $c = 0 If BitAND(GUICtrlRead($C2), $GUI_CHECKED) = $GUI_CHECKED Then _IEFormElementRadioSelect ($o_form, "2", "c", 1, "byValue") $c = 1 EndIf If BitAND(GUICtrlRead($C3), $GUI_CHECKED) = $GUI_CHECKED Then _IEFormElementRadioSelect ($o_form, "3", "c", 1, "byValue") $c = 1 EndIf If BitAND(GUICtrlRead($C4), $GUI_CHECKED) = $GUI_CHECKED Then _IEFormElementRadioSelect ($o_form, "4", "c", 1, "byValue") $c = 1 EndIf if $c <> 1 Then _IEFormElementRadioSelect ($o_form, "3", "c", 1, "byValue") EndIf ; get pointers to the login form and username and password fields $o_t1 = _IEFormElementGetObjByName($o_form, "T1") $o_t2 = _IEFormElementGetObjByName($o_form, "T2") $o_t3 = _IEFormElementGetObjByName($o_form, "T3") $o_t4 = _IEFormElementGetObjByName($o_form, "T4") $o_t5 = _IEFormElementGetObjByName($o_form, "T5") $o_t6 = _IEFormElementGetObjByName($o_form, "T6") $o_t7 = _IEFormElementGetObjByName($o_form, "T7") $o_t8 = _IEFormElementGetObjByName($o_form, "T8") $o_t9 = _IEFormElementGetObjByName($o_form, "T9") $o_t10 = _IEFormElementGetObjByName($o_form, "T10") $o_dname = _IEFormElementGetObjByName($o_form, "dname") $o_x = _IEFormElementGetObjByName($o_form, "x") $o_y = _IEFormElementGetObjByName($o_form, "y") ; Set field values and submit the form _IEFormElementSetValue($o_t1, gr($T1)) _IEFormElementSetValue($o_t2, gr($T2)) _IEFormElementSetValue($o_t3, gr($T3)) _IEFormElementSetValue($o_t4, gr($T4)) _IEFormElementSetValue($o_t5, gr($T5)) _IEFormElementSetValue($o_t6, gr($T6)) _IEFormElementSetValue($o_t7, gr($T7)) _IEFormElementSetValue($o_t8, gr($T8)) _IEFormElementSetValue($o_t7, gr($T9)) _IEFormElementSetValue($o_t8, gr($T10)) _IEFormElementSetValue($o_dname, gr($dname)) _IEFormElementSetValue($o_x, gr($X)) _IEFormElementSetValue($o_y, gr($Y)) _IEFormSubmit($o_form) _IELoadWait ($oIE) $oForm = _IEFormGetCollection ($oIE, 0) $oQuery = _IEFormElementGetCollection ($oForm, 1) _IEFormSubmit ($oForm) $begin = TimerInit() While 1 $dif = TimerDiff($begin) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form_a2b) $r = GUICtrlRead($kiek) ExitLoop EndSwitch if $dif > GUICtrlRead($intervalas)*1000*60 Then ExitLoop ;~ cw("Kariu puolimai baikti!") EndIf WEnd Next EndSwitch WEnd EndFunc func gr($id) return GUICtrlRead($id) EndFunc travian_v3.au3
  20. ASAP I wll try to update my script to work with new version of autoit.
  21. come on neead some help plz
  22. Stil working on PostGres SQL I dont have any problems with execute but when i nead to return data from database i get some problems! This explame is what i have working fine for now: Func postgres($query) $var = "server.cfg" $pg_host = IniRead($var, "Server", "1", "Klaida") $pg_db = IniRead($var, "Server", "2", "Klaida") $pg_usr = IniRead($var, "Server", "3", "Klaida") $pg_pas = IniRead($var, "Server", "4", "Klaida") $oConn = ObjCreate("ADODB.Connection") $line2 = "DRIVER={PostgreSQL ANSI};DATABASE="& $pg_db &";" & _ "SERVER="& $pg_host &";PORT=5432;Uid="& $pg_usr &";" & _ "Pwd="& $pg_pas &";" & _ "A0=0;A1=6.4;A2=0;A3=0;A4=0;A5=0;A6=;A7=100;A8=4096;A9=0;" & _ "B0=254;B1=8190;B2=0;B3=0;B4=1;B5=1;B6=0;B7=1;B8=0;B9=1;C0=0;C1=0;C2=dd_" $oConn.Open ($line2) If IsObj($oConn) Then Return $oConn.execute ($query) EndIf If @error Then SetError(1) Return 0 EndIf $oConn.Close EndFunc Here is what is not working as I espected. Func postgres_query($query) $var = "server.cfg" $pg_host = IniRead($var, "Server", "1", "Klaida") $pg_db = IniRead($var, "Server", "2", "Klaida") $pg_usr = IniRead($var, "Server", "3", "Klaida") $pg_pas = IniRead($var, "Server", "4", "Klaida") $oConn = ObjCreate("ADODB.Connection") $oRS = ObjCreate("ADODB.Recordset") ;~ $cmd = ObjCreate("ADODB.Command") $line2 = "DRIVER={PostgreSQL ANSI};DATABASE="& $pg_db &";" & _ "SERVER="& $pg_host &";PORT=5432;Uid="& $pg_usr &";" & _ "Pwd="& $pg_pas &";" & _ "A0=0;A1=6.4;A2=0;A3=0;A4=0;A5=0;A6=;A7=100;A8=4096;A9=0;" & _ "B0=254;B1=8190;B2=0;B3=0;B4=1;B5=1;B6=0;B7=1;B8=0;B9=1;C0=0;C1=0;C2=dd_" $oConn.Open ($line2) If IsObj($oConn) Then Return $oRS.Open ($query,$oConn) EndIf If @error Then SetError(1) Return 0 EndIf $oConn.Close EndFunc func get_id($what,$data) if $what = "area" Then Dim $data[5] $sql_x = "SELECT * FROM area_codes WHERE destination LIKE '"& $data &"' LIMIT 1;" $aQuery = postgres_query($sql_x) With $aQuery <--- sems error in here While NOT .EOF $data[1] = .Fields("code").value $data[2] = .Fields("destination").value $data[3] = .Fields("comments").value $data[4] = .Fields("is_bad_code").value .MoveNext WEnd EndWith _ArrayDisplay($data) EndIf get_id("area", "Afganistan") And get error like: Only Object-type variables allowed in an "With" statement. There is documentation for languages: # Example based Mini-Howto on Accessing PostgreSQL from C# # Example based Mini-Howto on Accessing PostgreSQL from Ch # Using large objects in Microsoft Access (notes from the original psqlODBC docs) # Example based Mini-Howto on using Microsoft Access VBA with PostgreSQL # Example based Mini-Howto on Accessing PostgreSQL from Visual Basic <-- Posted this # Example based Mini-Howto on Pgsql Large Objects Interface and Visual Basic # PostgreSQL and Business Objects I suply you with: Accessing PostgreSQL from Visual Basic # Example based Mini-Howto on Accessing PostgreSQL from Visual Basic This document provides some sample code to get you started with Visual Basic & PostgreSQL. Requirements to get the subroutines to work: * Visual Basic 5/6 * A reference in the VB project to Microsoft ActiveX Data Objects * A PostgreSQL datasource. The example code shown below may need some modification to make it actually work in your environment. There is one table used in the example: CREATE TABLE vbtest( id int4, data text, accessed timestamp ); Code Sub Main() Dim cn as New ADODB.Connection Dim rs as New ADODB.Recordset 'Open the connection cn.Open "DSN=<MyDataSourceName>;" & _ "UID=<MyUsername>;" & _ "PWD=<MyPassword>;" & _ "Database=<MyDatabaseName>" 'Clear the table cn.Execute "DELETE FROM vbtest;" 'For updateable recordsets we would typically open a Dynamic recordset. 'Forward Only recordsets are much faster but can only scroll forward and 'are read only. Snapshot recordsets are read only, but scroll in both 'directions. rs.Open "SELECT id, data, accessed FROM vbtest", cn, adOpenDynamic, adLockOptimistic 'Loop though the recordset and print the results 'We will also update the accessed column, but this time access it through 'the Fields collection. ISO-8601 formatted dates/times are the safest IMHO. While Not rs.EOF Debug.Print rs!id & ": " & rs!data rs.Fields("accessed") = Format(Now, "yyyy-MM-dd hh:mm:ss") rs.Update rs.MoveNext Wend 'Add a new record to the recordset rs.AddNew rs!id = 76 rs!data = 'More random data' rs!accessed = Format(Now, "yyyy-MM-dd hh:mm:ss") rs.Update 'Insert a new record into the table cn.Execute "INSERT INTO vbtest (id, data) VALUES (23, 'Some random data');" 'Refresh the recordset to get that last record... rs.Requery 'Get the record count rs.MoveLast rs.MoveFirst MsgBox rs.RecordCount & " Records are in the recordset!" 'Cleanup If rs.State <> adStateClosed Then rs.Close Set rs = Nothing If cn.State <> adStateClosed Then cn.Close Set cn = Nothing End Sub Useful Functions ' The escapeString function can be used to fix strings for us in INSERT and ' UPDATE SQL statements. It will take a value, and return it ready for ' use in your statement as NULL, or quoted with backslashes and single quotes ' escaped. Function escapeString(vValue As Variant) As String If IsNull(vValue) Then escapeString = "NULL" else escapeString = "'" & Replace(Replace(vValue, "", ""), "'", "''") & "'" end if End Function Maybe some one culd help me? I am using as samples MYSQL UDF but stuck with this thing. If you nead more documentation or explame or you have idea why it is not working. Some more info what I tryed by myself. if using: Return $oRS.Open ($query) as found in mysql explame gives me error like : err.description is: The connection cannot be used to perform this operation. It is either closed or invalid in this context. err.windescription: err.number is: 80020009 err.lastdllerror is: 0 err.scriptline is: 161 err.source is: ADODB.Recordset err.helpfile is: C:\WINDOWS\HELP\ADO270.CHM err.helpcontext is: 1240658 We intercepted a COM Error ! So now i think that Return $oRS.Open ($query,$oConn) dosent return me an object. So what it returns? I'm confused.
×
×
  • Create New...