Gijoe Posted January 8, 2008 Share Posted January 8, 2008 (edited) ok first let me post my code expandcollapse popupGlobal $P HotKeySet("{F5}", "PKMODEON") HotKeySet("{F9}", "Pause") HotKeySet("{end}", "Terminate") $DX=533 $DY=553 Func PKMODEON() Send("{Enter}") Send("PK Mode Turned On") Send("{Enter}") Sleep(100) $P = Not $P While $P Send("{CTRLDOWN}") WEnd EndFunc ;==>PKMODEON Func FalaAuto () $pos = MouseGetPos() MouseMove($DX, $DY, 1) Sleep (300) Send ("{ENTER}") Send ("^V") Send ("{ENTER}") MouseMove ($pos[0], $pos[1], 1) Sleep (100) EndFunc Func Pause () ClipPut("/request on") Call("FalaAuto") Sleep (1000) While 1 Sleep(1) WEnd EndFunc Func Terminate () MsgBox(0, "MyPKBOT") Exit EndFunc While 1 Sleep(1) WEnd when i run this the first time it holds Ctrl down like i want it to. just hit Ctrl again to release it, but i cant hi F5 to get it to hold Ctrl down again. i must stop the code and restart it again for it to work. why does it do that? Edited January 8, 2008 by Gijoe Link to comment Share on other sites More sharing options...
Joon Posted January 8, 2008 Share Posted January 8, 2008 I think your PKMODEON Function should be something like this. Func PKMODEON() $P = Not $P If $P Then Send("{Enter}") Send("PK Mode Turned On") Send("{Enter}") Sleep(100) Send("{CTRLDOWN}") Else Send("{Enter}") Send("PK Mode Turned Off") Send("{Enter}") Sleep(100) Send("{CTRLUP}") EndIf EndFunc Link to comment Share on other sites More sharing options...
rudi Posted January 8, 2008 Share Posted January 8, 2008 Hello, I think you never leave the while loop in your "F5" PK Mode ON function, as once "while $P" is entered, it will never ever again be exited: Func PKMODEON() ConsoleWrite("PK Mode turned ON") Sleep(100) $P = Not $P While $P Send("{CTRLDOWN}") WEnd consolewrite("Left WHILE loop in PK MODE ON") EndFunc ;==>PKMODEON The consolewrite will put output to the botom part or your scite editor. Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Gijoe Posted January 8, 2008 Author Share Posted January 8, 2008 Thanks alot this has been driving me crazy. Never thought of puting in a way to turn it off since when i hit the Ctrl button it would release it. 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