tsolrm Posted July 31, 2012 Share Posted July 31, 2012 (edited) Hi, I just can't see why GUICtrlRead doesn't read the input text from $texttest = GUICtrlRead($Offender[$index]) _ArrayDisplay ($Offender) - this displays the array with all the controls Help please? #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <ScreenCapture.au3> #include <array.au3> #include <GuiTab.au3> #NoTrayIcon #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Ban Poster", 912, 641, 192, 132) $Tab1 = GUICtrlCreateTab(0, 0, 921, 33) $Room = GUICtrlCreateCombo("RHLR 1", 736, 208, 169, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "RHLR 2|RHLR 3|RHLR 4|RHLR 5|RHLR 6|RHLR 7") $Label1 = GUICtrlCreateLabel("Ник нарушителя:", 8, 42, 170, 30) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $Label2 = GUICtrlCreateLabel("Комната:", 736, 176, 63, 20) $OpenScreen = GUICtrlCreateButton("Открыть", 592, 60, 137, 25) $Pic1 = GUICtrlCreatePic(@ScriptDir & 'banned.jpg', 736, 253, 169, 100) Opt("TrayMenuMode", "1") HotKeySet("{PRINTSCREEN}", "PRINTSCREEN") $exit = TrayCreateItem("Выход") TraySetState() $tabs = 0 Global $tabA[1], $Screen[1], $ScreenName[1], $Offender[1] While 1 $msg = TrayGetMsg () If $msg = $exit Then Exit $guimsg = GUIGetMsg() Select Case $guimsg = $pic1 $current=GUICtrlRead ($Tab1,1 ) $index = _GUICtrlTab_GetCurSel($Tab1) $index+=1 MsgBox (0,"test", $index) GUICtrlDelete ($current) $tabs -=1 If $tabs=0 Then GUISetState(@SW_HIDE) EndIf ConsoleWrite (@CRLF&$index) _ArrayDisplay ($Offender) $texttest = GUICtrlRead($Offender[$index]) $texttest2 = GUICtrlRead($screenname[$index]) ConsoleWrite (@CRLF&$texttest&@CRLF&$texttest2) _ArrayDelete ($tabA, $index+1) _ArrayDelete ($screen, $index+1) _ArrayDelete ($screenname, $index+1) _ArrayDelete ($offender, $index+1) ; Remove the tab AND the edit from the arrays ; Remove the tab Case $guimsg = $GUI_EVENT_CLOSE Exit EndSelect Wend Func PrintScreen () ;If WinActive ("Warcraft III") Then $name = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC _ScreenCapture_Capture(@ScriptDir&"screens"&$name&".jpg") $tabs +=1 ReDim $tabA [$tabs+1] ReDim $Screen [$tabs+1] ReDim $ScreenName [$tabs+1] ReDim $Offender [$tabs+1] $tabA[$tabs]=GUICtrlCreateTabItem("Реквест") $Screen [$tabs] = GUICtrlCreatePic(@ScriptDir&"screens"&$name&".jpg", 8, 88, 721, 545) $ScreenName [$tabs] = GUICtrlCreateLabel($name&".jpg", 610, 40, 150, 20) $Offender [$tabs] = GUICtrlCreateInput("", 180, 45, 177, 24) GUICtrlCreateTabItem("") ;$Button1 = GUICtrlCreateButton("Button1", 736, 533, 169, 100) GUISetState(@SW_SHOW) ;EndIf #EndRegion ### END Koda GUI section ### EndFunc Edited July 31, 2012 by tsolrm Link to comment Share on other sites More sharing options...
Mechaflash Posted July 31, 2012 Share Posted July 31, 2012 (edited) heh... i don't see a control defined as $Offender anywhere in your code.You created an edit. Edited July 31, 2012 by mechaflash213 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 31, 2012 Moderators Share Posted July 31, 2012 ;If WinActive ("Warcraft III") Then $name = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC _ScreenCapture_Capture(@ScriptDir&"screens"&$name&".jpg")Hi, tsolm. Please see the forum rules, particularly the bit about game automation. You will see why you will not receive any help. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 31, 2012 Moderators Share Posted July 31, 2012 tsolrm,If WinActive ("Warcraft III")Care to offer an explanation? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tsolrm Posted July 31, 2012 Author Share Posted July 31, 2012 My god people, why are u so paranoid. This has nothing to do with game automation, in fact i don't see how u could possibly automate Warcraft 3. How exactly capturing a screen shot automates the game? Link to comment Share on other sites More sharing options...
Mechaflash Posted July 31, 2012 Share Posted July 31, 2012 His code shows that all he's doing is taking and indexing screenshots. However it is for a game. Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
BrewManNH Posted July 31, 2012 Share Posted July 31, 2012 Create a few tabs with the PrintScreen button and then click on the picture, it will work correctly. Otherwise there's nothing in the Offender array yet. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
tsolrm Posted July 31, 2012 Author Share Posted July 31, 2012 (edited) I've tried creating 3-4 tabs. $Offender[$index] and $ScreenName[$index] returns 0 for all. Even though the actual array $Offender exists and holds the numbers of the controls and $index returns a valid index for the tab Edited July 31, 2012 by tsolrm Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 31, 2012 Moderators Share Posted July 31, 2012 tsolrm,My god people, why are u so paranoidBecause experience has, alas, taught me to be so. ;(And why reply so aggressively? You will note that I did not lock the thread nor accuse you of anything. All I asked for was an explanation of why there was reference to a game in your script. Blasting off like you did does your case no good at all. I am sorely tempted to react to your attitude, but then I would be guilty of the same offence. So please try and be more civil in future and make the forum a more pleasant place for us all. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tsolrm Posted July 31, 2012 Author Share Posted July 31, 2012 Well I am sorry for the attitude but this is not the first time people send me to read forum rules. I've read them believe me. Can some one help me on the subject? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 31, 2012 Moderators Share Posted July 31, 2012 tsolrm,Well I am sorry for the attitudeApology accepted. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tsolrm Posted July 31, 2012 Author Share Posted July 31, 2012 I don't know what to do. after the input box is created i've added this code GUICtrlSetData ($Offender [$tabs], "test") $texttest = GUICtrlRead($Offender[$tabs]) ConsoleWrite (@CRLF&$Offender [$tabs]&@CRLF&$texttest) In the console it shows 12 test Now without touching anything else $texttest = GUICtrlRead($Offender[$index]) ConsoleWrite (@CRLF&$Offender[$index]) ConsoleWrite (@CRLF&$texttest&@CRLF&$texttest2) this gives 12 0 I must be missing something. This is driving me nuts Link to comment Share on other sites More sharing options...
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