Sign in to follow this  
Followers 0
Doxie

Gui Script is not working?

3 posts in this topic

#1 ·  Posted (edited)

Hi,

I had a nice little script that worked perfectly, and the .exe file is still working.

But now i can´t get the .au3 file to work anymore.

I just reinstalled my computer, and installed a new version of AutoIt, i also read some where that the new version is not working with old scripts, is that correct?

Will i need to remake my script from scratch?

Below you will see my script, and i guess its to long for someone to help me convert it :idiot:

$user = InputBox("ID Check", "Enter the username.", "")
    Opt("TrayIconHide", 1)


Start()
Add()
Search()
Exit

Func Start()
$SD = @ScriptDir & "\"
$ProgTitel = "Inventory Tool v. 0.1"
$ConfigINI = $SD & "Config.ini"
$logo = $SD & "Data\answer.jpg"
$PrgIcon16 = $SD & "Data\lilly.ico"
$UserName = $SD & "test.ini"
$inventory = ($user & ".txt")
$ram = IniRead ( $inventory, "Inventory", "RAM", "")
$model = IniRead ( $inventory, "Inventory", "Model", "")
$ip = IniRead ( $inventory, "Inventory", "IP", "")
$fullname = IniRead ( $inventory, "Inventory", "Full Name", "")
$Ipass = IniRead ( $inventory, "Inventory", "Ipass", "")
$CompName = IniRead ( $inventory, "Inventory", "CompName", "")
$Llogon = IniRead ( $inventory, "Inventory", "Llogon", "")
$admin = IniRead ( $inventory, "Inventory", "Admin", "")
$cpu = IniRead ( $inventory, "Inventory", "Cpu", "")
$c = IniRead ( $inventory, "Inventory", "C:", "")
$d = IniRead ( $inventory, "Inventory", "D:", "")
$SAV = IniRead ( $inventory, "Inventory", "SAV", "")
$PDA = IniRead ( $inventory, "Inventory", "PDA", "")
$Printer = IniRead ( $inventory, "Inventory", "Printer", "")
$SPrint = IniRead ( $inventory, "Inventory", "SPrint", "")
$NDrive = IniRead ( $inventory, "Inventory", "NDrive", "")
$Dept = IniRead ( $inventory, "Inventory", "Dept", "")
$ADSL = IniRead ( $inventory, "Inventory", "ADSL", "")
$Inven = IniRead ( $inventory, "Inventory", "Inventory", "")
$CSerial = IniRead ( $inventory, "Inventory", "Computer Serial", "")
$rdate = IniRead ( $inventory, "Inventory", "Date", "")
$pic = $SD & "Pictures\" & $CompName & ".jpg"
$pic1 = $SD & "Pictures\dummy.jpg"

$ram1 = IniRead ( $inventory, "Inventory", "RAM1", "")
$model1 = IniRead ( $inventory, "Inventory", "Model1", "")
$ip1 = IniRead ( $inventory, "Inventory", "IP1", "")
$CompName1 = IniRead ( $inventory, "Inventory", "CompName1", "")
$cpu1 = IniRead ( $inventory, "Inventory", "Cpu1", "")
$c1 = IniRead ( $inventory, "Inventory", "C:1", "")
$d1 = IniRead ( $inventory, "Inventory", "D:1", "")
$SAV1 = IniRead ( $inventory, "Inventory", "SAV1", "")
$Inven1 = IniRead ( $inventory, "Inventory", "Inventory1", "")
$CSerial1 = IniRead ( $inventory, "Inventory", "Computer Serial1", "")
Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)
GuiCreate($ProgTitel, 522,375,(@DesktopHeight-522)/2, (@DesktopHeight-375)/2 , 0x04CF0000)
$butedit = GuiSetControl("button", "Edit", 455,0,70,20)
GuiSetControlNotify()
$butsearch = GuiSetControl("button", "Search", 385,0,70,20)
GuiSetControlNotify()




$tab_1 = GUISetControl("tab", "Tab 1", 20, 20, 470, 340)
$tabitem_1 = GUISetControl("tabitem", "User Info", 0, 0, 0, 0)
GuiSetControl("label", "UserdID: " & $user, 30,50,260,15)
GuiSetControl("label", "Full Name: " & $fullname, 30,70,260,15)
GuiSetControl("label", "Department: " & $Dept, 30,90,260,15)
GuiSetControl("label", "Last Logon: " & $Llogon, 30,110,260,15)
GuiSetControl("label", "Administrator: " & $admin, 30,130,260,15)
If FileExists($pic) Then
    GuiSetControl("pic", $pic, 30,170)
Else
    GuiSetControl("pic", $pic1, 30,170)
EndIf


$tabitem_2 = GUISetControl("tabitem", "Computer Info", 0, 0, 0, 0)
GuiSetControl("label", "Computer Name: " & $CompName, 30,50,260,15)
GuiSetControl("label", "Model: " & $model, 30,70,260,15)
GuiSetControl("label", "Ram: " & $ram, 30,90,260,15)
GuiSetControl("label", "ClockSpeed: " & $cpu & " Mhz", 30,110,260,15)
GuiSetControl("label", "FreeSpace on C :" & $c & "Mb", 30,130,260,15)
GuiSetControl("label", "FreeSpace on D :" & $d & "Mb", 30,150,260,15)
GuiSetControl("label", "IP: " & $ip, 30,170,260,15)
GuiSetControl("label", "SavDefinitionVersion: " & $SAV, 30,190,260,15)
GuiSetControl("label", "Serial Number: " & $CSerial, 30,210,260,15)
GuiSetControl("label", "Inventory Number: " & $Inven, 30,230,260,15)

GuiSetControl("label", "Computer Name: " & $CompName1, 250,50,200,15)
GuiSetControl("label", "Model: " & $model1, 250,70,200,15)
GuiSetControl("label", "Ram: " & $ram1, 250,90,200,15)
GuiSetControl("label", "ClockSpeed: " & $cpu1 & " Mhz", 250,110,200,15)
GuiSetControl("label", "FreeSpace on C :" & $c1 & "Mb", 250,130,200,15)
GuiSetControl("label", "FreeSpace on D :" & $d1 & "Mb", 250,150,200,15)
GuiSetControl("label", "IP: " & $ip1, 250,170,160,15)
GuiSetControl("label", "SavDefinitionVersion: " & $SAV1, 250,190,200,15)
GuiSetControl("label", "Serial Number: " & $CSerial1, 250,210,200,15)
GuiSetControl("label", "Inventory Number: " & $Inven1, 250,230,200,15)

$tabitem_3 = GUISetControl("tabitem", "Applications", 0, 0, 0, 0)
GuiSetControl("label", "Ipass: " & $Ipass, 30,50,260,15)

$tabitem_4 = GUISetControl("tabitem", "Extra Devices", 0, 0, 0, 0)
GuiSetControl("label", "PDA: " & $PDA, 30,50,260,15)
GuiSetControl("label", "Printer: " & $Printer, 30,70,260,15)
GuiSetControl("label", "ADSL: " & $ADSL, 30,90,260,15)
GuiSetControl("label", "Purshased: " & $rdate, 220,50,260,15)


$tabitem_3 = GUISetControl("tabitem", "Other Info", 0, 0, 0, 0)
GuiSetControl("label", "Standard Printer: " & $SPrint, 30,50,260,15)
GuiSetControl("label", "Network Drives: " & $NDrive, 30,70,90,15)

$test = IniRead (  $inventory, "NetDrives", "Drive 0", 0)
For $i = 0 To $test

$get = IniRead (  $inventory, "NetDrives", "Drive "&$i, 0)
Select
    Case $get == "f:"
        GuiSetControl("label", "F", 130,70,20,15)
    Case $get == "k:"
        GuiSetControl("label", "K", 145,70,20,15)
    Case $get == "l:"
        GuiSetControl("label", "L", 160,70,20,15)
    Case $get == "m:"
        GuiSetControl("label", "M", 175,70,20,15)
    Case $get == "n:"
        GuiSetControl("label", "N", 190,70,20,15)
    Case $get == "o:"
        GuiSetControl("label", "O", 205,70,20,15)
    Case $get == "p:"
        GuiSetControl("label", "P", 220,70,20,15)
    Case $get == "r:"
        GuiSetControl("label", "R", 235,70,20,15)
    Case $get == "t:"
        GuiSetControl("label", "T", 250,70,20,15)
    Case $get == "u:"
        GuiSetControl("label", "U", 265,70,20,15)
    Case $get == "x:"
        GuiSetControl("label", "X", 280,70,20,15)
    Case $get == "v:"
        GuiSetControl("label", "V", 295,70,20,15)
    Case $get == "w:"
        GuiSetControl("label", "W", 310,70,20,15)
    Case $get == "z:"
        GuiSetControl("label", "Z", 325,70,20,15)
    Case Else        
EndSelect
Next









;----------------------------------
$tab_close = GUISetControl("tabitem","",-99,-99,1,1);close tab


GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
        Exit
    Case $msg = 0
      ;;;
    Case $Msg = $butsearch
    Search()
    Case $Msg = $butedit
    $passwd = InputBox("Security Check", "Enter your password.", "", "*")
    If $passwd = "HIDDEN" THEN
    Add()
    Else
    MsgBox(4096, "Security", "Wrong Password!")
    Exit
    EndIf
    Case $msg = $tab_1
      ;;;
    Case $msg = $tabitem_1
      ;;;
    Case $msg = $tabitem_2
      ;;;
    Case $msg = $tabitem_3
      ;;;
    Case $msg = $tabitem_4
      ;;;
    EndSelect
WEnd
EndFunc

;=====================ADD/EDIT==============================
Func Add()
$SD = @ScriptDir & "\"
$ProgTitel = "Inventory Tool v. 0.1"
$ConfigINI = $SD & "Config.ini"
$logo = $SD & "Data\answer.jpg"
$PrgIcon16 = $SD & "Data\lilly.ico"
$UserName = $SD & "test.ini"
$inventory = ($user & ".txt")
$ram = IniRead ( $inventory, "Inventory", "RAM", "")
$model = IniRead ( $inventory, "Inventory", "Model", "")
$ip = IniRead ( $inventory, "Inventory", "IP", "")
$fullname = IniRead ( $inventory, "Inventory", "Full Name", "")
$Ipass = IniRead ( $inventory, "Inventory", "Ipass", "")
$CompName = IniRead ( $inventory, "Inventory", "CompName", "")
$Llogon = IniRead ( $inventory, "Inventory", "Llogon", "")
$admin = IniRead ( $inventory, "Inventory", "Admin", "")
$cpu = IniRead ( $inventory, "Inventory", "Cpu", "")
$c = IniRead ( $inventory, "Inventory", "C:", "")
$d = IniRead ( $inventory, "Inventory", "D:", "")
$SAV = IniRead ( $inventory, "Inventory", "SAV", "")
$PDA = IniRead ( $inventory, "Inventory", "PDA", "")
$Printer = IniRead ( $inventory, "Inventory", "Printer", "")
$SPrint = IniRead ( $inventory, "Inventory", "SPrint", "")
$NDrive = IniRead ( $inventory, "Inventory", "NDrive", "")
$Dept = IniRead ( $inventory, "Inventory", "Dept", "")
$ADSL = IniRead ( $inventory, "Inventory", "ADSL", "")
$Inven = IniRead ( $inventory, "Inventory", "Inventory", "")
$CSerial = IniRead ( $inventory, "Inventory", "Computer Serial", "")
$rdate = IniRead ( $inventory, "Inventory", "Date", "")
$pic = $SD & "Pictures\" & $CompName & ".jpg"
$pic1 = $SD & "Pictures\dummy.jpg"

$ram1 = IniRead ( $inventory, "Inventory", "RAM1", "")
$model1 = IniRead ( $inventory, "Inventory", "Model1", "")
$ip1 = IniRead ( $inventory, "Inventory", "IP1", "")
$CompName1 = IniRead ( $inventory, "Inventory", "CompName1", "")
$cpu1 = IniRead ( $inventory, "Inventory", "Cpu1", "")
$c1 = IniRead ( $inventory, "Inventory", "C:1", "")
$d1 = IniRead ( $inventory, "Inventory", "D:1", "")
$SAV1 = IniRead ( $inventory, "Inventory", "SAV1", "")
$Inven1 = IniRead ( $inventory, "Inventory", "Inventory1", "")
$CSerial1 = IniRead ( $inventory, "Inventory", "Computer Serial1", "")
Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)
GuiCreate($ProgTitel, 522,375,(@DesktopHeight-522)/2, (@DesktopHeight-375)/2 , 0x04CF0000)
$butview = GuiSetControl("button", "View", 455,0,70,20)
GuiSetControlNotify()
$butsave = GuiSetControl("button", "Save", 385,0,70,20)
GuiSetControlNotify()

$tab_1 = GUISetControl("tab", "Tab 1", 20, 20, 470, 340)
$tabitem_1 = GUISetControl("tabitem", "User Info", 0, 0, 0, 0)
GuiSetControl("label", "UserdID: " & $user, 30,50,260,15)
GuiSetControl("label", "Full Name: " & $fullname, 30,70,260,15)
GuiSetControl("label", "Department: ", 30,90,65,15)
GuiSetControl("label", "Last Logon: " & $Llogon, 30,110,260,15)
GuiSetControl("label", "Administrator: " & $admin, 30,130,260,15)
;Add for TAB1
;$EDept = GuiSetControl("input", $Dept, 100,87,110,20)
$EDept = GUISetControl("combo", "Department", 100, 87, 110, 150)
GUISetControlData(-1,"CNS|Corporate Affairs|Critical Care|Finance|Human Resources|IT|Medical Affairs |Hospital|S&M Capabilities|SPC|Training & Development",$Dept)

$tabitem_2 = GUISetControl("tabitem", "Computer Info", 0, 0, 0, 0)
GuiSetControl("label", "Computer Name: " & $CompName, 30,50,260,15)
GuiSetControl("label", "Model: " & $model, 30,70,260,15)
GuiSetControl("label", "Ram: " & $ram, 30,90,260,15)
GuiSetControl("label", "ClockSpeed: " & $cpu & " Mhz", 30,110,260,15)
GuiSetControl("label", "FreeSpace on C :" & $c & "Mb", 30,130,260,15)
GuiSetControl("label", "FreeSpace on D :" & $d & "Mb", 30,150,260,15)
GuiSetControl("label", "IP: " & $ip, 30,170,260,15)
GuiSetControl("label", "SavDefinitionVersion: " & $SAV, 30,190,260,15)
GuiSetControl("label", "Serial Number: ", 30,210,80,15)
GuiSetControl("label", "Inventory Number: ", 30,230,80,15)
;Add for TAB2
$ECSerial = GuiSetControl("input", $CSerial, 100,207,110,20)
$EInven = GuiSetControl("input", $Inven, 100,227,110,20)

$tabitem_3 = GUISetControl("tabitem", "Applications", 0, 0, 0, 0)
GuiSetControl("label", "Ipass: " & $Ipass, 30,50,260,15)

$tabitem_4 = GUISetControl("tabitem", "Extra Devices", 0, 0, 0, 0)
GuiSetControl("label", "PDA: ", 30,50,70,15)
GuiSetControl("label", "Printer: ", 30,72,110,15)
GuiSetControl("label", "ADSL: ", 30,92,110,15)
GuiSetControl("label", "Purshased: ", 220,50,70,15)
;Add for TAB2
;$EPDA = GuiSetControl("input", $PDA, 101,47,110,20)
$EPDA = GUISetControl("combo", "PDA", 101, 47, 110, 150)
GUISetControlData(-1,"Palm|Ipaq 1985|Ipaq 2210|P900",$PDA)

;$EPrinter = GuiSetControl("input", $Printer, 101,69,110,20)
$EPrinter = GUISetControl("combo", "Printer", 101, 69, 110, 150)
GUISetControlData(-1,"K60|K80|710|5110|6110",$Printer)
$EADSL = GuiSetControl("input", $ADSL, 101,89,110,20)
$date_1 = GUISetControl("date", "date4", 290, 47, 140, 20)


$tabitem_3 = GUISetControl("tabitem", "Other Info", 0, 0, 0, 0)
GuiSetControl("label", "Standard Printer: ", 30,50,130,15)
GuiSetControl("label", "Network Drives: " & $NDrive, 30,70,260,15)
;Add for TAB3
;$EPrint = GuiSetControl("input", $SPrint, 121,47,110,20)
$EPrint = GUISetControl("combo", "Printer", 121, 47, 110, 150)
GUISetControlData(-1,"XPPRT001|XPPRT002|XPPRT003|XPPRT004|XPPRT005|XPPRT006|XPPRT007|XPPRT008|XPPRT009|XPPRT010|XPPRT0

11|XPPRT012|XPPRT013|XPPRT014|XPPRT015|XPPRT016|XPPRT017|XPPRT018|XPPRT019",$SPrint)
;----------------------------------
$tab_close = GUISetControl("tabitem","",-99,-99,1,1);close tab


GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
        Exit
    Case $msg = 0
      ;;;
    Case $Msg = $butview
    Start()
    Case $Msg = $butsave
    $PDA = GuiRead($EPDA)
    $Printer = GuiRead($EPrinter)
    $SPrint = GuiRead($EPrint)
    $Dept = GuiRead($EDept)
    $ADSL = GuiRead($EADSL)
    $CSerial = GuiRead($ECSerial)
    $Inven = GuiRead($EInven)
    $rdate = GuiRead($date_1)
    IniWrite($inventory, "Inventory", "PDA", $PDA)
    IniWrite($inventory, "Inventory", "Printer", $Printer)
    IniWrite($inventory, "Inventory", "SPrint", $SPrint)
    IniWrite($inventory, "Inventory", "Dept", $Dept)
    IniWrite($inventory, "Inventory", "ADSL", $ADSL)
    IniWrite($inventory, "Inventory", "Computer Serial", $CSerial)
    IniWrite($inventory, "Inventory", "Inventory", $Inven)
    IniWrite($inventory, "Inventory", "Date", $rdate)
    Case $msg = $tab_1
      ;;;
    Case $msg = $tabitem_1
      ;;;
    Case $msg = $tabitem_2
      ;;;
    Case $msg = $tabitem_3
      ;;;
    Case $msg = $tabitem_4
      ;;;
    EndSelect
WEnd

EndFunc
Exit
=======================Search=================================
Func Search()
$SD = @ScriptDir & "\"
$ProgTitel = "Inventory Tool v. 0.1"
$ConfigINI = $SD & "Config.ini"
$logo = $SD & "Data\answer.jpg"
$PrgIcon16 = $SD & "Data\lilly.ico"
$UserName = $SD & "test.ini"
$inventory = ($user & ".txt")
$ram = IniRead ( $inventory, "Inventory", "RAM", "")
$model = IniRead ( $inventory, "Inventory", "Model", "")
$ip = IniRead ( $inventory, "Inventory", "IP", "")
$fullname = IniRead ( $inventory, "Inventory", "Full Name", "")
$Ipass = IniRead ( $inventory, "Inventory", "Ipass", "")
$CompName = IniRead ( $inventory, "Inventory", "CompName", "")
$Llogon = IniRead ( $inventory, "Inventory", "Llogon", "")
$admin = IniRead ( $inventory, "Inventory", "Admin", "")
$cpu = IniRead ( $inventory, "Inventory", "Cpu", "")
$c = IniRead ( $inventory, "Inventory", "C:", "")
$d = IniRead ( $inventory, "Inventory", "D:", "")
$SAV = IniRead ( $inventory, "Inventory", "SAV", "")
$PDA = IniRead ( $inventory, "Inventory", "PDA", "")
$Printer = IniRead ( $inventory, "Inventory", "Printer", "")
$SPrint = IniRead ( $inventory, "Inventory", "SPrint", "")
$NDrive = IniRead ( $inventory, "Inventory", "NDrive", "")
$Dept = IniRead ( $inventory, "Inventory", "Dept", "")
$ADSL = IniRead ( $inventory, "Inventory", "ADSL", "")
$Inven = IniRead ( $inventory, "Inventory", "Inventory", "")
$CSerial = IniRead ( $inventory, "Inventory", "Computer Serial", "")
$rdate = IniRead ( $inventory, "Inventory", "Date", "")
$pic = $SD & "Pictures\" & $CompName & ".jpg"
$pic1 = $SD & "Pictures\dummy.jpg"

$ram1 = IniRead ( $inventory, "Inventory", "RAM1", "")
$model1 = IniRead ( $inventory, "Inventory", "Model1", "")
$ip1 = IniRead ( $inventory, "Inventory", "IP1", "")
$CompName1 = IniRead ( $inventory, "Inventory", "CompName1", "")
$cpu1 = IniRead ( $inventory, "Inventory", "Cpu1", "")
$c1 = IniRead ( $inventory, "Inventory", "C:1", "")
$d1 = IniRead ( $inventory, "Inventory", "D:1", "")
$SAV1 = IniRead ( $inventory, "Inventory", "SAV1", "")
$Inven1 = IniRead ( $inventory, "Inventory", "Inventory1", "")
$CSerial1 = IniRead ( $inventory, "Inventory", "Computer Serial1", "")
Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)
GuiCreate($ProgTitel, 522,375,(@DesktopHeight-522)/2, (@DesktopHeight-375)/2 , 0x04CF0000)
GuiShow()
$butsearch = GuiSetControl("button", "Search", 385,0,70,20)
GuiSetControlNotify()
GuiSetControl("label", "User ID: ", 30,50,70,15)
$SUser = GuiSetControl("input", "", 101,47,110,20)
$user = GuiRead($SUser)


While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
        Exit
    Case $msg = 0
      ;;;
    Case $Msg = $butsearch
    $user = GuiRead($SUser)
    Start()
    EndSelect
WEnd




EndFunc
Exit
Edited by Doxie

Were ever i lay my script is my home...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Thanks CyberSlug, your tool fixed everything :idiot:

It added something that gave me another error, but i just deleted it, and now it seems to work.

http://www.autoitscript.com/forum/index.php?showtopic=5447

EDIT:

Exept that i have to push the X like 6-7 times to close my app :D

Edited by Doxie

Were ever i lay my script is my home...

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Your commands are outdated, the GUI has changed since you wrote your script. The .exe is not executed by autoit, it is stand alone code.

GUICtrlCreate... is the new syntax instead of GUISetControl

ARGH, your post was right before I started writing... Oh well, you found your problem that's all that matters.

Edited by Wolvereness

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Share this post


Link to post
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
Sign in to follow this  
Followers 0