Jump to content

Just alittle help please


Gijoe
 Share

Recommended Posts

ok first let me post my code

Global $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 by Gijoe
Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...