
Leoj
Active Members-
Posts
76 -
Joined
-
Last visited
Leoj's Achievements

Wayfarer (2/7)
0
Reputation
-
What it does: lets you make an ini file that points to all of the scripts you want to and then makes tabs for those scripts in the program with the scripts displayed in an edit area for easy copy&paste. Example .ini and files that the ini points to included (also a compiled and source version) You could edit the file extensions to accommodate any files you may use... #include <GUIConstants.au3> #include <File.au3> #include <GuiListView.au3> $tabsOn = 1 $k = 0 $unLoaded = 1 Dim $Tab_Item[50] Dim $Edit_Item[50] Dim $scriptItem[1000] $scriptFolder = "scripts\" $GUItitle = "codeHelper" $GUIsize = 550 $nodeSize = $GUIsize - 550 $indentX = 32 $indentY = $indentX + 30 GUICreate($GUItitle, $GUIsize, $GUIsize) $tab = GUICtrlCreateTab(10, 10, $GUIsize - 20, $GUIsize - 20) GUISetState(@SW_SHOW) ;Actions Tab $actionsTab = GUICtrlCreateTabItem("Actions") ;top (Load Code) group GUICtrlCreateGroup("", -99, -99, 1, 1) ;$loadCodeGroup = GUICtrlCreateGroup("Load Code", $indentX, $indentY, 481, 185) $scriptsList = GUICtrlCreateListView("Path |Comments|HTML|CSS|JS|PHP|XML|XLS", $indentX, $indentY, 480, 422) $FileList = _FileListToArray($scriptFolder, "*", 1) If @error = 1 Then MsgBox(0, "", "No files found in /scripts/ folder.") EndIf For $i = 1 To $FileList[0] ;.ini, .txt, .etc If StringInStr($FileList[$i], ".ini") Then ;if ini then $sectNames = IniReadSectionNames($scriptFolder & $FileList[$i]) ;read section names $type = "" $typeHTML = 0 $typeCSS = 0 $typeJS = 0 $typePHP = 0 $typeXML = 0 $typeXSL = 0 For $j = 1 To UBound($sectNames) - 1 ;for all sections... $fileNameLoc = "" $fileNameLoc = IniRead($scriptFolder & $FileList[$i], $sectNames[$j], "filenameloc", "") ;read value of filenameloc $comment = IniRead($scriptFolder & $FileList[$i], "comments", "comment", "") ;read value of comment If Not $fileNameLoc = "" Then If StringInStr($fileNameLoc, ".html") Then $typeHTML = $typeHTML + 1 If StringInStr($fileNameLoc, ".css") Then $typeCSS = $typeCSS + 1 If StringInStr($fileNameLoc, ".js") Then $typeJS = $typeJS + 1 If StringInStr($fileNameLoc, ".php") Then $typePHP = $typePHP + 1 If StringInStr($fileNameLoc, ".xml") Then $typeXML = $typeXML + 1 If StringInStr($fileNameLoc, ".xsl") Then $typeXSL = $typeXSL + 1 EndIf Next $FileItem = StringReplace($FileList[$i], ".ini", "") $scriptItem[$i] = GUICtrlCreateListViewItem($FileItem & "|" & $comment & "|" & $typeHTML & "|" & $typeCSS & "|" & $typeJS & "|" & $typePHP & "|" & $typeXML & "|" & $typeXSL, $scriptsList) EndIf Next $unLoadButton = GUICtrlCreateButton("UNLOAD", $indentX + 62, $indentY + 440, 57, 25, 0) $loadButton = GUICtrlCreateButton("LOAD", $indentX, $indentY + 440, 57, 25, 0) GUICtrlCreateTabItem("") GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $loadButton Then If $unLoaded = 1 Then $listItemString = GUICtrlRead(GUICtrlRead($scriptsList)) $fileNameLoc = StringSplit($listItemString, "|") $tabFileName = $fileNameLoc[1] $filename = $scriptFolder & $fileNameLoc[1] & ".ini" $section = IniReadSectionNames($filename) For $i = 1 To UBound($section) - 1 ;for every section... $tabName = IniRead($filename, $section[$i], "tabname", "null") ;get the listed tab name $fileNameLoc = IniRead($filename, $section[$i], "filenameloc", "null") ;get the listed file name If $fileNameLoc = "null" Or $tabName = "null" Then ;MsgBox(0,"***","doing nothing") Else $file = FileOpen($fileNameLoc, 0) ;open that file If $file = -1 Then MsgBox(0, "Error", "Unable to open file " & $fileNameLoc) ExitLoop Else $content = FileRead($file) ;read the files contents $k = $k + 1 $Tab_Item[$k] = GUICtrlCreateTabItem($tabName) ;create the tab with appropriate tab name $Edit_Item[$k] = GUICtrlCreateEdit($content, $indentX, $indentY, $GUIsize - 65, $GUIsize - 90) ;create the edit area with appropriate contents GUICtrlSetState($Tab_Item[$k], $GUI_SHOW) EndIf FileClose($file) $unLoaded = 0 EndIf Next ElseIf $unLoaded = 0 Then MsgBox(0, "Alert", "You must unload current file to load another") EndIf EndIf If $msg = $unLoadButton Then If $unLoaded = 0 Then For $i = 1 To $k GUICtrlDelete($Tab_Item[$i]) $unLoaded = 1 Next EndIf EndIf WEnd Example .ini file: [comments] comment=This is a test Comment that is just a bit long... [tab1] tabname=HTML filenameloc=pages\testSite\scrpt.html [tab2] tabname=CSS One filenameloc=pages\testSite\scrpt.css [tab3] tabname=Javascript filenameloc=pages\testSite\scrpt.js [tab4] tabname=CSS Two filenameloc=pages\testSite\scrpt.css I'd imagine the functionally is very expandable from here so feel free to add stuff and then post a reply in this thread if you'd please.. I hope *anyone* enjoys this =) [also is there anything similar? I'm sure there's lots of things like this one on these forums--well, this is mine] Edit: updated attachment with working .exe - everything else is the same =P codeHelper.zip
-
create/add in new GUI elements after program is running
Leoj replied to Leoj's topic in AutoIt General Help and Support
thanks tons for your input enai -- I was able to finish my program because of it! -
I have my script create a GUI with one tab. When you click a button I want new tabs to be added the tab element thing. I am able to do this but I'm pretty sure I'm not doing it right and that they don't have unique variable names that I can interact with. GUICreate($GUItitle,$GUIsize,$GUIsize) $tab=GUICtrlCreateTab (10,10, $GUIsize-20,$GUIsize-20) ... .. . If $msg = $loadButton Then ... .. . For $i = 1 to UBound($section) - 1 ;for every section... $tabName = IniRead($filename, $section[$i], "tabname", "null") ;get the listed tab name $fileNameLoc = IniRead($filename, $section[$i], "filenameloc", "null") ;get the listed file name If $fileNameLoc = "null" Then ;do nothing ElseIf $tabsOn = 1 Then $file = FileOpen($fileNameLoc, 0) ;open that file If $file = -1 Then MsgBox(0, "Error", "Unable to open file "&$fileNameLoc) Else $content = FileRead($file) ;read the files contents $tab = GUICtrlCreateTabitem($tabName) ;create the tab with appropriate tab name $edit = GUICtrlCreateEdit($content, $indentX, $indentY, $GUIsize-65, $GUIsize-90) ;create the edit area with appropriate contents EndIf FileClose($file) ... .. . EndIf EndIf I don't understand how to make this "$tab = GUICtrlCreateTabitem($tabName) ;create the tab with appropriate tab name" have a unique variable name that would let me delete the tab after it's been added in...
-
Any way to make stringregexp work with large files (upwards of 100Kb)? Have to use something other than this function? The program makes windows give the error: Program has stopped working... can I add a pause in somewhere?
-
this doesn't work when the file has a @CRLF (or "newline")... I think it has something to do with the (.*?) part... any help appreciated!! (p.s. It works how I need it when there's no newlines...) $szFileName = "testWebScript.txt" $hFile = FileOpen($szFileName, 0) Local $s_TotFile = FileRead($hFile, FileGetSize($szFileName)) FileClose($hFile) $nOffset = 1 While 1 $array2 = StringRegExp($s_TotFile, '">(.*?)<CH', 1, $nOffset) $array = StringRegExp($s_TotFile, '<CHnewtab="(.*?)">', 1, $nOffset) If @error = 0 Then $nOffset = @extended Else ExitLoop EndIf for $i = 0 to UBound($array) - 1 $tab = "Tab"&$i $tab = GUICtrlCreateTabitem($array[$i]) $edit = "Edit"&$i $edit = GUICtrlCreateEdit($array2[$i], $indentX, $indentY, $GUIsize-65, $GUIsize-90) Next WEnd file being regexed: <CHnewtab="comments">Content One<CHnewtab="head">Content 2<CHnewtab="body">Content 3three<CHendfile>
-
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
http://support.microsoft.com/kb/258822 This UDF uses "$MOUSE_EXTRABUTTONDOWN_EVENT" to interact with the thumb button... and calls the "thumb button" the "extra button"... I don't know what's the best terminology but is it a bit clearer now?? =/ -
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
Yep, none of those includes the thubbutton as far as I can tell >.> So is there any UDF or anything I can attempt to use? -
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
Is there any way to MouseDown/Up the thumb-button on the mouse?? All I see is MouseDown/Up for left, right, and middle keys =/ -
Thanks fo this
-
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
Thanks TONS and TONS wolf, you ROCK my socks off. (following code for reference, pretend it's not even in this post =P) #include <MouseSetOnEvent_UDF.au3> $mButDwn = $MOUSE_EXTRABUTTONDOWN_EVENT $mButUp = $MOUSE_EXTRABUTTONUP_EVENT _MouseSetOnEvent($mButDwn, "ExtraButtonDown_Event") _MouseSetOnEvent($mButUp, "ExtraButtonUp_Event") While 1 Sleep(10) WEnd Func ExtraButtonDown_Event() ;Send("{, down}") MouseDown("middle") EndFunc Func ExtraButtonUp_Event() ;Send("{, up}") MouseUp("middle") EndFunc Exit Func _IsPressed($hexKey) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFunc -
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
Wowww I just discovered: {f down}... Ill let you know how that works out ... EDIT: Wait, I'm a tard... I can't ControlSend {f down} can I??? -
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
And what I meant about send F UNTIL $go = 0 was that right now it sends "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" when I want it to press and hold "F" until $go is 0 -
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
#include <MouseSetOnEvent_UDF.au3> _MouseSetOnEvent($MOUSE_WHELLDOWN_EVENT, "ExtraButtonDown_Event") _MouseSetOnEvent($MOUSE_WHELLUP_EVENT, "ExtraButtonUp_Event") $downOnce = 0 $upOnce = 0 $go = 0 While 1 If $go = 1 Then MouseClick("middle") ;Send("w") ;AutoItSetOption("SendKeyDownDelay", 1000) ;ControlSend("Untitled", "", "", "{F}") Run("sendFtoVent.exe") EndIf Sleep(10) WEnd Func ExtraButtonDown_Event() If $downOnce = 0 Then $go = 1 EndIf $downOnce = 1 EndFunc Func ExtraButtonUp_Event() $go = 0 If $upOnce = 1 Then ;MsgBox(0,"up","mid mouse up") ProcessClose("sendFtoVent.exe") $upOnce = 0 EndIf $upOnce = 1 $downOnce = 0 EndFunc Exit Func _IsPressed($hexKey) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFunc sendFtoVent.exe: $sent = 0 While 1 If $sent = 0 Then AutoItSetOption("SendKeyDownDelay", 100000) ControlSend("Untitled", "", "", "{F}") EndIf $sent = 1 Sleep(10) WEnd Oh and "Untitled" is because I'm just sending it to notepad for now for testing -
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
OK, but when I do MouseClick("middle") it only sends F to ventrilo once... Is there any way I can say ControlSend("Untitled", "", "", "{F}") UNTIL $go = 0 ?? ...you know because right now I'm just using that while loop -
Disable mouse wheel down except for Ventrilo
Leoj replied to Leoj's topic in AutoIt General Help and Support
OK, that sounds like a reasonable solution, but how can I send mouse buttons? Something like Send("{MOUSE_WHEEL_UP}") I'd imagine... thanks for all of your help this far =D