ecstatic Posted April 12, 2009 Share Posted April 12, 2009 (edited) OK, this is ganna be huge just cut me some slack lmfao.expandcollapse popup$Green = 0x19F00 $Act1Check = 0xFFB2b5 $Act1FirstSquare = 0xFF8A39 $Act1SecondSquare = 0xADCFFF $Act1ThirdSquare = 0xF7C34A $Act1FourthSquare = 0x2161DE $A1Get2 = 0xFF2C00 $A1Get3 = 0x18FF00 $A1get4 = 0xa520FF Func CheckIngameact1() Sleep(7000) $IngameActCheck = PixelSearch(0, 0, 800, 600, $Act1Check) If @error = 0 Then ; Needs to be setup ; MouseClick("right", $IngameActCheck[0], $IngameActCheck[1]) GetOuttaA1Noob() EndIf If @error <> 0 Then CheckIngame() EndIf EndFunc Func GetOuttaA1Noob() ;Set this up asap then incorporate into Func Checkingame() Sleep(500) PixelSearch(0, 0, 800, 600, $Act1FirstSquare) If @Error = 0 Then FileWriteLine($File, "Map Layout: Your in A1 and the layout is act 1 map A" & @HOUR & ":" & @MIN & "." & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR & @LF) Sleep(500) MouseClick("right", $Act1FirstSquare[0], $Act1FirstSquare[1]) EndIf ;Square 2 Scinario Sleep(500) PixelSearch(0, 0, 800, 600, $Act1SecondSquare) If @Error = 0 Then Sleep(500) MouseClick("right", $Act1SecondSquare[0], $Act1SecondSquare[1]) Sleep(500) FileWriteLine($File, "Map Layout: Your in A1 and the layout is act 1 map B" & @HOUR & ":" & @MIN & "." & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR & @LF) EndIf Sleep(500) ;Square 3 Scinario PixelSearch(0, 0, 800, 600, $Act1ThirdSquare) If @Error = 0 Then Sleep(500) MouseClick("right", $Act1ThirdSquare[0], $Act1ThirdSquare[1]) Sleep(500) FileWriteLine($File, "Map Layout: Your in A1 and the layout is act 1 map C" & @HOUR & ":" & @MIN & "." & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR & @LF) EndIf Sleep(500) ;Square 4 Scinario PixelSearch(0, 0, 800, 600, $Act1FourthSquare) If @Error = 0 Then Sleep(500) MouseClick("right", $Act1FourthSquare[0], $Act1FourthSquare[1]) Sleep(500) FileWriteLine($File, "Map Layout: Your in A1 and the layout is act 1 map D" & @HOUR & ":" & @MIN & "." & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR & @LF) EndIf Sleep(1000) ;Now lets bounce PixelSearch(0, 0, 800, 600, $A1Get2) MouseClick("right", $A1Get2[0], $A1Get2[1]) Sleep(1000) PixelSearch(0, 0, 800, 600, $A1Get3) MouseClick("right", $A1Get3[0], $A1Get3[1]) Sleep(1000) PixelSearch(0, 0, 800, 600, $A1Get4) MouseClick("right", $A1Get4[0], $A1Get4[1]) Sleep(1000) MouseClick("Left", 370, 110); Waypoint Selection Sleep(1000) MouseClick("Left", 115, 162); Hoggarth or wtf ever selection Sleep(1000) Walktoportal2() EndFunc Func CheckIngame() Pixelsearch(0, 0, 800, 600, $green) If @error = 0 Then WalkToPortal() FileWriteLine($File, "We sucessfully found out were in act5 and ingame, so were ganna perform our shit now." & @HOUR & ":" & @MIN & "." & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR & @LF) EndIf If @error <> 0 Then FileWriteLine($File, "Warning: You were in act 1, we got you out, but this is a one time pass. Jk. but serously. Like for real." & @HOUR & ":" & @MIN & "." & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR & @LF) GetOuttaA1Noob() EndIf ;walktoportal2() ; EndFuncThere is my code.Im ganna post some pictures to show you what im doing.OK, as you can see the second square of all of them is modded a different color.SO, i have the bot search for which level layout it is by scanning for the first color in 4 different refrences.SO here's how it runs.USER Launches D2 \ Logs in \ Makes Game\ Auto it ------------ 1. Searches for Act 1 Box, (First box) 2. If it finds it, it performs GetOutOfAct1Noob() Which scans for the second box of all the acts to get the layout. 3. Once it finds the map layout, it continues to the 5th level.So whats the problem you may ask?Well when i get to act 1 and the bot is searching for the pixels of the 2nd box (Because im in act 1 and not act 5, (Which is where the green boxes are) it gives me this error: Subscript used with non-Array variable. Diagnosed More-------------------Turns out the problem is like this. My script finds the color, but when it trys to use it i get the Subscript used with non array variable error, on this line MouseClick("right", $Act1FourthSquare[0], $Act1FourthSquare[1]) But it changes the line based on what color the map layout is, so if its 3, then i get the error on line MouseClick("right", $Act1THirdSquare[0], $Act1THirdSquare[1])Terminology-----------------Act 1- Level 1Map Layouts- there are 4 different map layouts, reference the images$Greens = A green box in act 5, a level, which tells us were in the correct act.Sorry for the spam guys haha. Edited April 12, 2009 by ecstatic Link to comment Share on other sites More sharing options...
qazwsx Posted April 12, 2009 Share Posted April 12, 2009 is there a line number with that error? Link to comment Share on other sites More sharing options...
ecstatic Posted April 12, 2009 Author Share Posted April 12, 2009 (edited) Ok i have diagnosed the problem a little more. Say the map layout is 4, (Dark blue square) PixelSearch(0, 0, 800, 600, $Act1FourthSquare) If @Error = 0 Then Sleep(500) MouseClick("right", $Act1FourthSquare[0], $Act1FourthSquare[1]) Sleep(500) FileWriteLine($File, "Map Layout: Your in A1 and the layout is act 1 map D" & @HOUR & ":" & @MIN & "." & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR & @LF) EndIf If @Error <> 0 Then FileWriteLine($File, "Couldnt find map layout." & @HOUR & ":" & @MIN & "." & @SEC & " - " & @MDAY & "/" & @MON & "/" & @YEAR & @LF) CreateFailedGame() EndIf IT finds the color, but cannot click it. It gives me the error: ==> Subscript used with non-Array variable.: In this line: MouseClick("right", $Act1FourthSquare[0], $Act1FourthSquare[1]) Even if i take it out, and just have it autoclick the green square, it still gives me the error. Edited April 12, 2009 by ecstatic Link to comment Share on other sites More sharing options...
qazwsx Posted April 12, 2009 Share Posted April 12, 2009 $Act1FourthSquare is not an array. Look up arrays and pixelsearch. Link to comment Share on other sites More sharing options...
ecstatic Posted April 12, 2009 Author Share Posted April 12, 2009 (edited) LMFAO I got it. For the future i have to $Var it the pixelsearch like so $var = pixelsearch not Pixelsearch Edited April 12, 2009 by ecstatic Link to comment Share on other sites More sharing options...
qazwsx Posted April 12, 2009 Share Posted April 12, 2009 Look in the help file. 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