mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2004
Posts: 457
D
Fjord artisan
OP Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
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

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
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.

Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Just to say SP2 Pro works here

Joined: Mar 2004
Posts: 457
D
Fjord artisan
OP Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
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

Last edited by Danthemandoo; 25/08/04 09:15 PM.
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
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.

Joined: Apr 2004
Posts: 218
P
Fjord artisan
Offline
Fjord artisan
P
Joined: Apr 2004
Posts: 218
I think this works with Windows98?


Live to Dream & Dream for Life

Link Copied to Clipboard