crovax Posted March 4, 2007 Share Posted March 4, 2007 expandcollapse popupFunc takefirst() MouseClick("primary" , 532, 133, 1, 20 ); take first card sleep(500) MouseClick("primary" , 532, 133, 1, 20 ); take second card, then check if you got 2 of the same card sleep(1000) Execute(samecardcheck()) EndFunc Func samecardcheck() $morethan1card = PixelSearch( 191,154,191,154, 0xFFFF00) If Not @error Then Mouseclick("primary" , 623,159, 1, 20 ); click to the next card over sleep(400) If @error Then Execute(takefirst()) Execute(cardchecktwo()) ; this is where u need to find the new yellow and check for the 2 again, if not @error, then, else! remember EndIf EndIf Mouseclick("primary" , 623,159, 1, 20 ); click to the next card over sleep(400) Execute(cardchecktwo()) ; this is where u need to find the new yellow and check for the 2 again, if not @error, then, else! remember Endfunc Func cardchecktwo() $two = PixelSearch( 191,236, 191,236, 0xFFFF00) If not @error Then Mouseclick("Primary" , 712, 174, 1, 20 ) sleep(100) Mouseclick("Primary" , 712, 174, 1, 20 ) $morethan1card = PixelSearch( 191,154,191,154, 0xFFFF00) If @error Then Execute( takefirst()) Else Execute( fiveforone() ) EndIf EndIf Func fiveforone() $5cards = Pixelsearch(207, 301, 207, 301, 0xFFFFFF) While $5cards = Pixelsearch(207, 301, 207, 301, 0xFFFFFF); the number of cards you have taken is 5. If not @error Then EXECUTE(Confirmtrade()) If @error Then Mouseclick("primary" , 189,231, 1, 20) EndIf EndIf WEnd EndFunc Ok, a jumble I know, but this is only my first script, so bear with me. What I am trying to do is take 2 cards, then Pixelsearch for the yellow number that would appear if I had picked 2 identical cards, when it clicks to the next card over, the first yellow number moves up, The function cardchecktwo() is supposed to find out if after taking 2 more cards if it grabbed 2 identical cards, if thats the case, it moves to the next card over, selects two again, and runs cardchecktwo() (The second Yellow number will always be in the same place) to see if the 3rd set of cards chosen were identical to each other. This part has some minor(I hope) glitches(it does, however recognize the first yellow two and move on), it will occasionally return to the first card, or second card, or even 3rd card in the series of cards I'm trying to take. After I have 5 or more cards, I am trying to get it to recognize the number of cards I am obtaining to make sure it is 5, (fiveforone()) no more no less, If it doesnt notice the White 5, I want it to either add cards, or remove them from trade until it recognizes the White 5, then Continue the script. I know its alot, but any input that could be helpful would be greatly appreciated. Link to comment Share on other sites More sharing options...
nfwu Posted March 4, 2007 Share Posted March 4, 2007 (edited) For starters: 1) Stuff like this: Execute(takefirst()) Execute(cardchecktwo()) oÝ÷ Ù(hºW[{ â¶×§)¶¬jëh×6 takefirst() cardchecktwo() 2) There are several End* statements in the above code snippet that are not correctly placed. Wend without While ENdIf without If Func without EndFunc 3)Topic titles like this: Some minor(major?) Help Requested.., Brought code..a monster...Will not attract much attention. Please use more discriptive titles. (Dial-up users hate loading stuff which they don't want to read.) #) Edited March 4, 2007 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() 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