Jump to content

Reading a multivalue table


Recommended Posts

Hey guys, I've got a table here:

http://www.twstats.com/en25/index.php?page...ilter=abandoned

Now my script is way to big to post here, however I get to this page, no problems, but now I want the script to look at the page, then write all the values from the table somewhere, i.e. an ini file or excel spreadsheet

After I get the data I want script to find the ten highest points (Far right column), and the coordinates of the village (Its Barbarian Village (x|y))

Now I'm really struggling with the first part, and the second I have no idea what to do!!

At the moment I've got this, (for reading the table):

$oIE2 = _IECreate($targetingaddress,0,1)
    $otargetstable=_IETableGetCollection($oIE2)
    $atargetsdata=_IETableWriteToArray($otargetstable)
    IniWriteSection(@ProgramFilesDir & "\ARSoft\TribalwarsAI\targeting.ini","Target Array",$atargetsdata)

With the $targetaddress being the link I posted at the top of this question!

Please help someone?

Adam

EDIT: Typo :)

EDIT2: Another Typo :S

Edited by adz89

Self confessed noob...

Link to comment
Share on other sites

Here's a start...it's messy

#Include <IE.au3>
#Include <Array.au3>

$oIE2 = _IECreate("http://www.twstats.com/en25/index.php?page=village_locator&stage=4&source=player&village_coords=500|500&searchstring=adz1989&tribe_id=0&filter=abandoned",0,0)
$oTable = _IETableGetCollection ($oIE2, 10)
$aTableData = _IETableWriteToArray ($oTable)

_IEQuit($oIE2)

$inifile = FileOpen(@WorkingDir&"/inifile.ini", 2)

$x = 1
Do
    FileWriteLine($inifile, $aTableData[1][$x]&","&$aTableData[2][$x]&","&$aTableData[3][$x]&","&$aTableData[4][$x]&","&$aTableData[5][$x]&","&$aTableData[6][$x]&","&$aTableData[7][$x]&","&$aTableData[8][$x])
    $x = $x + 1
Until $x = UBound($aTableData, 2)



Dim $TP_array[UBound($aTableData, 2)]
$x = 1
Do
    $TP_array[$x] = $aTableData[8][$x]
    $x = $x + 1
Until $x = UBound($aTableData, 2)
    

_ArraySort($TP_array, 1)
_ArrayDisplay($TP_array)

FileClose($inifile)
Link to comment
Share on other sites

  • 2 weeks later...

I tried that but I'm not sure what number it's taken and put in the array,

I need to columns one with a x value and one with a y value,

Its an awkward one this, thanks for your help so far, its given me a base to start experimenting

Self confessed noob...

Link to comment
Share on other sites

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...