Skip to content
General IRCd

OS detection

A TG007 community discussion started by 87052402.

Closed discussion 9 posts
Page 1 of 1
Closed
Topic #6211 · 9 published posts · 3,197 views

I have a mirc script made by my own

 

Home is use Linux .. i run mirc with wine

 

And at my work is use windows

 

Now i wanne make a kind of system that can detect the os

 

So that if i run windows mirc run the programs for my work

 

and at home only the program's that i need home

 

but i have no idea to do this..

 

can somebody help me with that??

 

 

This will check to see what operating system you are running, and if any of those systems are found will execute whatever commands you wish.

 

The else statement will only activate if said operating systems aren't found, and will execute whatever commands you put in...

 

on *:START: {
 if ($os == 95) || ($os == 98) || ($os == NT) || ($os == ME) || ($os == 2K) || ($os == XP) || ($os == NET) {
   <commands here>
 }
 else {
   <commands here>
 }
}

$os returns the windows version you're using. i think wine returns an early windows version but i cant remember which.

i havent had much experience with wine but maybe you could use something like

if ($exists(/root)) { echo -a linux }

People are like slinkies; they're generally boring until you push them down stairs

That's not a reliable way of checking. Making a root\ directory in the mIRC directory will trick that script.

why would you want to trick it?

People are like slinkies; they're generally boring until you push them down stairs

lol

why would you want to trick it?

 

You could easily trick it inadvertedly.

You could easily trick it inadvertedly.

lol

 

actually linux and any *nix, BSD, etc. has a / and windows uses \