mIRC Homepage
done a search thru a few mirc script archives and couldn't find this, but i'm lookin for a DLL that can tell if, for instance, the guest user is logged in and is currently active if the mIRC is on the logged in admin. (Windows XP home Sp1 btw)

EG.
I keep my admin logged in which has mIRC installed and running. Now, my parents will sometimes want to use the internet suddenly so i have to quickly "winkey+L" to get to the login screen and click "Guest" account.
At that point i want to have mIRC put me into away mode so i don't have to worry about my custom nick detector going off while my parents are surfing.
I realise that its the lazy way, but its easier for me.

Just thought that i could add my AWAY script to "winkey+L", but it would have to work if mIRC isn't the active application, could that be done?

Thanks anyway
You dont need a DLL, It can be done via COM Objects using WScript.Network.

alias uname {
if ($com(getusername)) { .comclose getusername }
.comopen getusername WScript.Network
var %i = $com(getusername, Username, 2)
var %v = $com(getusername).result
.comclose getusername
return $iif(%i == 1,%v,ERR)
}

Syntax; //echo -> $uname

Tested here, XP Home, SP2, Returns 'Eamonn' when logged on as 'Eamonn' and 'Guest' when logged on as guest, so seems to work fine.

Set it on APPACTIVE perhaps to check $uname.

Eamonn.
Just to say SP2 Pro works here
returns Dan (my admin account) even when i'm logged in as guest.

[Edit] I've bodged together something. The guest account has a batch file on startup where it writes to a txt file in the mirc dir and mirc checks for that file every 10 seconds, when it finds it, it auto away's, deletes the file and waits for mIRC to be maximized before it auto comes back.

Thanks anyway Coolkill
Yeah it does return an 'Old' username on occations, i.e.

- Created username 'Eamonn'
- Renamed 'Eamonn' to 'Home'
- Script still returns 'Eamonn'

This is infact an issue with Windows (obviously), Enabling/Disabling the Guest account seemed to refresh it for me though.

Eamonn.
I think this works with Windows98?
© mIRC Discussion Forums