iras77 Posted June 18, 2007 Share Posted June 18, 2007 (edited) Hi. Could enyone help modify my bot? I would like to add one function in the code below... This function cleans my iventory but some of cells are empty and there is no need to drop items from them (it takes time). Is there any chance to add simple pixel checker wich check if the cell is empty or not. If it is empty the bot should skip it and check another one. If the color is correct it mean the cell is empty if not the cell should be cleaned. Thanks for any sugestions and help. expandcollapse popupFunc ClearInventory() $angle = GuiCtrlRead($ComboAngle) If GuiCtrlRead($ComboRes) = "1024x768" Then $myX = 988 $myY = 364 if $angle = "Right" then $myX2 = 690 $myY2= 735 else $myX2 = 256 $myY2= 750 endif $varX = 32 $varY = 33 ElseIf GuiCtrlRead($ComboRes) = "1280x1024" Then $myX = 1240 $myY = 475 if $angle = "Right" then $myX2 = 860 $myY2= 970 else $myX2 = 320 $myY2= 1000 endif $varX = 41 $varY = 44 Else ;800x600 & etc $myX = 775 $myY = 293 if $angle = "Right" then $myX2 = 540 $myY2= 568 else $myX2 = 200 $myY2= 568 endif $varX = 25 $varY = 25 EndIf $cols = GuiCtrlRead($ComboCols) $rows = GuiCtrlRead($ComboRows) Send("{v}") ; open inventory Sleep(100) $myX3 = $myX $myY3 = $myY For $x = 1 to $cols For $y = 1 to $rows MouseMove($myX3, $myY3) ; (1) the most ight-down space************** Sleep(100) ; in this place bot should check if the cell is empty or not MouseDown("Left") ; skip if the color is correct, execute if not Sleep(50) ; skip if the color is correct, execute if not MouseUp("Left") ; skip if the color is correct, execute if not Sleep(50) ; skip if the color is correct, execute if not MouseMove($myX2, $myY2) ; skip if the color is correct, execute if not Sleep(50) ; skip if the color is correct, execute if not Send ("{SHIFTDOWN}") ; skip if the color is correct, execute if not MouseDown("Left") ; skip if the color is correct, execute if not Sleep(50) ; skip if the color is correct, execute if not MouseUp("Left") ; skip if the color is correct, execute if not Send ("{SHIFTUP}") ; skip if the color is correct, execute if not Sleep(50) ; skip if the color is correct, execute if not $myY3 = $myY3 + $varY next ; this is another cell $myX3 = $myX3 - $varX $myY3 = $myY $y = 1 next Send("{v}") ; close inventory Sleep(100) Send("{d}") ; security,:P Sleep(100) Send("{d}") ; in case, ur net speed is lag. these can make sure your inventory close Sleep(100) EndFunc Edited June 18, 2007 by iras77 Link to comment Share on other sites More sharing options...
cageman Posted June 18, 2007 Share Posted June 18, 2007 you could check the color using $color=pixelgetcolor() and then use If $color=22323 endif Link to comment Share on other sites More sharing options...
Valuater Posted June 18, 2007 Share Posted June 18, 2007 I am not sure about your actions "Clean, empty, etc" but this might helpGameBot Builder8) 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