Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

my app was working but stopped...?

$
0
0
Afternoon All,

I have a weird problem, my app script that I wrote was working but now isn't and throws an error :

Line 796 (blah...)

Error Subscript used with non-array variable.

the compile didn't pick it up and i've checked through and can't see anything obvious.

can someone check it over, just to prove I'm not going mad...

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=ico\people.ico
#AutoIt3Wrapper_Outfile=USRinFO.exe
#AutoIt3Wrapper_Res_Description=Display user info
#AutoIt3Wrapper_Res_Fileversion=1.0.0.5
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=Richard Easton
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Author:		 Richard Easton
Script Function:
USER inFO.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;desktop metrics
$h = @DesktopHeight - 500
$w = @DesktopWidth - 300
;usr details
$usr = @UserName
$hd = @HomeDrive
$hp = @HomePath
$hs = @HomeShare
;local info
$cn = @ComputerName
$os = @OSArch
;network info
$ld = @LogonDomain
$ls = @LogonServer

$regvar = Regread("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "USRinFO")
if $regvar = @error Then
regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "USRinFO", "REG_SZ", '"' & @Scriptdir & '\USRinFO.exe"')
EndIf

opt("MustDeclareVars", 0)
Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.
Opt("TrayOnEventMode", 1) ;
TrayCreateItem("Display")
TrayItemSetOnEvent(-1, "Show")
TrayCreateItem("")
TrayCreateItem("About")
TrayItemSetOnEvent(-1, "about")

;gui
$USRinFO = GUICreate("USRinFO: " & $usr, 260, 450, $w, $h, $WS_EX_TOPMOST)
GUICtrlCreateGroup(" User Details ", 8, 8, 240, 120)
;users logon name
GUICtrlCreateLabel("Username:", 16, 30, 55, 17)
GUICtrlCreateLabel($usr, 80, 30, 100, 17)
;computer name
GUICtrlCreateLabel("PC Name:", 16, 48, 60, 17)
GUICtrlCreateLabel($cn, 80, 48, 100, 17)
;path to user home directory
GUICtrlCreateLabel("HomeDrive:", 16, 66, 60, 17)
GUICtrlCreateLabel($hd, 80, 66, 200, 17)
GUICtrlCreateLabel("Homepath:", 16, 84, 60, 17)
GUICtrlCreateLabel(StringMid($hp & $hs, 2), 80, 84, 200, 17)
GUICtrlCreateLabel("Size used:", 16, 104, 60, 17)
$dirsize = DirGetSize($hd, 1)
;$total = DriveSpaceTotal($hd)
;
If $dirsize[0] > 1000000000 Then
$p = $dirsize[0] / 1024 / 1024 / 1024
GUICtrlCreateLabel(Round($p, 2) & " GB", 80, 104, 100, 17)
Else
$p = ($dirsize[0] / 1024 / 1024)
GUICtrlCreateLabel(Round($p, 2) & " MB", 80, 104, 100, 17)
EndIf
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup(" Network Details ", 8, 150, 240, 90)
;logon domain
GUICtrlCreateLabel("Domain:", 16, 172, 60, 17)
GUICtrlCreateLabel($ld, 80, 172, 100, 17)
;logon server
GUICtrlCreateLabel("Server:", 16, 190, 60, 17)
GUICtrlCreateLabel($ls, 80, 190, 100, 17)
;endgroup
GUICtrlCreateGroup("", -99, -99, 1, 1)
;Google controls
GUICtrlCreateGroup(" Google Apps ", 8, 300, 240, 65)
$gmail = GUICtrlCreateButton("gmail", 16, 320, 36, 36, $BS_ICON + $BS_FLAT)
GUICtrlSetImage($gmail, @ScriptDir & "\g-mail.ico", 1)
$gcal = GUICtrlCreateButton("gcal", 53, 320, 36, 36, $BS_ICON + $BS_FLAT)
GUICtrlSetImage($gcal, @ScriptDir & "\gcal.ico", 1)
$gdrv = GUICtrlCreateButton("gdrive", 90, 320, 36, 36, $BS_ICON + $BS_FLAT)
GUICtrlSetImage($gdrv, @ScriptDir & "\drive.ico", 1)
$gsch = GUICtrlCreateButton("gsearch", 127, 320, 36, 36, $BS_ICON + $BS_FLAT)
GUICtrlSetImage($gsch, @ScriptDir & "\gsearch.ico", 1)
If $os = "x86" Then
If FileExists("C:\Program Files\SIMS\SIMS .net\Pulsar.exe") Then
$sims = GUICtrlCreateButton("SIMS", 164, 320, 36, 36, $BS_ICON + $BS_FLAT)
GUICtrlSetImage($sims, @ScriptDir & "\sims.ico", 1)
EndIf
ElseIf $os = "x64" Then
If FileExists("C:\Program Files (x86)\SIMS\SIMS .net\Pulsar.exe") Then
$sims = GUICtrlCreateButton("SIMS", 164, 320, 36, 36, $BS_ICON + $BS_FLAT)
GUICtrlSetImage($sims, @ScriptDir & "\sims.ico", 1)
EndIf
EndIf
GUICtrlCreateGroup("", -99, -99, 1, 1)

;button controls
$mininmize = GUICtrlCreateButton("Minimize", 8, 380, 80, 30)
$homedir = GUICtrlCreateButton("Home Dir", 90, 380, 80, 30)
GUISetState(@SW_SHOWMINIMIZED)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $mininmize
GUISetState(@SW_MINIMIZE, $USRinFO)
Case $homedir
Run("explorer.exe " & $hd, @SystemDir)
Case $gmail
If @OSArch = "X64" Then
Run("C:\Program Files (x86)\Internet Explorer\iexplore.exe https://mail.google.com/mail/?tab=mm&authuser=0", "")
Else
Run("C:\Program Files\Internet Explorer\iexplore.exe https://mail.google.com/mail/?tab=mm&authuser=0", "")
EndIf
Case $gcal
If @OSArch = "X64" Then
Run("C:\Program Files (x86)\Internet Explorer\iexplore.exe https://www.google.com/calendar?tab=mc&authuser=0", "")
Else
Run("C:\Program Files\Internet Explorer\iexplore.exe https://www.google.com/calendar?tab=mc&authuser=0", "")
EndIf
Case $gdrv
If @OSArch = "X64" Then
Run("C:\Program Files (x86)\Internet Explorer\iexplore.exe https://drive.google.com/?tab=mo&authuser=0", "")
Else
Run("C:\Program Files\Internet Explorer\iexplore.exe https://drive.google.com/?tab=mo&authuser=0", "")
EndIf
Case $gsch
If @OSArch = "X64" Then
Run("C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.google.com/webhp?hl=en&tab=mw&authuser=0", "")
Else
Run("C:\Program Files\Internet Explorer\iexplore.exe http://www.google.com/webhp?hl=en&tab=mw&authuser=0", "")
EndIf
Case $sims
If $os = "x86" Then
Run("C:\Program Files\SIMS\SIMS .net\Pulsar.exe", "")
ElseIf $os = "x64" Then
Run("C:\Program Files (x86)\SIMS\SIMS .net\Pulsar.exe", "")
EndIf
EndSwitch
WEnd
Func show()
GUISetState(@SW_RESTORE, $USRinFO)
EndFunc ;==>show
Func about()
MsgBox(64, "USRinFo", "USRinFo" & @CR & "Version: " & FileGetVersion("USRinFO.exe") & @CR & @CR & "Created By Richard Easton 2012")
EndFunc ;==>about


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>