RichardT Posted April 20, 2010 Posted April 20, 2010 I am trying to create a script that : 1# Asks the user for a 5 digit string value then they press "connect" 2# The script then reads the value, verifies it exits in a text file and launches a seperate AutoIT script that builds a connection and a settings file. I can do all the connections stuff, but getting it to read the input then verifies the string in a text file is killing me. Please help... "so much work, so little brains..."
enaiman Posted April 20, 2010 Posted April 20, 2010 Here you go: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 168, 64, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $Button1 = GUICtrlCreateButton("Button1", 24, 24, 115, 25) GUICtrlSetOnEvent(-1, "Button1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;Use FileRead to read the whole file $FileRead_Result = "my string TTTTTT here"&@CRLF&"some other garbage text" While 1 Sleep(100) WEnd Func Button1Click() $testString = InputBox("String to Find", "Enter search string") If StringInStr($FileRead_Result, $testString) Then MsgBox(0, "Found", "Found: "&$testString) Else MsgBox(0, "Not Found", "Not Found: "&$testString) EndIf EndFunc Func Form1Close() Exit EndFunc Very basic and easy script - it has all the elements you need. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
RichardT Posted April 21, 2010 Author Posted April 21, 2010 Awesome! you are now my new idol. I shall worship you... "so much work, so little brains..."
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now