Jump to content

how do i do a nonlooping function from my guibutton?


 Share

Recommended Posts

heres my code, the "RuneHq" button is supposed to run only once but i guess AdlibEnable is a function for running loops? can anyone tell me how to make a function that makes it only run once

#include <guiconstants.au3>
$GUI= GUICreate("Right Arrow App", 300, 100, -1, -1, -1)
$ExitId = GUICtrlCreateButton("Exit",20,20,20,20)
$Cliku = GUICtrlCreateButton("Cliku",40,20,50,20)
$ArrowStart = GUICtrlCreateButton("Start",80,20,50,20)
$RuneHq = GuiCtrlCreateButton("RuneHq" ,20,40,70, 20)
GUISetState(@SW_SHOW) 
WinSetOnTop($GUI, "", 1);make GUI stay on top of other windows

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg= $ExitId 
        GUIDelete()
        Exit     
    Case $msg= $Cliku
        MsgBox(0,"Cliku!", "yee")
    Case $msg= $ArrowStart   
        AdlibEnable("_Send", 10000)
    Case $msg= $RuneHq
        AdlibEnable("OpenRqFF" , 10000)
    EndSelect
Wend

Func OpenRqFF()
    Run("firefox.exe")
    MouseClick("left" ,628,622,1,0)
    Send("http://wwww.runehq.com")
EndFunc 
    
Func _Send()
    Send("{right}")
EndFunc
Link to comment
Share on other sites

don't call the function by adlib

#include <guiconstants.au3>
   $GUI= GUICreate("Right Arrow App", 300, 100, -1, -1, -1)
   $ExitId = GUICtrlCreateButton("Exit",20,20,20,20)
   $Cliku = GUICtrlCreateButton("Cliku",40,20,50,20)
   $ArrowStart = GUICtrlCreateButton("Start",80,20,50,20)
   $RuneHq = GuiCtrlCreateButton("RuneHq" ,20,40,70, 20)
   GUISetState(@SW_SHOW) 
   WinSetOnTop($GUI, "", 1);make GUI stay on top of other windows
   
   While 1
       $msg = GUIGetMsg()
       Select
       Case $msg= $ExitId 
           GUIDelete()
           Exit  
       Case $msg= $Cliku
           MsgBox(0,"Cliku!", "yee")
       Case $msg= $ArrowStart   
           AdlibEnable("_Send", 10000)
       Case $msg= $RuneHq
           OpenRqFF()                                   ;  < Like this
       EndSelect
   Wend
   
   Func OpenRqFF()
       Run("firefox.exe")
       MouseClick("left" ,628,622,1,0)
       Send("http://wwww.runehq.com")
   EndFunc  
       
   Func _Send()
       Send("{right}")
   EndFunc
Edited by TalivanIBM
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...