
Jaccus
Members-
Posts
18 -
Joined
-
Last visited
Jaccus's Achievements

Seeker (1/7)
0
Reputation
-
I can't handle two problems I'm having with my script. 1.) Firstly while working in OnEventMode (to make buttons working) I can't close my GUI using corner button (I have to click on self-made EXIT button). 2.) While GUI is opened my PC is running very slow (at least much slower than without GUI). -------------------------------------- Any help will be appreciated. Thanks Here's my code if it helps. #include <GuiConstants.au3> ;----------------------------------------------------------------------- $TitleSC = "SocksCap Control" $AdresSC = "D:\Progsy\SocksCapV2\sc32.exe" $DirSC = "D:\Progsy\SocksCapV2\" $Username = "***" $Password = "***" $ResizeHeight = 500 $ResizeWidth = 500 $Proxy1Link = $DirSC & "proxy1.txt" $Proxy2Link = $DirSC & "proxy2.txt" $Proxy3Link = $DirSC & "proxy3.txt" $Proxy4Link = $DirSC & "proxy4.txt" $ErrorTitle = "Error" $ErrorExist = "SocksCap window cannot be found." $ProcessSC = "sc32.exe" ;----------------------------------------------------------------------- GuiCreate("SC Proxy Switcher 1.0 (c) 2006 by Jaccus", 160, 180) GuiSetIcon(@SystemDir & "\mspaint.exe", 0) ;----------------------------------------------------------------------- Opt("GUICoordMode",1) Opt("GUIOnEventMode",1) $RunSCButton = GUICtrlCreateButton("RunSC",1,1,60,20) $ResizeSCButton = GUICtrlCreateButton("ResizeSC",1,25,60,20) $ShowSCButton = GUICtrlCreateButton("ShowSC",1,50,60,20) $CloseSCButton = GUICtrlCreateButton("CloseSC",1,75,60,20) $Import1Button = GUICtrlCreateButton("ImportProxy1",65,1,90,20) $Import2Button = GUICtrlCreateButton("ImportProxy2",65,25,90,20) $Import3Button = GUICtrlCreateButton("ImportProxy3",65,50,90,20) $Import4Button = GUICtrlCreateButton("ImportProxy4",65,75,90,20) $ExitButton = GUICtrlCreateButton("EXIT",1,150,60,20) ;----------------------------------------------------------------------- GUICtrlSetOnEvent($RunSCButton,"RunSC") GUICtrlSetOnEvent($ResizeSCButton,"ResizeSC") GUICtrlSetOnEvent($ShowSCButton,"ShowSC") GUICtrlSetOnEvent($Import1Button,"Import1") GUICtrlSetOnEvent($Import2Button,"Import2") GUICtrlSetOnEvent($Import3Button,"Import3") GUICtrlSetOnEvent($Import4Button,"Import4") GUICtrlSetOnEvent($ExitButton,"GuiExit") GUICtrlSetOnEvent($CloseSCButton,"CloseSC") ;----------------------------------------------------------------------- GuiSetState() While 1 $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd ;----------------------------------------------------------------------- ;----------------------------------------------------------------------- Func RunSC() Run($AdresSC,$DirSC) MinimizeSC() If WinExists($TitleSC) Then MinimizeSC() Else WaitForSC() MinimizeSC() EndIf EndFunc Func ResizeSC() If WinExists($TitleSC) Then WinActivate($TitleSC) WinMove($TitleSC,"",0,0,$ResizeWidth,$ResizeHeight) WinSetState($TitleSC,"",@SW_MINIMIZE) Else MsgBox(0,$ErrorTitle,$ErrorExist) EndIf EndFunc Func ShowSC() If WinExists($TitleSC) Then WinActivate($TitleSC) Else MsgBox(0,$ErrorTitle,$ErrorExist) EndIf EndFunc Func WaitForSC() Sleep(200) MouseClick("left",@DesktopWidth/2,@DesktopHeight/2,1) Sleep(100) MouseClick("right",@DesktopWidth/2,@DesktopHeight/2,1) WinWait("SocksCap Username/Password Authentication") Send($Username) Send("{TAB}") Send($Password) Send("{ENTER}") EndFunc Func GuiExit() Exit EndFunc Func MinimizeSC() WinSetState($TitleSC,"",@SW_MINIMIZE) EndFunc Func CloseSC() If ProcessExists($ProcessSC) Then ProcessClose($ProcessSC) Else MsgBox(0,$ErrorTitle,$ErrorExist) EndIf EndFunc Func Import($SettingsLink) If WinExists($TitleSC) Then WinActivate($TitleSC) Send("{ALT}"&"f"&"i"&"{ENTER}"&$SettingsLink&"{ENTER}"&"{ENTER}"&"{ENTER}") MinimizeSC() Else MsgBox(0,$ErrorTitle,$ErrorExist) EndIf EndFunc Func Import1() Import($Proxy1Link) EndFunc Func Import2() Import($Proxy2Link) EndFunc Func Import3() Import($Proxy3Link) EndFunc Func Import4() Import($Proxy4Link) EndFunc
-
As in title. I want to use one function on several minimized windows. When It's in progress on one and I press my function call hotkey on the second window, it stops working on that first one. Any clues how to make this function work with a few windows in the same time? Maybe I did sth wrong? Thanks in advance Regards Jaccus
-
What if my windows are plain inside? Only 'Title Bar' is available to use with WinActivate(). Any more solutions?
-
My problem: Using function WinActivate() for 2 similar windows titles (with window titles like: "window1" and "window10") sometimes activates wrong one. The problem is that the following text is the same (in first 7 letters) and WinActivate() function doesn't use sth like 'case sensitive match' for windows selection. My questions: How to use only 'case sensitive match' for window selection? (if it's possible) If it's not possible, how to solve my problem? Thanks.
-
Reading 1 number from text file to variable in script
Jaccus replied to Jaccus's topic in AutoIt General Help and Support
thank you -
I've got number "1" in file num.txt I'like to read it from this file to a variable. Got this for now (but i recieve number "0" after reading - dunno why): $number= getnum() func getnum() FileOpen("C:\Documents and Settings\JX\Pulpit\num.txt", "r") FileReadLine("num.txt", 1) FileClose("num.txt") EndFunc what's wrong?
-
I want to use one file "num.au3" as a included file to another one. 'num.au3' file contains only 1 line atm: $number=1 and after running script, I'd like this number to increase +1 after each run of this script, so after first run it should be: $number=2 any ideas how to do it? any funcion or variable or whatever else?
-
Using AutoIt to click in specific link at website
Jaccus replied to Jaccus's topic in AutoIt General Help and Support
or just, how to 'make a click' in specific X: Y: coordinates? -
"ALT + N" in SEND(), how to do it?
Jaccus replied to Jaccus's topic in AutoIt General Help and Support
thx Valuater, it seems to work now properly btw. i wanted to close it (to get closing message if i want to save that doc and to choose 'no') but with Your code i can use like File/Close -
"ALT + N" in SEND(), how to do it?
Jaccus replied to Jaccus's topic in AutoIt General Help and Support
i'm begginer yet so maybe my mistake is easy to see in code: http://jaccus.no-ip.org/~jaccus/pic1.jpg it's Polish but i guess no matter if you know how it should looks like. -
"ALT + N" in SEND(), how to do it?
Jaccus replied to Jaccus's topic in AutoIt General Help and Support
Thanks guys but still nothing's happened. Maybe the problem is somewhere else? i've put: WinWaitActive("text") before, to make sure it's correct window but no idea why it still doesn't work...