sniper120 Posted July 30, 2009 Posted July 30, 2009 I am making a bot for runescape and need help in detecting when the inventory is full. I have used PixelChecksum but this fails to detect it. Could you help me out thanks! This is the image... The code (please don't steal this code, thanks)... expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=Runescape.ico #AutoIt3Wrapper_outfile=RUN3-B0T.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Allow_Decompile=n #AutoIt3Wrapper_Res_Comment=Run3 B0T #AutoIt3Wrapper_Res_Description=Run3 B0T #AutoIt3Wrapper_Res_Fileversion=0.0.0.5 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;#NoTrayIcon #include<GUIConstants.au3> #include<IE.au3> #include<Misc.au3> #include<GuiComboBox.au3> #Include <Misc.au3> $DESK_HIGHT = @DesktopHeight $DESK_WIDTH = @DesktopWidth $AD_CODE = @CRLF & @CRLF & @CRLF & "--------------------------------------------------" & @CRLF & "http://www.Binary-Dev.x10hosting.com" Global $WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $status, $WS_EX_TOPMOST, $BOT_INFO_GUI, $dll, $continue HotKeySet("{F9}", "Continue") ProgressOn("System Checks", "Checking System...", "0 percent") Sleep(500) ; Internet Explorer If FileExists("C:\Program Files\Internet Explorer\iexplore.exe") = True Then ProgressSet(40, "Internet Explorer Detected") Sleep(500) Else Return_Error(1) EndIf ; Java ™ If FileExists("C:\Program Files\Java\jre6\bin\java.exe") = True Then ProgressSet(70, "Java Detected") Sleep(500) Else Return_Error(1) EndIf ; Finished ProgressSet(100, "System check has completed", "Complete") Sleep(500) ProgressOff() ;$status = @CRLF & "Bot is starting up..." ;ToolTip($status & $AD_CODE, $DESK_WIDTH - 100, $DESK_HIGHT - 30, "Bot Info", 1, 4) Open_IE_Window() WinMove("http://www.runescape.com/?m=0&j=1 - Runescape Game - ", "", -1, -1, $DESK_WIDTH, $DESK_HIGHT) WinSetOnTop("Runescape Game", "", 0) ToolTip("") $status = "Waiting for user login. Press F9 when logged in." ToolTip($status & $AD_CODE, $DESK_WIDTH - 100, $DESK_HIGHT - 30, "Bot Info", 1, 4) Sleep(3000) While $continue = False Sleep(500) WEnd $continue = False ToolTip("") $status = "Please place cursor over object color to gather from and press F9." ToolTip($status & $AD_CODE, $DESK_WIDTH - 100, $DESK_HIGHT - 30, "Bot Info", 1, 4) Sleep(3000) While $continue = False Sleep(500) WEnd $continue = False ToolTip("") $color = PixelGetColor(MouseGetPos(0), MouseGetPos(1)) $first_time = 1 While True $location = PixelSearch(0, 0, $DESK_WIDTH, $DESK_HIGHT, $color, 3, 3) If @error = 1 Then Send("{left}") MouseClick("Left", $location[0], $location[1]) Sleep(20000) If $first_time = 1 Then $status = "Please place cursor over game space (where you click to move) then press F9. Do the same to the other corner." ToolTip($status & $AD_CODE, $DESK_WIDTH - 100, $DESK_HIGHT - 30, "Bot Info", 1, 4) While $continue = False Sleep(500) WEnd $continue = False $game_x1 = MouseGetPos(0) $game_y1 = MouseGetPos(1) While $continue = False Sleep(500) WEnd $continue = False $game_x2 = MouseGetPos(0) $game_y2 = MouseGetPos(1) ToolTip("") $status = "Please place cursor over object color in your invitory. Please press F9 after." ToolTip($status & $AD_CODE, $DESK_WIDTH - 100, $DESK_HIGHT - 30, "Bot Info", 1, 4) While $continue = False Sleep(500) WEnd $continue = False ToolTip("") $invintory_item = PixelGetColor(MouseGetPos(0), MouseGetPos(1)) $status = "Please place cursor over the center of the last object spot in your invintory then press F9." ToolTip($status & $AD_CODE, $DESK_WIDTH - 100, $DESK_HIGHT - 30, "Bot Info", 1, 4) While $continue = False Sleep(500) WEnd $continue = False ToolTip("") $mouse_x = MouseGetPos(0) - 3 $mouse_y = MouseGetPos(1) - 3 $last_spot = PixelChecksum($mouse_x, $mouse_y, 10, 10) EndIf $first_time = 0 $location = PixelSearch($game_x1, $game_y1, $game_x2, $game_y2, $color, 3, 3) If @error = 1 Then Send("{left}") MouseClick("Left", $location[0], $location[1]) Sleep(20000) If $last_spot <> PixelChecksum($mouse_x, $mouse_y, 12, 12) Then MsgBox(0, "Run3 B0t", "Invintory is full.") WEnd MsgBox(0, "INF0", "Bot Closed") ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Func Return_Error($error_code) MsgBox(0, "Run3-B0T", "The program has encounted error " & $error_code & ", and needs to close. Please check that your computer is running with Java ™.") Exit EndFunc ;==>Return_Error Func Open_IE_Window() $oIE1 = _IECreate("http://www.runescape.com/game.ws?m=0&j=1", 0, 1) $oIE1.AddressBar = 0 $oIE1.MenuBar = 0 $oIE1.StatusBar = 0 $oIE1.ToolBar = 0 ;$oIE1.Fullscreen = 1 $uID1 = Random(1000, 100000000) $oIE1.document.Title = "Runescape Game" WinWait($uID1, "", 5) ;$hoIE1 = WinGetHandle($uID1) ;$pid1 = WinGetProcess ($hoIE1) EndFunc ;==>Open_IE_Window Func Continue () $continue = True EndFunc Thanks for your help!
Splash Posted July 30, 2009 Posted July 30, 2009 You don't are changing the window position every time that start the game? Automatic Update UDF - IP Address UDF - WinPcap AutoIt _FindDevice()[font="Verdana"][size="2"]AutoIt Spanish/Brasil/World community!!![/size][/font]Use you wanna a dot.tk domain please use my link:
Lithium Posted July 31, 2009 Posted July 31, 2009 (edited) You might want to remove your name from that screenshot... >_< Also if your not moving the browser window or scrolling down then you should have no problems with adding in a PixelGetColor and then comparing that received colour to the normal inventory colour. However, if you are changing from between mem and non mem worlds then that won't work (due to the ad not being there). I'm only a newb when it comes to Autoit and judging by your code you're probably more experienced at this than me. Hope it helps Edited July 31, 2009 by Lithium
bogQ Posted July 31, 2009 Posted July 31, 2009 Parameters left left coordinate of rectangle. top top coordinate of rectangle. right right coordinate of rectangle. bottom bottom coordinate of rectangle.try like this PixelChecksum($mouse_x, $mouse_y,$mouse_x+10,$mouse_y+10) TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
sniper120 Posted July 31, 2009 Author Posted July 31, 2009 try like this PixelChecksum($mouse_x, $mouse_y,$mouse_x+10,$mouse_y+10) I will try this, thanks! >_<
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