Jump to content
Sign in to follow this  

Need your comment about my program

Recommended Posts


Hi, This is my first post here. Sorry for my poor english.

I known autoit from computer book on thailand yesterday

Below code is my first program that make from my learning on help file.



$result = ping ($ip)

if $result Then

msgbox(0, "STATUS", "PING "&$ip)


msgbox(0, "STATUS", "NOT PING "&$ip)


I would like to ask your comment to improve belong my idea.

1. popup for receive third and fourth number of ip such as 172.30.X.Y. I always use ping ip 172.30....... .

so that I want to only enter third number then press enter for next popup for fourth number.

my own idea to merge third and fourth number to 172.30. as $ip as above my program. But I can't find function about merge string.

2. If I can ping ip, program will show computer name of ping ip such as you use command nbtsta -a ip on cmd command mode.

How can I adapt @computerName for my requirement.

Thank you for your comment



Share this post

Link to post
Share on other sites

0. Use "code" instead of "quote" to post a code fragment.

1. &

$var1 = "Welcome"
$var2 = "in"
$var3 = "Autoit"
$var4 = "Forum"
MsgBox(0,"",$var1 & $var2 & $var3 & $var4)

2. I don't get what u mean

Edited by 4ggr35510n

Share this post

Link to post
Share on other sites

You might want to check out the functions of the GuiIPAddress.au3 UDF, especially _GuiCtrlIPAddress_SetRange() and _GuiCtrlIPAddress_Get():

#include <GuiConstantsEx.au3>
#include <GuiIPAddress.au3>

Global $hgui, $hIPAddress, $idButton, $sIPAdx

$hgui = GUICreate("IP Address Control Set Range Example", 300, 150)
$hIPAddress = _GUICtrlIpAddress_Create($hgui, 10, 10)
$idButton = GUICtrlCreateButton("SELECT", 100, 100, 100, 30)

; set range on 1st two fields
_GUICtrlIpAddress_Set($hIPAddress, "")
_GUICtrlIpAddress_SetRange($hIPAddress, 0, 172, 172)
_GUICtrlIpAddress_SetRange($hIPAddress, 1, 30, 30)

; GUI message loop
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE

        Case $idButton
            $sIPAdx = _GUICtrlIpAddress_Get($hIPAddress)
            MsgBox(64, "Selected", "Address selected = " & $sIPAdx)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.