Jump to content

EvilRubberDuck

Active Members
  • Posts

    20
  • Joined

  • Last visited

Recent Profile Visitors

72 profile views

EvilRubberDuck's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thank You!!! I will not have much time tomorrow to test it, but when i do i will say something!
  2. Hey guys! So i want to get the pixel color in a certain position while the image is still in the clipboard. I found Greenseed bot, but first i don't know what the hell happens in that code, and second i don't know if it is useful to me. Anyone can help me? Thanks
  3. I used it and didn't get any window with that handle!
  4. #include <GDIPlus.au3> #include <ClipBoard.au3> #include <MsgBoxConstants.au3> ; Capture full screen Send("{PRINTSCREEN}") ; Screen ;Send("!{PRINTSCREEN}") ; window _Main() ShellExecute(@ScriptDir & "\Image.jpg") Func _Main() Local $hBmp, $hImage MsgBox(0,"ola", _ClipBoard_GetOpenWindow () ) If Not _ClipBoard_Open(0) Then _WinAPI_ShowError("_ClipBoard_Open failed") $hBmp = _ClipBoard_GetDataEx($CF_BITMAP) _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) ; Save bitmap to file _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Image.jpg") ;$sNewName) _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() _ClipBoard_Close() EndFunc ;==>_Main I just want to laugh... so if i put the msgbox there to show me the handle of the window wih clipboard open it actually works the whole code. I get the printscreen. If i take ou that line it doesn't work... Maybe if i put a sleep fucntion ... Edit: Yap! If i put sleep(100) before clipboard_open, the code works! Maybe it takes more time to get the print to the clipboard than it gets to autoit to get from line 5 to line 15. It must be it right?
  5. I read this: This function fails if another window has the clipboard open. And tried to use this function ( _ClipBoard_GetOpenWindow ) before open clipboard to see if any window has clipboard opened and i got this: 0x00010010. But i don't know how to identify the window with this handle :/ If it is any window.
  6. I know of that function, but i need it to be using the print screen key. I tried to add more #include, close the clipboard before open it but i couldn't get it to work. :/
  7. #include <GDIPlus.au3> #include <ClipBoard.au3> ; Capture full screen Send("{PRINTSCREEN}") ; Screen ;Send("!{PRINTSCREEN}") ; window _Main() ShellExecute(@ScriptDir & "\Image.jpg") Func _Main() Local $hBmp, $hImage If Not _ClipBoard_Open(0) Then _WinAPI_ShowError("_ClipBoard_Open failed") $hBmp = _ClipBoard_GetDataEx($CF_BITMAP) _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) ; Save bitmap to file _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Image.jpg") ;$sNewName) _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() _ClipBoard_Close() EndFunc ;==>_Main Hey guys! I got this code from this post: But i get the error: Clipboar open failed. Anyone can help me? Thank you
  8. I didn't much care for the consolewrite line what i wanted was that each time i ran the script it write "OLA" under the last cell written. But it did help solve my problem because knowing that i had to add ".row" made it work in the rangewrite! So tahnk so much for the help! _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "OLA", "A" & $oRange.row+1) _Excel_BookClose($oWorkbook) _Excel_Close($oExcel)
  9. Okey you are right, but with this new code it still doesn't work: #include <Excel.au3> #include <MsgBoxConstants.au3> Global $sFilePath1 = @ScriptDir & "\Resultados_ola.xlsx" ConsoleWrite($sFilePath1 & @LF) If FileExists($sFilePath1) = 0 Then Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookNew($oExcel) _Excel_BookSaveAs($oWorkbook, @ScriptDir & "\Resultados_ola.xlsx", "xlsx") Else Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, $sFilePath1) Global $oRange = $oWorkbook.ActiveSheet.UsedRange.SpecialCells($xlCellTypeLastCell) ConsoleWrite($oRange & @LF) EndIf _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "OLA", $oRange+1) _Excel_BookClose($oWorkbook) _Excel_Close($oExcel)
  10. If you notice my script: Global $aLastRow = $sWorkbook.ActiveSheet.UsedRange.SpecialCells($xlCellTypeLastCell) I already use the code in the wiki. What i want to know is why it doesn't work in my script. For example if i write after consolewrite($aLastRow)I get no value...
  11. #include <Excel.au3> #include <MsgBoxConstants.au3> Global $oExcel = _Excel_Open() lobal $sWorkbook = _Excel_BookNew($oExcel) $oExcel.ActiveWorkBook.SaveAs(@ScriptDir & "\Resultados_ola.xlsx") Global $aLastRow = $sWorkbook.ActiveSheet.UsedRange.SpecialCells($xlCellTypeLastCell) ;~ Global $aLastRow = $oExcel.Cells.SpecialCells($xlCellTypeLastCell).Row ;~ Global $aLastRow = $sWorkbook.Activesheet.UsedRange.Rows.Count _Excel_RangeWrite($sWorkbook, $sWorkbook.Activesheet, "OLA", $aLastRow+1) _Excel_BookClose($sWorkbook) _Excel_Close($sWorkbook)I got part of this code from other topics, but then i read that the Excel UDF changed and now i don't know what code works anymore xD So I want to get the last row to get written so i can write in the next row. I tried serveral codes that i found in the forum (the ones in comment) but i couldn't get the value no matter what i did. What am i doing wrong? Thank you in advance
  12. Yeah don't worry I understood all the changes! Thank you so much!!!
  13. I tried to create a controlID using the info here, but it seems it doesn't work that well here or i made a mistake.. Can you tell me if it's possible to use this to create "controlsID"? $numb = $numb + $numbr $sInput = "$" & "Input" & $numb $sInput = Execute($sInput) $iX=$iX+24+$iXr $Input=GUICtrlCreateInput("", $iX, $iY, 24, 21, BitOR($ES_AUTOHSCROLL,$WS_GROUP)) GUICtrlSetLimit(-1, 1)I thought this would create and Input associated to the variable $Input5 (5 being the number in $numb). I wanted this so i could then call this variable with guictrlread. Analyzing your the thing that i dint't know was that i could use arrays as variables. What i mean is that i thought that i could only use arrays in my code to store information.
  14. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> ola() Func ola() #Region ### START Koda GUI section ### Form=c:\users\joaor\desktop\ola.kxf $Form1_1 = GUICreate("ola", 859, 518, 240, 122) $MenuItem1 = GUICtrlCreateMenu("&File") $MenuItem3 = GUICtrlCreateMenuItem("New", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("Save", $MenuItem1) $MenuItem5 = GUICtrlCreateMenuItem("Save as", $MenuItem1) $MenuItem6 = GUICtrlCreateMenuItem("Exit", $MenuItem1) $MenuItem2 = GUICtrlCreateMenu("&Options") $MenuItem7 = GUICtrlCreateMenuItem("Settings", $MenuItem2) $idButton_1 = GUICtrlCreateButton("Calculate", 640, 32, 75, 25, $WS_GROUP) $Label1 = GUICtrlCreateLabel("Mabe by J.Ribas", 688, 472, 83, 17, $WS_GROUP) $Label2 = GUICtrlCreateLabel("Número de Aluno:", 0, 24, 89, 17, $WS_GROUP) $Label3 = GUICtrlCreateLabel("Sexo:", 208, 24, 31, 17, $WS_GROUP) $Label4 = GUICtrlCreateLabel("Ano:", 64, 48, 26, 17, $WS_GROUP) $Label5 = GUICtrlCreateLabel("Turma:", 208, 48, 37, 17, $WS_GROUP) $Label6 = GUICtrlCreateLabel("Resultados", 792, 96, 57, 17, $WS_GROUP) $Input1 = GUICtrlCreateInput("", 88, 24, 73, 21, BitOR($ES_AUTOHSCROLL,$WS_GROUP)) $Input2 = GUICtrlCreateInput("", 248, 24, 73, 21, BitOR($ES_AUTOHSCROLL,$WS_GROUP)) $Input3 = GUICtrlCreateInput("", 88, 48, 73, 21, BitOR($ES_AUTOHSCROLL,$WS_GROUP)) $Input4 = GUICtrlCreateInput("", 248, 48, 73, 21, BitOR($ES_AUTOHSCROLL,$WS_GROUP)) $icolum=-8 $numbcol=0 For $icol = 1 to 12 $icolum=$icolum+56 $numbcol=$numbcol+1 GUICtrlCreateLabel("Coluna " & $numbcol, $icolum, 80, 52, 17, $WS_GROUP) Next $iline=98 $numblin=0 For $icol = 1 to 14 $iline=$iline+24 $numblin=$numblin+1 GUICtrlCreateLabel("Linha " & $numblin, 4, $iline, 42, 17, $WS_GROUP) Next $iplus=-8 $iminus=16 For $icol = 1 to 12 $iplus=$iplus+56 $Label34 = GUICtrlCreateLabel(" +", $iplus, 96, 21, 24, $WS_GROUP) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $iminus=$iminus+56 $Label35 = GUICtrlCreateLabel(" -", $iminus, 96, 17, 24, $WS_GROUP) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") Next $iY=96 $numb=5 $numbr=0 For $ilin = 1 to 14 $iY=$iY+24 $iX=24 $iXr=0 For $icolu = 1 to 12 $numb=$numb+$numbr $sInput="$" & "Input" &$numb $sInput=execute($sInput) $iX=$iX+24+$iXr $sInput=GUICtrlCreateInput("", $iX, $iY, 24, 21, BitOR($ES_AUTOHSCROLL,$WS_GROUP)) GUICtrlSetLimit(-1, 1) $numb=$numb+1 $sInput="$" & "Input" &$numb $sInput=execute($sInput) $sInput=GUICtrlCreateInput("", $iX+24, $iY, 24, 21, BitOR($ES_AUTOHSCROLL,$WS_GROUP)) GUICtrlSetLimit(-1, 1) $iXr=32 $numbr=1 Next Next GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $idMsg = GUIGetMsg() Select Case $idMsg=$GUI_EVENT_CLOSE ExitLoop Case $idMsg = $idButton_1 $numb=5 $numbr=0 Local $arr[14][24] For $i=0 to UBound( $arr, 1) -1 For $j=0 to UBound( $arr, 2) -1 $numb=$numb+$numbr $sInput="$" & "Input" &$numb $sInput=execute($sInput) $arr[$i][$j]=GUICtrlRead($sInput) ConsoleWrite($arr[$i][$j]& @LF) $numbr=1 Next Next _ArrayDisplay($arr) EndSelect WEnd ExitThank you so much for your help to this point Melba23! So wrote my code from scratch basing myself on the code you wrote Melba23, and it's like this now. But because i changed the way the inputs are generated i can´t seem to save them in the array now. I tried to define variables to Input's again but it doesn't work.. What am i doing wrong?
  15. Oh wow, that indeed is much better! I tried with your code and indeed now i can get the values that i write in the Inputboxes, but i still don't understand why with my code i can't get my Inputvalues :/ If you could explain me i would much obliged! I just have one small problem with your code: With mine i clicked "TAB" and the mouse passed to the cell to the right till the end of the line, and now is go by coluns. But i think that i resolve that simply by changing the order they are created. (Am i right?) Now i need to compare the array with all the Inputs with 10 other arrays of the same size and with values predefined. Depending if they are the same or not will vary the final result. But that i want to try it first myself.
×
×
  • Create New...