pepsip77 Posted March 17, 2012 Share Posted March 17, 2012 Hello, recently i've started codin in Autoit and I met some problems. I want to make bot, that checks 4 spaces for equal pixels, and if all pixels found it continues work. ButI'm gettin problems, while starting program. Help please expandcollapse popuphotkeyset("{F5}","start") hotkeyset("{F6}","stop") While 1 sleep(100) WEnd Global $On=0 Func start() while 1 $pixel1 = PixelSearch(867,343,889,359, 0x7F7B76) $pixel2 = PixelSearch(908,343,930,359, 0x0165B5E) $pixel3 = PixelSearch(949,343,971,359, 0x7F7B76) $pixel4 = PixelSearch(990,343,1012,359, 0x0165B5E) $knife = PixelSearch(995,559,1009,575, 0x79706F) $shaft = PixelSearch(388,533,411,563, 0x583509) $x10 = PixelSearch(335,567,413,577, 0xEEE5C6) $tree = PixelSearch(305,127,817,459, 0x78804F) If IsArray($pixel1) = True Then MouseMove($pixel1 [0], $pixel1 [1],1) MouseClick('left',$pixel1 [0], $pixel1 [1],1) $On=$On + 1 Sleep(20) EndIf If IsArray($pixel2) = True Then MouseMove($pixel2 [0], $pixel2 [1],1) MouseClick('left',$pixel2 [0], $pixel2 [1],1) $On=$On + 1 Sleep(20) EndIf If IsArray($pixel3) = True Then MouseMove($pixel3 [0], $pixel3 [1],1) MouseClick('left',$pixel3 [0], $pixel3 [1],1) $On=$On + 1 Sleep(20 EndIf If IsArray($pixel4) = True Then MouseMove($pixel4 [0], $pixel4 [1],1) MouseClick('left',$pixel4 [0], $pixel4 [1],1) $On=$On + 1 Sleep(20) EndIf If $On=4 Then MouseMove($knife [0], $knife [1],1) MouseClick('left',$knife [0], $knife [1],1) Sleep(600) MouseMove($pixel1 [0], $pixel1 [1],1) MouseClick('left',$pixel1 [0], $pixel1 [1],1) Sleep(800) MouseMove($shaft [0], $shaft [1],1) MouseClick('right',$shaft [0], $shaft [1],1) MouseMove($x10 [0], $x10 [1],1) MouseClick('left',$x10 [0], $x10 [1],1) EndIf WEnd EndFunc Func stop() Exit EndFunc Link to comment Share on other sites More sharing options...
guinness Posted March 17, 2012 Share Posted March 17, 2012 If this is for a game then my advice would be to read the Forum Rules first. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Developers Jos Posted March 17, 2012 Developers Share Posted March 17, 2012 Topic closed SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts