Kero Posted August 10, 2006 Posted August 10, 2006 (edited) Here is part of my code of two functions. For some reason, the while loop freezes inside a full screened game unless I minimize the game. Func CheckLogin() $login = "-1" While $login <> "0" MouseClick("left",731,53) MouseClick("left",0,0) If CheckLogin2()="1" Then MouseClick("left",680,683) StartGame() $login = "0" ElseIf CheckLogin2()="2" Then Send("{ENTER}{ENTER}") ElseIf CheckLogin2()="3" Then MouseClick("left",680,683) StartGame() $login = "0" ElseIf CheckLogin2()="4" Then SelectCharacter() $login = "0" EndIf WEnd EndFunc Func CheckLogin2() If PixelChecksum(558,490,598,508,1)="3517004610" Then Return 1 ElseIf PixelChecksum(0,911,89,945)="166012633" Then Return 2 ElseIf PixelChecksum(0,911,89,945)="976319356" Then Return 3 ElseIf PixelChecksum(99,120,99,120)="45220162" Then Return 4 EndIf EndFunc Edited August 10, 2006 by Kero
Bert Posted August 10, 2006 Posted August 10, 2006 have you tried using Opt("TrayIconDebug", 1) to see where it gets stuck? The Vollatran project My blog: http://www.vollysinterestingshit.com/
Kero Posted August 10, 2006 Author Posted August 10, 2006 i tried adding Opt("TrayIconDebug", 1) in the beginning of the program, it does nothing.
Bert Posted August 10, 2006 Posted August 10, 2006 when the window is full screen, do you still have the start bar, or is it hidden? If it is hidden, you may need to debug by writting to console to see what is happening. The Vollatran project My blog: http://www.vollysinterestingshit.com/
Kero Posted August 10, 2006 Author Posted August 10, 2006 when the window is full screen, do you still have the start bar, or is it hidden? If it is hidden, you may need to debug by writting to console to see what is happening.I see no bar. I made a GUICtrlCreateEdit that output things I wrote in the program. The problem I found is that the while loop freezes until I focus that GUICtrlCreateEdit window.
Bert Posted August 10, 2006 Posted August 10, 2006 (edited) I'm thinking outside the box here, but is it possible to have the output written to a text file, and each time a line is written, a time stamp is done at the beginning of the line. This way you could see where it hangs without the window issue messing you up in debuging. Edited August 10, 2006 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/
Kero Posted August 10, 2006 Author Posted August 10, 2006 (edited) I changed this a bit of the code, it still seems to freeze unless I press the gui window. expandcollapse popupFunc CheckLogin() $login = "-1" While $login <> 0 Addstatus("Checking Login") $login = CheckLogin2() If $login="1" Then MouseClick("left",680,683) StartGame() $login = "0" ElseIf $login="2" Then Send("{ENTER}{ENTER}") ElseIf $login="3" Then MouseClick("left",680,683) StartGame() $login = "0" ElseIf $login="4" Then SelectCharacter() $login = "0" EndIf WEnd EndFunc Func CheckLogin2() AddStatus("CheckLogin2()") If PixelChecksum(558,490,598,508,1)="3517004610" Then AddStatus("1") Return 1 ElseIf PixelChecksum(0,911,89,945)="166012633" Then AddStatus("2") Return 2 ElseIf PixelChecksum(0,911,89,945)="976319356" Then AddStatus("3") Return 3 ElseIf PixelChecksum(99,120,99,120)="45220162" Then AddStatus("4") Return 4 Else AddStatus("-1") Return -1 EndIf EndFunc Edited August 11, 2006 by Kero
Kero Posted August 10, 2006 Author Posted August 10, 2006 could it be possible the checksum is slow because it is under full screen?
jonathan2133 Posted August 10, 2006 Posted August 10, 2006 try using message boxes at intervals... if possable... i didnt really go through all your code i dont have time, but thats what i do, or make tooltips... like i did with this nifty prog... do $pos = MouseGetPos() $color = PixelGetColor ( $pos[0] , $pos[1] ) ToolTip ( $pos[0] & "," & $pos[1] & @LF & $color );, $pos[0] , $pos[1] ) until 1 = 2 Just shows the mouse pos and color, but you get the idea. Anyways, i really need to get going, but i hope this helps...
julmae Posted August 10, 2006 Posted August 10, 2006 (edited) heh, aonlan i guess ? 8) anyways its pretty hard to say just w/ partial code. i could help you out if your willing to give me your source, as i dont have anything better to do atm (: if no, then you should use msgboxes / tooltips to find out where it stucks as suggested above. :edit played around a bit, this wont get stuck unless all pixelchecksums are different from set values or SelectCharacter/StartGame funcs are stuck 8) expandcollapse popupMsgBox(0, "test", CheckLogin()) Func CheckLogin() Local $Login Local $Return While 1 MouseClick("left",731,53) MouseClick("left",0,0) $Login = CheckLogin2() Select Case $Login = 1 MouseClick("left",680,683) StartGame() $Return = "StarGame func executed, $Login was = " & $Login ExitLoop Case $Login = 2 Send("{ENTER}{ENTER}") Case $Login = 3 MouseClick("left",680,683) StartGame() $Return = "StarGame func executed, $Login was = " & $Login ExitLoop Case $Login = 4 SelectCharacter() $Return = "SelectCharacter func executed, $Login was = " & $Login ExitLoop Case Else Sleep(100); CheckLogin2 returned 0, PixelChecksums <> set values EndSelect WEnd Return $Return EndFunc Func CheckLogin2() Select Case PixelChecksum(558, 490, 598, 508, 1) = "3517004610" Return 1 Case PixelChecksum(0, 911, 89, 945) = "166012633" Return 2 Case PixelChecksum(0, 911, 89, 945) = "976319356" Return 3 Case PixelChecksum(99, 120, 99, 120) = "45220162" Return 4 Case Else Return 0 EndSelect EndFunc Edited August 10, 2006 by julmae
Buckw1 Posted August 11, 2006 Posted August 11, 2006 Whats the game? If screen colors are nop exactly the same each time then pixelchecksum will fail and thus a endless loop. What is addstatus?
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