walle Posted June 2, 2007 Posted June 2, 2007 (edited) Can't get my script to work properly, or as it was planned.Here is what it should do/ I want it to do...1. Check if the file (C:\temp\burnbuddy.ini exsist), If it does, then continue with the func "Start"2. If the file dosn't exsist, then start the func "Filefolder", finish that func and then continue with func "Start"What it do now: *If Burnbuddy.ini dosn't exsist, then it starts func Filefolder(),finish that and exit. *If Burnbuddy.ini exsist, then it stopps on Line:47, Send($mapp), Can't find variable.Any idea? expandcollapse popup;#include "TrayGetMsg.au3" Opt("WinTitleMatchMode", 2) ; 2 = Match any substring in the title If FileExists("C:\Temp\Burnbuddy.ini") Then Start() Else FileFolder() EndIf Func Start() Select Case DriveStatus( "e:\" ) = "NOTREADY" MsgBox(0, "", "Vad god sätt in en DVDR skiva") CDTray("E:", "open") MsgBox(0, "", "Läs in skiva?") CDTray("E:", "close") EndSelect blockinput(1) Select Case ProcessExists("µTorrent 1.6.1") = 0 Run("D:\program\utorrent[1].exe", "D:\Program\", @SW_MINIMIZE) EndSelect Sleep("2000") ControlClick("µTorrent 1.6.1", "", "[CLASS:SysListView32; INSTANCE:1]", "right", 1, 100, 31) ControlSend("µTorrent 1.6.1", "", "[CLASS:SysListView32; INSTANCE:1]", "{down 15}{enter}") ControlClick("Torrentegenskaper", "", "[CLASS:SysTabControl32; INSTANCE:1]", "left", 1, 81, 11) ControlClick("Torrentegenskaper", "", "[CLASS:Edit; INSTANCE:1]", "left", 1, 180, 7) sleep("1000") ControlSend("Torrentegenskaper", "", "[ID:1001]", "c:\windows\system32\notepad.exe") ControlClick("Torrentegenskaper", "", "[CLASS:Button; INSTANCE:12]", "left", 1, 38, 12) Blockinput(0) WinWaitActive("- Notepad") Blockinput(1) Sleep("1000") Winclose("- Notepad") ControlClick("µTorrent 1.6.1", "", "[CLASS:SysListView32; INSTANCE:1]", "right", 1, 100, 31) ControlSend("µTorrent 1.6.1", "", "[CLASS:SysListView32; INSTANCE:1]", "{Down}{Enter}") Blockinput(1) sleep("2000") Send("{down}{enter}") Blockinput(0) Winwaitactive("WinRAR") Sleep("1000") Winwaitactive("Please purchase WinRAR license") ControlClick("Please purchase WinRAR license", "", "[CLASS:Button; INSTANCE:3]", "left", 1, 49, 11) Blockinput(1) Send("{alt}{right}{down 2}{enter}") $mapp = IniRead("C:\Temp\Burnbuddy.ini", "Section1", "IMGMAPP", "NotFound") Send($mapp) Blockinput(0) Sleep("100000") ControlClick("Uppackning sökväg och valmöjligheter", "", "[CLASS:Button; INSTANCE:16]", "left", 1, 31, 11) Opt("WinTitleMatchMode", 2) ; 2 = Match any substring in the title WinWaitClose(".rar - WinRAR") WinClose("WinRAR") send("#r") WinWaitActive("Run") Blockinput(1) Send($mapp) Blockinput(0) ControlClick("Run", "", "[CLASS:Button; INSTANCE:2]", "left", 1, 41, 14) Sleep("2000") Winwaitactive("IMG") ControlClick("IMG", "", "[CLASS:SysListView32; INSTANCE:1]", "left", 2, 32, 32) WinWaitActive("ImgBurn") sleep("2000") ControlClick("ImgBurn", "", "[CLASS:TPanel; INSTANCE:1]", "left", 1, 147, 292) MsgBox(0, "Burnbuddy", "Bränning är klar!") EndFunc Func FileFolder() $var = FileSelectFolder("Välj en mapp där .IMG filen läggs tillfälligt.", "") IniWrite("C:\Temp\Burnbuddy.ini", "Section1", "IMGMAPP", $var) $mapp = IniRead("C:\Temp\Burnbuddy.ini", "Section1", "IMGMAPP", "NotFound") MsgBox(4096, "Vald Mapp", $mapp) $Var1 = InputBox("","Beteckning på brännare", "", "") IniWrite("C:\Temp\Burnbuddy.ini", "Section2", "Burner", $var1) $Burner = IniRead("C:\Temp\Burnbuddy.ini", "Section2", "Burner", "NotFound") EndFunc Edited June 2, 2007 by walle
Uten Posted June 2, 2007 Posted June 2, 2007 You dont fall through the code an d into a function so add a call in your logic. If FileExists("C:\Temp\Burnbuddy.ini") Then Start() Else FileFolder() Start() EndIf Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
Bench Posted June 2, 2007 Posted June 2, 2007 If Not FileExists("C:\Temp\Burnbuddy.ini") Then FileFolder() EndIf Start() [right]Software is like sex - it's better when it's free. (Linus Torvalds)[/right]
walle Posted June 3, 2007 Author Posted June 3, 2007 Thanks for the replys.. Got it to work If FileExists("C:\Temp\Burnbuddy.ini") Then Start() Else FileFolder() Start() EndIf
Glyph Posted June 3, 2007 Posted June 3, 2007 (edited) *If Burnbuddy.ini dosn't exsist, then it starts func Filefolder(),finish that and exit. if not fileexists("Burnbuddy.ini")then Filefolder() exit endif Edited June 3, 2007 by backstabbed tolle indicium
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now