AutoHotkey Community

It is currently May 26th, 2012, 12:28 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: December 11th, 2008, 5:30 pm 
Offline

Joined: February 9th, 2006, 8:01 pm
Posts: 117
I posted this earlier but forgot to log in... lol

Code:
#SingleInstance Ignore
      Run Uniphi Connect CM05
Loop,
{
   ControlGetText, OutputVar, ThunderRT6TextBox4, Aspect Uniphi Connect

      If OutputVar = Type WrapUp Code, press ENTER
      {
          WinActivate Aspect Uniphi Connect
          Gui, +AlwaysOnTop
          Gui, Font, S24 CDefault Bold, Verdana
         Gui, Add, Text, x6 y0 w310 h40, Get Out of Wrap!
         Gui, Font, S8 CDefault, Verdana
         Gui, Show, x171 y222 h40 w316, You're in Wrap!
         Return
      }

      If OutputVar =  WRAP UP
      {
          WinActivate Aspect Uniphi Connect
          Gui, +AlwaysOnTop
          Gui, Font, S24 CDefault Bold, Verdana
         Gui, Add, Text, x6 y0 w310 h40, Get Out of Wrap!
         Gui, Font, S8 CDefault, Verdana
         Gui, Show, x171 y222 h40 w316, You're in Wrap!
         Return
      }
      Sleep, 120000
}


Basically, I would like it a little more efficiant. Also, it checks the application at 2min intervals... Any ideas on how I could make it check, see that the person is in the wrong state, wait to min, check again, and then warn them?

Also, is there an If/or statement? So I could make that 1 check rather than 2?

Thanks!

P.S. Anyways to make the pop-up window more annoying would be appretiated... blinking or whatever.

[Deleted double post. ~jaco0646]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 6:08 pm 
Offline

Joined: May 25th, 2007, 6:13 pm
Posts: 373
There is an If...Else {search the docs}. As for the "annoying" :wink: you can use:

Code:
Gui, Flash [, Off]


Which is also in the docs. I know it's annoying whenever I see it flashing on the Task Bar.

I'd put something like this:

Code:
#SingleInstance Ignore
      Run Uniphi Connect CM05
Loop,
{
   ControlGetText, OutputVar, ThunderRT6TextBox4, Aspect Uniphi Connect

      If(OutputVar = "Type WrapUp Code, press ENTER", OutputVar =  "WRAP UP")
      {
          WinActivate Aspect Uniphi Connect
          Gui, +AlwaysOnTop
          Gui, Font, S24 CDefault Bold, Verdana
          Gui, Add, Text, x6 y0 w310 h40, Get Out of Wrap!
          Gui, Font, S8 CDefault, Verdana
          Gui, Show, x171 y222 h40 w316, You're in Wrap!

          Gui Flash

          Return
      }

      Sleep, 120000
}


It can probably be done a bit neater, but I'm not all that sophisticated.

Ciao,
Dra'Gon

_________________
Image
For a good laugh {hopefully} >> megamatts.50megs.com

My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 6:15 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
I don't know if it will help your efficiency or not, but I would do what you're wanting using a SetTimer at the appropriate interval and the contents of the Loop as a subroutine.

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 6:57 pm 
Offline

Joined: February 9th, 2006, 8:01 pm
Posts: 117
silveredge78 wrote:
I don't know if it will help your efficiency or not, but I would do what you're wanting using a SetTimer at the appropriate interval and the contents of the Loop as a subroutine.

Could you give me an example? I've not used that before.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 7:02 pm 
Offline

Joined: February 9th, 2006, 8:01 pm
Posts: 117
Dra_Gon wrote:
There is an If...Else {search the docs}. As for the "annoying" :wink: you can use:

Code:
Gui, Flash [, Off]


Which is also in the docs. I know it's annoying whenever I see it flashing on the Task Bar.

I'd put something like this:

Code:
#SingleInstance Ignore
      Run Uniphi Connect CM05
Loop,
{
   ControlGetText, OutputVar, ThunderRT6TextBox4, Aspect Uniphi Connect

      If(OutputVar = "Type WrapUp Code, press ENTER", OutputVar =  "WRAP UP")
      {
          WinActivate Aspect Uniphi Connect
          Gui, +AlwaysOnTop
          Gui, Font, S24 CDefault Bold, Verdana
          Gui, Add, Text, x6 y0 w310 h40, Get Out of Wrap!
          Gui, Font, S8 CDefault, Verdana
          Gui, Show, x171 y222 h40 w316, You're in Wrap!

          Gui Flash

          Return
      }

      Sleep, 120000
}


It can probably be done a bit neater, but I'm not all that sophisticated.

Ciao,
Dra'Gon


For some reason, this doesnt work at all. it never triggers. hmm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2008, 7:02 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
Look at the documention for SetTimer. As for an example, perhaps something like (not tested):

Code:
#SingleInstance Force
#Persistent

SetTimer, VarCheck, 120000
Return

VarCheck:
  ControlGetText, OutputVar, ThunderRT6TextBox4, Aspect Uniphi Connect

  If(OutputVar = "Type WrapUp Code, press ENTER", OutputVar =  "WRAP UP")
  {
    WinActivate Aspect Uniphi Connect
    Gui, +AlwaysOnTop
    Gui, Font, S24 CDefault Bold, Verdana
    Gui, Add, Text, x6 y0 w310 h40, Get Out of Wrap!
    Gui, Font, S8 CDefault, Verdana
    Gui, Show, x171 y222 h40 w316, You're in Wrap!

    Gui Flash

    Return
  }
Return

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 2:58 pm 
Offline

Joined: February 9th, 2006, 8:01 pm
Posts: 117
again, this doesn't seem to detect the state.

Somethings wrong with that IF statement.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 4:55 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
I'm not sure what is wrong with the If. I was merely demonstrating how to use a SetTimer. Best of luck.

Perhaps redo
Code:
If(OutputVar = "Type WrapUp Code, press ENTER", OutputVar =  "WRAP UP")
to
Code:
If (OutputVar = "Type WrapUp Code, press ENTER", OutputVar =  "WRAP UP")
which included a space between the If and the (. Or perhaps
Code:
If ((OutputVar = "Type WrapUp Code, press ENTER") Or (OutputVar =  "WRAP UP"))
which is a compound expression.

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 6:13 pm 
Offline

Joined: May 25th, 2007, 6:13 pm
Posts: 373
Another thing, how did you find out the control you want is "ThunderRT6TextBox4"? If this isn't in an AHK script {Aspect Uniphi Connect} you can use the AU3_Spy.exe to find out EXACTLY what that control is called and what your script needs to look for. This could be the reason your script isn't working.

Put this after your ControlGetText line:
Code:
msgbox, %outputvar%

You will see what you're getting in the Outputvar.

I'm not saying that you need to tell us absolutely everything about your program or what it's used for, but the more info we have, the better we can help you get your script going. Otherwise we'd just have to keep making guesses and that gets a bit old after a while.

Ciao,
Dra'Gon

_________________
Image
For a good laugh {hopefully} >> megamatts.50megs.com

My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 9:16 pm 
Offline

Joined: February 9th, 2006, 8:01 pm
Posts: 117
Dra_Gon wrote:
you can use the AU3_Spy.exe to find out EXACTLY what that control is called and what your script needs to look for.


That's what I did. =)

The script works fine until I try the compound expression. Anyways, this whole things on hold for the moment. The non-fancy version is working for the moment.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Morpheus, SKAN and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group