1hit Posted January 4, 2006 Posted January 4, 2006 (edited) ok im having troubles making the script check if there is a red bar and if there is make it continue the script and if there isnt start the script over heres my script: expandcollapse popup; Script Start - Add your code below here ;---------------------SETUP-------------------------------------------------- Dim $Color_One = 0xD4D2CE;monster color Dim $Color1_tolerance = 4 ;--------------Search Area Coords---------------------------------------------- Dim $Coord1_X = 288 Dim $Coord2_Y = 281 Dim $Coord3_X = 669 Dim $Coord4_Y = 553 ;------------------------------------------------------------------------------- Opt("MouseCoordMode", 0); Read the help file for "Opt" to see if you need to keep the '2' a '2', '1', or '0' Opt("PixelCoordMode", 0); Read the help file for "Opt" to see if you need to keep the '2' a '2', '1', or '0' Hotkeyset("{HOME}","start") Hotkeyset("{END}","stop") Global $stop Func start() WinActivate ( 'SRO_Client' ) Sleep ( 300 ) $stop = NOT $stop While $stop ; Script Start - Add your code below here $coord = PixelSearch($Coord1_X,$Coord2_Y,$Coord3_X,$Coord4_Y, $Color_One, $Color1_tolerance, 1) If Not @error And IsArray($coord) Then Sleep(100) MouseClick("left", $coord[0],$coord[1],1, 0) Sleep(75) If PixelSearch(441,42,608,52,0xFF3131,2,1) == 0xFF3131 then;<<<<this is where i start having troubles Send("1") Sleep(400) EndIf EndIf WEnd EndFunc Func stop() Exit EndFunc While 1 Sleep(50) WEnd help me plz Edited January 5, 2006 by 1hit
greenmachine Posted January 5, 2006 Posted January 5, 2006 (edited) Well, lets see. I read the helpfile, and this is what it said about PixelSearch. PixelSearch Searches a rectangle of pixels for the pixel color provided. Return Value Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y) Failure: Sets @error to 1 if color is not found.That's why. It doesn't return a single value, it returns an array. You used it correctly above, do something like that again. Edited January 5, 2006 by greenmachine
1hit Posted January 5, 2006 Author Posted January 5, 2006 well for some reason it doesnt continie the script and hit 1 it just sits there so i dunno wat is wrong
Moderators SmOke_N Posted January 5, 2006 Moderators Posted January 5, 2006 greenmachine told you what was wrong: If PixelSearch(441,42,608,52,0xFF3131,2,1) == 0xFF3131 then Is wrong... Are you using SciTe? It would show you an error there... Try this: $Coord2 = PixelSearch(441,42,608,52,0xFF3131,2,1) If Not @error And IsArray($Coord2) Then Send("1") Sleep(400) EndIf EndIf WEnd Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
1hit Posted January 5, 2006 Author Posted January 5, 2006 wats scite a script writer? cuz im using notepad lol ok nvm everyone i figured it out
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