
John117
Active Members-
Posts
694 -
Joined
-
Last visited
Everything posted by John117
-
This is what I am using on that single one for now. StringStripWS(StringReplace(StringReplace($Array2[0], 'title="$', ''), '"', ''), $STR_STRIPALL)
-
Thanks for the reply. That one's not set up like that. In that case $Array2[0] is title="$44,900"
-
$string = 'title="$44,900"' $String2 = StringRegExpReplace($string, '<\V+title="([^"]+)".+', "$1") Consolewrite($String2 & @CRLF) Doesn't look like that one works.
-
Ok so using your code I've been able to clear everything except
-
This is what I have so far. Yours works great for the numerical portions. StringReplace(StringRegExpReplace($Array2[0], "\>.*", ""), '"', "")
-
Thanks for your reply. Here are a few examples. <span title="111">111 <span title="3.5L 6 cyl Fuel Injection">3.5L 6 cyl Fuel Injection <span title="Ultra White">Ultra White <span title="Black/garnet">Black/garnet
-
Hey, I'm not that great with String Replace or String Strip where the exact string is not known. I need to be able to strip the following: "2015">2015 Where 2015 may not be known. I need to basically strip the side "*> where * behaves like a wild card and leaves only the right side 2015. Length will not be known. It will not always be numerical. It may be " * > or < * > but I can set these for each column according to which way it is set up. Please help. Just need a basic understanding of how to identify and replace the pattern with ""
-
solved
-
Had this issue forever please help
John117 replied to Mazdryk's topic in AutoIt General Help and Support
Not sure what you are doing so it didn't test this. It may work for you. -edit: changed "I may work for you" to "It may work for you." - I no work for you! :-) #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.9.4 (beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <Misc.au3> HotKeySet("{F9}", "_exit") HotKeySet("{F10}", "_go") While 1 Sleep(5000) ;Keeps script running WEnd Func _go() HotKeySet("{F10}") ;Turn th ehotkey off For $i = 1 To 9 Send(Execute('"{' & $i & '}"')) Send("{DOWN}") Sleep(10) Send("{1 UP}") Send(Execute('"{' & $i & '}"')) Send("{UP}") Next Sleep(150) HotKeySet("{F10}","_go") EndFunc ;==>_go Func _exit() Sleep(3000) Exit 0 EndFunc ;==>_exit -
Hey I have several Windows 2008 servers running autoit scripts. I would like a way to see if the script is working without having to rdp each server. I would also like to be able to send instructions to each server script using a common place. My thoughts so far. I could use a website that the script checks every hour or so for something like script1=start, script1=pause, script1=download and run new script I would need to also see the status of the script on the page. So say 5 scripts would each have their own place on the page to post their status or running timestamp. My question is simple. What kind of form, page, document can I run on a website that has something similar to cells or areas to pull and post text that can be identified for each script as their area. Also, I would not necessarily want this to be visible to others but dont want a complicated login either. -perhaps I could post the form/page in an obscure folder name or something. Any ideas or examples of web enabled fields that autoit can post to or read from?
-
Original script is from here: '?do=embed' frameborder='0' data-embedContent>> It does not seem to work. Requires ini file. -contents to demo are: -also included ini file [default] keywords=shoes, tennis shoes url=adidas.com lng=en I believe it may have to do with the "$a_URLS = StringRegExp($a_URLS, '<(?i)a class=l href="(.*?)">', 3)" section. Can anyone point me in the right direction on this one please? #include <inet.au3> #include <Array.au3> If Not FileExists(@ScriptDir & "\results") Then DirCreate(@ScriptDir & "\results") Dim $Pages Dim $msg Dim $MatchPagesForWord $keywords = IniRead("settings.ini", "default", "keywords", "XX") $keywords = StringSplit($keywords, ",") ;_ArrayDisplay($keywords,0) $url = IniRead("settings.ini", "default", "url", "XX") Dim $result[100] $lng = IniRead("settings.ini", "default", "lng", "XX") Dim $line[1] $i = 1 Do $result = _Google($keywords[$i], 100, $lng) ;_ArrayDisplay($result,0) TrayTip("Working on:", $keywords[$i], 1) ;_ArrayDisplay($result,0) $o = 1 _ArrayAdd($line, $keywords[$o] & ": ") Do $match = StringInStr($result[$o], $url) If $match <> 0 Then If $result[0] <> $o And $o <> 1 Then $sep = ", " Else $sep = "" EndIf $line[$i] = $line[$i] & $o & ", " EndIf $o = $o + 1 Until $o > $result[0] $o = 0 $line[$i] = StringTrimRight($line[$i], 2) & "." $fopen = FileOpen(@ScriptDir & "\" & "results\" & $url & "-" & $keywords[$i] & ".txt", 1) FileWriteLine($fopen, @YEAR & "." & @MON & "." & @MDAY & " " & @HOUR & ":" & @MIN & " " & $line[$i]) FileClose($fopen) $msg = $msg & $line[$i] & @CRLF $i = $i + 1 Until $keywords[0] = $i - 1 TrayTip("Complete!", "...", 1000) MsgBox(0, 0, $msg) Func _Google($s_q, $i_resultnum = 10, $lng = "en") If Not IsInt($i_resultnum) Then SetError(3) Return 0 EndIf Local $a_URLS, $s_Source[200] $s_Source = _INetGetSource('http://www.google.com/search?hl=' & $lng & '&q=' & StringReplace(StringReplace($s_q, "+", "%2B"), " ", "+") & '&num=' & $i_resultnum) ;ConsoleWrite($s_Source & @CRLF) If @error Then SetError(1) Return 0 EndIf $a_URLS = StringRegExp($a_URLS, '<(?i)a class=l href="(.*?)">', 3) ;ConsoleWrite($a_URLS & @CRLF) If @error Then SetError(2) Return 0 EndIf Local $a_URLSReturn[UBound($a_URLS) + 1] $a_URLSReturn[0] = UBound($a_URLS) Local $i_counter For $i_counter = 1 To UBound($a_URLS) $a_URLSReturn[$i_counter] = $a_URLS[$i_counter - 1] Next Return $a_URLSReturn EndFunc ;==>_Google
-
SQLite.au3 - how to test if table exsists already.
John117 replied to John117's topic in AutoIt General Help and Support
Ok, can you give me an example by rewriting this line? $sExec = "CREATE TABLE if not exists TableNameHere (ID_Here INTEGER PRIMARY KEY,a,b,c,d,e);" What would be the positive outcome, or what would it avoid? -
SQLite.au3 - how to test if table exsists already.
John117 replied to John117's topic in AutoIt General Help and Support
Very useful stuff from both of you! Thank you, will use for much more than the question stated. $sExec = "CREATE TABLE if not exists TableNameHere (ID_Here INTEGER PRIMARY KEY,a,b,c,d,e);" was very useful! -
I have a simple test script for this post. Trying to get my script to verify if a table exsists, if not, then add the table. Have tried sqlite statements I have found. none seem to work for me. Anyone here know sqlite enough to make this check if the table exsists before adding it. Just looking to get rid of the error the second time it is run. It runs in my main script everytime the script loads. -needs to. #include <SQLite.au3> #include <SQLite.dll.au3> _Query_Database_Startup_Info() Func _Query_Database_Startup_Info() Global $SqlLiteDll = _SQLite_Startup() If @error Then MsgBox(16, "Error", "Failed to start up SQLite, @error = " & @error) Else $hDB = _SQLite_Open(@ScriptDir & "\CIF1.db") If $hDB = 0 Or @error Then MsgBox(16, "Error", "Error opening database, @error = " & @error & ", @extended = " & @extended) Else $sExec = "CREATE TABLE TableNameHere (ID_Here INTEGER PRIMARY KEY,a,b,c,d,e);" _SQLite_Exec($hDB, $sExec) _SQLite_Close($hDB) _SQLite_Shutdown() EndIf EndIf EndFunc ;==>_Query_Database_Startup_Info
-
Thank you very much! Will get to it!
-
I have a list that fills a combo box. Instead of "GUICtrlRead($SomeRandomBox)" returning the value of the data in the box, I would like it to return the position in the list. In that example, the below code would return '2' not "second". #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $msg GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered GUICtrlCreateCombo("", 10, 10) ; create first item GUICtrlSetData(-1, "First|Second|Third", "Second") ; add other item snd set a new default GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example I am trying to avoid: If GUICtrlRead($SomeRandomBox) = "First" Then $Value = 1 If GUICtrlRead($SomeRandomBox) = "Second" Then $Value = 2 I am guessing there is an easier way, since the list will grow.
-
Looking for auto #include script
John117 replied to John117's topic in AutoIt General Help and Support
Thanks a lot! I was looking for organize Includes! -
Some time ago, one of the guys made a sciTE script that automatically added needed #include's and removed unneeded ones. Since I stumbled on it the first time, I am not sure how to search to find it. Anyone know what I am talking atbout? It was a script similar to Tidy
-
Scrolling a tab on a gui - Possible?
John117 replied to John117's topic in AutoIt General Help and Support
Thank you very much! I will start giving more attention and credit to switches. I haven't spent much time with them, but can see how much easier they make things. Also, thanks for chipping in GEOSoft! Appreciate it! -
Scrolling a tab on a gui - Possible?
John117 replied to John117's topic in AutoIt General Help and Support
Melba23: Thank you for your suggestion! Looks like it will be a good option. I am stuck on how to automatically display the child gui and hide it when selecting another tab. Looks like it doesnt like 'onevent' for the individual tab selection. Any thoughts on how to hide it, short of placing a button on the tab is should be on and having all tab selections hide it? (not really a bad option I guess) #include <GUIConstants.au3> #include <TabConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include "GUIScrollbars_Ex.au3" Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "_ParentWin_Special_Close") $Form1 = GUICreate("Form1", 800, 600, Default, Default) $tab = GUICtrlCreateTab(10, 10, 780, 560, $TCS_BUTTONS) GUICtrlSetOnEvent(-1, "_Hide") $tab1 = GUICtrlCreateTabItem("tab1") ;~ GUICtrlSetOnEvent(-1, "_Show") GUICtrlSetState(-1, $GUI_SHOW); will be display first $Left = 600 $Top = 40 $Heigth = 20 $Width = 120 Global $Report_Builder_Button = GUICtrlCreateButton("Click to Display", $Left, $Top, $Width, $Heigth, 0) GUICtrlSetOnEvent(-1, "_Show") $tab2 = GUICtrlCreateTabItem("Tab2") ;~ GUICtrlSetOnEvent(-1, "_Hide") Dim $F[1000] $aLeft = 20 $aTop = 150 $aHeigth = 20 $Rows = (1+(100*6)) ;rows = 50 ; Close Tab definiton GUICtrlCreateTabItem("") $hTab_Win0 = GUICreate("", 780, 400, 10, 150, $WS_POPUP, $WS_EX_MDICHILD, $Form1) $aTop = 20 For $x = 1 To $Rows Step 7 $F[$x] = GUICtrlCreateInput($x, 20, $aTop, 30, $aHeigth) $F[$x+1] = GUICtrlCreateInput($x+1, 20+30+2, $aTop, 30, $aHeigth) $F[$x+2] = GUICtrlCreateCombo($x+2, 20+30+30+4, $aTop, 120, $aHeigth) $F[$x+3] = GUICtrlCreateInput($x+3, 20+30+30+120+6, $aTop, 300, $aHeigth) $F[$x+4] = GUICtrlCreateCombo($x+4, 20+30+30+120+300+8, $aTop, 120, $aHeigth) $F[$x+5] = GUICtrlCreateCombo($x+5, 20+30+30+120+300+120+10, $aTop, 40, $aHeigth) $F[$x+6] = GUICtrlCreateCombo($x+6, 20+30+30+120+300+120+40+12, $aTop, 80, $aHeigth) $aTop = $aTop + 22 Next _GUIScrollbars_Generate($hTab_Win0, 0, 2000) GUISetState(@SW_SHOW, $Form1) ;~ GUISetState(@SW_SHOW, $hTab_Win0) While 1 Sleep(20) WEnd Func _Show() GUISetState(@SW_SHOW, $hTab_Win0) EndFunc Func _Hide() GUISetState(@SW_HIDE, $hTab_Win0) EndFunc Func _ParentWin_Special_Close() ;~ _GUIScrollbars_Generate($Form1, 0, 2000) Exit EndFunc ;==>_ParentWin_Special_Close -
Please ignore the first responder. There are plenty of reasons to use automated logins. Let me find some of the methods posted by MVPs here that I have used. ;~ #1: this one works well #include <IE.au3> $URL = "yoururlhere.com" $ObjIE = ObjCreate("InternetExplorer.Application") With $ObjIE;Wait until Forwarding Website loads .Visible = True .Navigate ($URL) Do Sleep(50) Until .ReadyState = 4 EndWith With $ObjIE.document.forms (0);Set Form Objects on Website .username.value = "Usernamehere" .password.value = "Passwordhere" .submit EndWith ;~ End #1: this one works well ;~ #2: this one works better _IENavigate ($oIE, "YourURLHere.com") ; Fill out a page and submit _IELoadWait ($oIE) $oForms1 = _IEFormGetObjByName($oIE, "NameOfFormHere") $oNum1 = _IEFormElementGetObjByName($oForms1, "NameOfemailField") $oNum2 = _IEFormElementGetObjByName($oForms1, "NameOfPasswordField") $Email = "" $Password = "" _IEFormElementSetValue($oNum1, $Email) _IEFormElementSetValue($oNum2, $Password) _IEFormSubmit($oForms1) ; Sumbit ;~ #2: this one works better
- 4 replies
-
- GuiCreate
- GUICtrlCreateInput
-
(and 1 more)
Tagged with:
-
I have a gui set up. It has several tabs. On one of the tabs I need about 100 rows. Each row includes 7 input fields. As you can guess. I cant fit 100 rows on the gui without exceeding the gui size. The gui is currently set at 800,600. I can see around 20 rows. I need to somehow be able to scroll down on the tab to see the additional 80 tabs... A scroll bar like in IE would be great! Any suggestions? test included. Thanks! #include <GUIConstants.au3> #include <TabConstants.au3> Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "_ParentWin_Special_Close") $Form1 = GUICreate("Form1", 800, 600, Default, Default) $tab = GUICtrlCreateTab(10, 10, 780, 560, $TCS_BUTTONS) $tab1 = GUICtrlCreateTabItem("tab1") GUICtrlSetState(-1, $GUI_SHOW); will be display first Dim $F[1000] $aLeft = 20 $aTop = 150 $aHeigth = 20 $Rows = (1+(50*6)) ;rows = 50 For $x = 1 To $Rows Step 7 $F[$x] = GUICtrlCreateInput($x, 20, $aTop, 30, $aHeigth) $F[$x+1] = GUICtrlCreateInput($x+1, 20+30+2, $aTop, 30, $aHeigth) $F[$x+2] = GUICtrlCreateCombo($x+2, 20+30+30+4, $aTop, 120, $aHeigth) $F[$x+3] = GUICtrlCreateInput($x+3, 20+30+30+120+6, $aTop, 300, $aHeigth) $F[$x+4] = GUICtrlCreateCombo($x+4, 20+30+30+120+300+8, $aTop, 120, $aHeigth) $F[$x+5] = GUICtrlCreateCombo($x+5, 20+30+30+120+300+120+10, $aTop, 40, $aHeigth) $F[$x+6] = GUICtrlCreateCombo($x+6, 20+30+30+120+300+120+40+12, $aTop, 80, $aHeigth) $aTop = $aTop + 22 Next $tab2 = GUICtrlCreateTabItem("Tab2") GUISetState(@SW_SHOW) While 1 Sleep(20) WEnd Func _ParentWin_Special_Close() Exit EndFunc ;==>_ParentWin_Special_Close
-
Wow! thanks a lot guys. I am done! The switch allowed me to resort it before writing, and the bit from JohnOne allowed me to verify it is loaded before proceeding! Crazy nice work! Thanks again!
-
JohnOne - Just read your comments, will add your code too! Thanks again
-
Oh wow! Thanks Robjong! That was over the top! Just got a chance to check in. Busy day at work so far! Will read through to learn a bit, really really appreciate you taking it that far. I should be able to parse the data from there!