Sign in to follow this  
Followers 0
koman92040

Find Greatest value in a given column of a muti-dimensional array

2 posts in this topic

#1 ·  Posted (edited)

hello,

i'm writing a script to overcome the obstacles of our company's nested sub-domains for the LAN and Microsoft Remote assistance.

The final product sloud ping the hostname as well as the hostname in all three nested subdomains, and connect to the fastest responding domain. Right now it connects to the first pingable domain in the list, this is not acceptable as my older version of this script has hung up on outdated dns records on the first loop.

the issue i am running into is i'm doing all the work out of a muti-dimensional array, so i cannot use _ArrayMax() in the traditional meaner. Any ieas

so far my script looks something like this:

#include <GUIConstantsEx.au3>
#include <Array.au3>
While 1
TCPStartup()
$input = InputBox(@ScriptName, "Hostname:")
If @error Then
Exit
EndIf
$hostname = StringStripWS($input, 8)
Dim $ping[5][3] = [[4],[$hostname],[$hostname & ".example.com"],[$hostname & ".in.example.com"],[$hostname & ".corp.in.example.com"]]
For $loop = 1 To $ping[0][0]
$ping[$loop][1] = TCPNameToIP($ping[$loop][0])
$ping[$loop][2] = Ping($ping[$loop][1])
Next
TCPShutdown()
For $loop = 1 To $ping[0][0]
If $ping[$loop][2] Then
TrayTip("Launching Connection", "Remote Assistance is launching a connection to " & $ping[$loop][0] & " at " & $ping[$loop][1] & " wich responded in " & $ping[$loop][2] & "ms", 30)
Run("msra.exe /offerra " & $ping[$loop][1])
ExitLoop
EndIf
Next
WEnd
Edited by koman92040

Share this post


Link to post
Share on other sites



I just posted a solution


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0