TheOnlyOne Posted December 13, 2008 Share Posted December 13, 2008 my question is how to switch picture everytime i click "right" and it should go to right every time i click right? this is my code right now i just tryed a little bit but dont think its correct. expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> hotkeyset ("{right}","right") $4="C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica21.jpg"; that is my man $5="C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica2.jpg"; that is the other plates local $avArray[9] $pic= $avArray[1] $pic= $avArray[2] $pic= $avArray[3] $pic= $avArray[4] $pic= $avArray[5] $pic= $avArray[6] $pic= $avArray[7] $pic= $avArray[8] $pic= $avArray[9] $1=0 $2=145 $3=282 #Region ### START Koda GUI section ### Form=C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\Form1.kxf $Form1 = GUICreate("Form1", 429, 434, 190, 121) $pic= GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start :) $pic= GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $pos =$pic func right () $pos = $pos+3; its here when i click right its need to move to the right but how ? endfunc Link to comment Share on other sites More sharing options...
Andreik Posted December 13, 2008 Share Posted December 13, 2008 my question is how to switch picture everytime i click "right" and it should go to right every time i click right? this is my code right now i just tryed a little bit but dont think its correct. expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> hotkeyset ("{right}","right") $4="C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica21.jpg"; that is my man $5="C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica2.jpg"; that is the other plates local $avArray[9] $pic= $avArray[1] $pic= $avArray[2] $pic= $avArray[3] $pic= $avArray[4] $pic= $avArray[5] $pic= $avArray[6] $pic= $avArray[7] $pic= $avArray[8] $pic= $avArray[9] $1=0 $2=145 $3=282 #Region ### START Koda GUI section ### Form=C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\Form1.kxf $Form1 = GUICreate("Form1", 429, 434, 190, 121) $pic= GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start :) $pic= GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $pic= GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $pos =$pic func right () $pos = $pos+3; its here when i click right its need to move to the right but how ? endfuncYou have a lot of mistakes. Check in help file about arrays and about controls. Don't forget to use a main loop in your script. If you want to learn AutoIt, look here: http://www.autoitscript.com/forum/index.ph...st&p=609033 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
MrCreatoR Posted December 13, 2008 Share Posted December 13, 2008 What you mean by switching the picture? like show it? Try this: expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ; HotKeySet("{Right}", "_Right_Pic") Global $aPics[10] Global $iCurrent_Pic = 1 Global $4 = "C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica21.jpg"; that is my man Global $5 = "C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica2.jpg"; that is the other plates Global $1 = 0 Global $2 = 145 Global $3 = 282 $Form1 = GUICreate("Form1", 429, 434, 190, 121) $aPics[1] = GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start :) $aPics[2] = GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[3] = GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[4] = GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[5] = GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[6] = GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[7] = GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[8] = GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[9] = GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates For $i = 2 To 9 GUICtrlSetState($aPics[$i], $GUI_HIDE) Next GUISetState(@SW_SHOW) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _Right_Pic() GUICtrlSetState($aPics[$iCurrent_Pic], $GUI_HIDE) $iCurrent_Pic += 1 If $iCurrent_Pic > 9 Then $iCurrent_Pic = 1 GUICtrlSetState($aPics[$iCurrent_Pic], $GUI_SHOW) EndFunc Not tested much.  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
TheOnlyOne Posted December 13, 2008 Author Share Posted December 13, 2008 (edited) What you mean by switching the picture? like show it? Try this: expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ; HotKeySet("{Right}", "_Right_Pic") Global $aPics[10] Global $iCurrent_Pic = 1 Global $4 = "C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica21.jpg"; that is my man Global $5 = "C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica2.jpg"; that is the other plates Global $1 = 0 Global $2 = 145 Global $3 = 282 $Form1 = GUICreate("Form1", 429, 434, 190, 121) $aPics[1] = GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start :) $aPics[2] = GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[3] = GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[4] = GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[5] = GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[6] = GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[7] = GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[8] = GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[9] = GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates For $i = 2 To 9 GUICtrlSetState($aPics[$i], $GUI_HIDE) Next GUISetState(@SW_SHOW) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _Right_Pic() GUICtrlSetState($aPics[$iCurrent_Pic], $GUI_HIDE) $iCurrent_Pic += 1 If $iCurrent_Pic > 9 Then $iCurrent_Pic = 1 GUICtrlSetState($aPics[$iCurrent_Pic], $GUI_SHOW) EndFunc Not tested much.okay that are working but stil some mistakes if i need the hotkeys on left&up&down too how to set that in then ? and right now there are only one picture moveing the other are not showed and it is "C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica21.jpg there switch whit the other pcitures ? and what i mean whit switch the picture i mean when i press right the pictue1 (my man) switch to picture2 so they chance plases:) and when i do it agian then it going to be picture3 ? but how ? Edited December 13, 2008 by TheOnlyOne Link to comment Share on other sites More sharing options...
MrCreatoR Posted December 13, 2008 Share Posted December 13, 2008 I don't understand. Describe step-by-step what you want to do with this form. But first go to the Help file and read it a little(?), because i think you want to make stuff that you don't understand .  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
TheOnlyOne Posted December 13, 2008 Author Share Posted December 13, 2008 (edited) I don't understand. Describe step-by-step what you want to do with this form. But first go to the Help file and read it a little(?), because i think you want to make stuff that you don't understand . okay when i have alle the pictures $aPics[1] = GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start ////////////////////// this is my man $aPics[2] = GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[3] = GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[4] = GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[5] = GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[6] = GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[7] = GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[8] = GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[9] = GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates when i press right he should move to the right (right for $apics[1] should move to $aPics[2] and when i press agian i should end over in $aPics[3] and like that whit up,down,left,right keys ? so the picture chance there spots so $aPics[1]=$aPics[2] first time clicking right ? Edited December 13, 2008 by TheOnlyOne Link to comment Share on other sites More sharing options...
Mattraks Posted December 14, 2008 Share Posted December 14, 2008 GUICtrlSetPos Link to comment Share on other sites More sharing options...
MrCreatoR Posted December 14, 2008 Share Posted December 14, 2008 okay when i have alle the pictures $aPics[1] = GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start ////////////////////// this is my man $aPics[2] = GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[3] = GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[4] = GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[5] = GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[6] = GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[7] = GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[8] = GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[9] = GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates when i press right he should move to the right (right for $apics[1] should move to $aPics[2] and when i press agian i should end over in $aPics[3] and like that whit up,down,left,right keys ? so the picture chance there spots so $aPics[1]=$aPics[2] first time clicking right ? Can you upload the needed pictures, so i can test with them?  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
TheOnlyOne Posted December 14, 2008 Author Share Posted December 14, 2008 Can you upload the needed pictures, so i can test with them?there you go pictures.rar Link to comment Share on other sites More sharing options...
MrCreatoR Posted December 14, 2008 Share Posted December 14, 2008 Ok, not sure if i understood correctly this time, but here is what i came up with: expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ; HotKeySet("{Right}", "_Right_Pic") HotKeySet("{Left}", "_Left_Pic") HotKeySet("{Up}", "_Up_Pic") HotKeySet("{Down}", "_Down_Pic") Global $aPics[10] Global $iCurrent_Pic = 1 Global $4 = @ScriptDir & "\Pictures\dioica21.jpg"; that is my man Global $5 = @ScriptDir & "\Pictures\dioica2.jpg"; that is the other plates Global $1 = 0 Global $2 = 140 Global $3 = 280 $Form1 = GUICreate("Form1", 420, 420, 190, 121) GUISetBkColor(0x009700) $aPics[0] = GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start $aPics[1] = GUICtrlCreatePic($5, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start $aPics[2] = GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[3] = GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[4] = GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[5] = GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[6] = GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[7] = GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[8] = GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[9] = GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates ;~ For $i = 2 To 9 ;~ GUICtrlSetState($aPics[$i], $GUI_HIDE) ;~ Next GUISetState(@SW_SHOW) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _Right_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[0] > $2 Then $aPic_Pos[0] = -$2 GUICtrlSetPos($aPics[0], $aPic_Pos[0] + $2, $aPic_Pos[1]) EndFunc Func _Left_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[0] < $2 Then $aPic_Pos[0] = $2 * 3 GUICtrlSetPos($aPics[0], $aPic_Pos[0] - $2, $aPic_Pos[1]) EndFunc Func _Up_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[1] < $3 / 3 Then $aPic_Pos[1] = $3 * 2 - $3 / 2 GUICtrlSetPos($aPics[0], $aPic_Pos[0], $aPic_Pos[1]-$3 / 2) EndFunc Func _Down_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[1] > $3 / 2 Then $aPic_Pos[1] = -$3 / 2 GUICtrlSetPos($aPics[0], $aPic_Pos[0], $aPic_Pos[1] + $3 / 2) EndFunc  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
TheOnlyOne Posted December 14, 2008 Author Share Posted December 14, 2008 Ok, not sure if i understood correctly this time, but here is what i came up with: expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ; HotKeySet("{Right}", "_Right_Pic") HotKeySet("{Left}", "_Left_Pic") HotKeySet("{Up}", "_Up_Pic") HotKeySet("{Down}", "_Down_Pic") Global $aPics[10] Global $iCurrent_Pic = 1 Global $4 = @ScriptDir & "\Pictures\dioica21.jpg"; that is my man Global $5 = @ScriptDir & "\Pictures\dioica2.jpg"; that is the other plates Global $1 = 0 Global $2 = 140 Global $3 = 280 $Form1 = GUICreate("Form1", 420, 420, 190, 121) GUISetBkColor(0x009700) $aPics[0] = GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start $aPics[1] = GUICtrlCreatePic($5, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start $aPics[2] = GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[3] = GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[4] = GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[5] = GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[6] = GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[7] = GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[8] = GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[9] = GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates ;~ For $i = 2 To 9 ;~ GUICtrlSetState($aPics[$i], $GUI_HIDE) ;~ Next GUISetState(@SW_SHOW) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _Right_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[0] > $2 Then $aPic_Pos[0] = -$2 GUICtrlSetPos($aPics[0], $aPic_Pos[0] + $2, $aPic_Pos[1]) EndFunc Func _Left_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[0] < $2 Then $aPic_Pos[0] = $2 * 3 GUICtrlSetPos($aPics[0], $aPic_Pos[0] - $2, $aPic_Pos[1]) EndFunc Func _Up_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[1] < $3 / 3 Then $aPic_Pos[1] = $3 * 2 - $3 / 2 GUICtrlSetPos($aPics[0], $aPic_Pos[0], $aPic_Pos[1]-$3 / 2) EndFunc Func _Down_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[1] > $3 / 2 Then $aPic_Pos[1] = -$3 / 2 GUICtrlSetPos($aPics[0], $aPic_Pos[0], $aPic_Pos[1] + $3 / 2) EndFunc okay it works now thanks hmm i have set an random in func right but its allways the same number lets say the number is 3 its allways 3 not a new one next time i click right ? how to update the random all the time? expandcollapse popup[/code] #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ; HotKeySet("{Right}", "_Right_Pic") HotKeySet("{Left}", "_Left_Pic") HotKeySet("{Up}", "_Up_Pic") HotKeySet("{Down}", "_Down_Pic") global $11= random (1,10,1) Global $aPics[10] Global $iCurrent_Pic = 1 Global $4 = "C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica21.jpg"; that is my man Global $5 = "C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica2.jpg"; that is the other plates Global $1 = 0 Global $2 = 140 Global $3 = 280 $Form1 = GUICreate("Form1", 420, 420, 190, 121) GUISetBkColor(0x009700) $aPics[0] = GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start $aPics[1] = GUICtrlCreatePic($5, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); there i start $aPics[2] = GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[3] = GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[4] = GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[5] = GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[6] = GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[7] = GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[8] = GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates $aPics[9] = GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)); other plates ;~ For $i = 2 To 9 ;~ GUICtrlSetState($aPics[$i], $GUI_HIDE) ;~ Next GUISetState(@SW_SHOW) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func _Right_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[0] > $2 Then $aPic_Pos[0] = -$2 GUICtrlSetPos($aPics[0], $aPic_Pos[0] + $2, $aPic_Pos[1]) if $11= 1 then msgbox (0,"","") EndFunc Func _Left_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[0] < $2 Then $aPic_Pos[0] = $2 * 3 GUICtrlSetPos($aPics[0], $aPic_Pos[0] - $2, $aPic_Pos[1]) EndFunc Func _Up_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[1] < $3 / 3 Then $aPic_Pos[1] = $3 * 2 - $3 / 2 GUICtrlSetPos($aPics[0], $aPic_Pos[0], $aPic_Pos[1]-$3 / 2) EndFunc Func _Down_Pic() Local $aPic_Pos = ControlGetPos($Form1, "", $aPics[0]) If $aPic_Pos[1] > $3 / 2 Then $aPic_Pos[1] = -$3 / 2 GUICtrlSetPos($aPics[0], $aPic_Pos[0], $aPic_Pos[1] + $3 / 2) EndFunc Link to comment Share on other sites More sharing options...
FireFox Posted December 14, 2008 Share Posted December 14, 2008 (edited) @TheOnlyOne Have you tried with Global function ? Global $nb=0 While 1 Sleep(250) _myfunc() WEnd Func _myfunc() Global $nb=$nb+1 Msgbox(64,"","New number : "&$nb) EndFunc Edited December 14, 2008 by FireFox 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