Sign in to follow this  
Followers 0
cowsmanaut

creating a set?

5 posts in this topic

I have 3 sets of computers I need to install and their IP's are static... so my idea was to have a script that first checked their IP and then chose the correct install scripts for it.

However there are 24 in each group. I know how to get the IP from each.. and I can confirm by IP ok.. but it's tedious. is there a way of which telling it a range of IPs?

they are something like this

10.115.0.10

10.115.0.11

10.115.0.12

etc

so only that last part changes for the first 24 and for the other 24 the second number changes for that whole set and then the last for each within the set if you get my meaning.

So is there support for wildcards? ie

10.115.0.*

10.117.0.*

10.120.0.*

etc?

or ranges 10.115.0.10-34 which would be better..

just trying to think of a more elegant way than entering every single IP..

moo

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

What excatally do you need to do? Your post didn't make a lot of sense (to me anyway.) You want to give it a "base" for the IP, and then have the program prompt for the remaining part? If so, you can do something like:

;untested code, but it should give you an idea
$start = InputBox("First Part", "Enter the first part of the IP")

;some other code goes here
;...
;...

For $i = 1 To $someNumber;loop if you need to for various IP's
  $end = InputBox("Second Part", "Enter the 2nd part of the IP for this machine")
;additional code as needed here
  Send("my window title", "my text in the window", $start & $end)
Next

;rest of script here

If I didn't understand what you ment (which I probably didn't) then please clarify and maybe I (or someone else) can help you better.

Edited 'cause I made a command mistake

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

yeah Larry that makes some sense.. ok.. gonna try that.. Thanks. :huh2:

Thanks for the input Perkster but I'm already grabbing the IP with @IPAddress1

so manual input is not really desireable. Basically I need to install different sets of programs on defferent PC groups. I have some that are 3.2ghz in one class and some in annother class that are 1.7ghz and some more that are 2.2 in yet annother class and each class has different software they use but some software that is the same. So I have scripts that run the correct install scripts on each machine but I want to have code that determines that automatically... rather than having to select install group 1, 2 or 3 for every machine.

Perhaps that's more confusing than my first description. :D

oh well.. moo

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$Ipstring = @IPAddress1

$IParray = StringSplit($IPstring,".")
Select
   Case $IParray[2] == "192"
    msgbox (0, "Ip", "I see a 192")

   Case $IParray[2] == "117"
    msgbox (0, "Ip", "I see a 117")

   Case $IParray[2] == "120"
    msgbox (0, "Ip", "I see a 120")
EndSelect

ok.. what am I missing here? This was intended as a check for different IP numbers and have it send back info that it had found it.. I read up on cases.. on select/endselect, and on stingsplit.. I can't see where I've gone wrong..

Could someone explain why this is wrong?

edit:

oh wait.. does the 2 denote the 2nd value in the string?

runs and checks

Edited by cowsmanaut

Share this post


Link to post
Share on other sites

address "192.168.0.10" will translate to:

$IParray[0] = 4

$IParray[1] = 192

$IParray[2] = 168

$IParray[3] = 0

$IParray[4] = 10

you could also add :

Case Else
msgbox (0, "Ip", "I see another range:" & $IParray[1] )
EndSelect

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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