Jump to content

Developing tarvian add ons


slaughter
 Share

Recommended Posts

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
Edited by slaughter
Link to comment
Share on other sites

Hi , I have a problem in translation script. when I run the script Appear this error,

"Vartotojo vardas arba slaptazodis blogi!". Someone know what it is?

You nead translation to your language

Link to comment
Share on other sites

I tried your script on s3.travian.lt that is the server you made it for, however I could not get it to work, after I logged in the program just freeze and nothing more

@shinaider, vartotojo and that I think means Username and Password by looking at the script

Edited by Pain
Link to comment
Share on other sites

I have coded a good functioning bot, it farms for me 24/7... But is uses MouseClick's and MouseClickDrag to check if troops are home...

Now want to improve my bot and make it with IE.au3.....

This is how far i am atm with this new bot:

CODE

#include <IE.au3>

$oIE = _IECreate ("http://s6.travian.se/dorf1.php")

Its not much.... ;P

So, does anyone have a function to check if troops are home, and how many there are of what sort etc?

Link to comment
Share on other sites

  • 1 month later...

hi all!

great work.

Sorry for the ad. you can check my bot, to get a example or just look for ideas in this link.

Just need a valid email address.

Looking for beta tester and a developer.

I will update it with free demo for 1 village accounts, and new screenshots.

keep the good work. Linux

You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"
Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

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 :P

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

#include <GUIConstants.au3>

#include <IE.au3>

#include <INet.au3>

#include <String.au3>

#include <Array.au3>

#include <functions_v3.au3>

#Include <GuiListView.au3>

#include <GuiConstantsEx.au3>

$Debug_LV = False

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Romualda\My Documents\slau\graph\AForm1_v3.kxf

$Form1 = GUICreate("Travian auto", 625, 500, 193, 115)

$Group1 = GUICtrlCreateGroup("Gavimas", 16, 8, 233, 89)

Global $Label1 = GUICtrlCreateLabel("M", 72, 24, 165, 17)

$Label2 = GUICtrlCreateLabel("Mediena", 24, 24, 45, 17)

$Label3 = GUICtrlCreateLabel("Molis", 24, 40, 28, 17)

$Label5 = GUICtrlCreateLabel("Gelezis", 24, 56, 38, 17)

$Label7 = GUICtrlCreateLabel("Grudai", 24, 72, 35, 17)

Global $Label4 = GUICtrlCreateLabel("M", 72, 40, 165, 17)

Global $Label6 = GUICtrlCreateLabel("M", 72, 56, 165, 17)

Global $Label8 = GUICtrlCreateLabel("M", 72, 72, 165, 17)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group2 = GUICtrlCreateGroup("Karuomine", 16, 208, 233, 65)

$Button1 = GUICtrlCreateButton("Puldinejimas", 24, 232, 107, 25, 0)

$Button2 = GUICtrlCreateButton("Gamyba", 136, 232, 99, 25, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group3 = GUICtrlCreateGroup("Sandelis", 16, 104, 233, 97)

$Label9 = GUICtrlCreateLabel("Molis", 24, 136, 28, 17)

$Label10 = GUICtrlCreateLabel("Mediena", 24, 120, 45, 17)

Global $Label11 = GUICtrlCreateLabel("M", 72, 120, 150, 17)

Global $Label12 = GUICtrlCreateLabel("M", 72, 136, 150, 17)

Global $Label13 = GUICtrlCreateLabel("M", 72, 152, 150, 17)

$Label14 = GUICtrlCreateLabel("Gelezis", 24, 152, 38, 17)

$Label15 = GUICtrlCreateLabel("Grudai", 24, 168, 35, 17)

Global $Label16 = GUICtrlCreateLabel("M", 72, 168, 150, 17)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group4 = GUICtrlCreateGroup("Darbai", 264, 8, 353, 449)

Global $hListView = _GUICtrlListView_Create($Form1,"", 272, 24, 337, 401,$LVS_REPORT,$LVS_EX_FULLROWSELECT)

$Button5 = GUICtrlCreateButton("Pasalinti pazymeta", 296, 432, 289, 17, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group5 = GUICtrlCreateGroup("Statybos", 16, 280, 233, 65)

$Button3 = GUICtrlCreateButton("Kaimas", 24, 304, 107, 25, 0)

$Button4 = GUICtrlCreateButton("Miestas", 136, 304, 99, 25, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group6 = GUICtrlCreateGroup("Statybos", 16, 352, 233, 73)

$Label17 = GUICtrlCreateLabel("NEVEIKIA", 30, 365, 200, 40)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group7 = GUICtrlCreateGroup("Gyvenviete", 16, 432, 233, 65)

$Button6 = GUICtrlCreateButton("Keisti", 43, 474, 179, 17, 0)

Global $Combo1 = GUICtrlCreateCombo("", 27, 450, 209, 25)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

inital_starup()

;~ _ArrayDisplay(get_buldings_miestas(), "")

;~ _ArrayDisplay(get_buldings_kaimas(), "")

; Add columns

_GUICtrlListView_InsertColumn($hListView, 0, "ID", 30)

_GUICtrlListView_InsertColumn($hListView, 1, "Pavadinimas", 150)

_GUICtrlListView_InsertColumn($hListView, 2, "Link", 50)

_GUICtrlListView_InsertColumn($hListView, 3, "Laikas", 70)

_GUICtrlListView_InsertColumn($hListView, 4, "Gyvenviete", 70)

; Add items

;~ _GUICtrlListView_AddItem ($hListView, "Row 1: Col 1", 0)

;~ _GUICtrlListView_AddItem ($hListView, "Row 2: Col 1", 1)

;~ _GUICtrlListView_AddItem ($hListView, "Row 3: Col 1", 2)

;~

miestai_list()

AdlibEnable("list_watch", 60000)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button3

build_menu(get_buldings_kaimas())

Case $Button4

build_menu(get_buldings_miestas())

Case $Button6

Global $miestas = GUICtrlRead($Combo1)

start_building_upgrade("dorf1.php", GUICtrlRead($Combo1))

data_update()

Case $Button5

_GUICtrlListView_DeleteItemsSelected($hListView)

Case $Button1

a2b()

EndSwitch

WEnd

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...