• Welcome to Valhalla Legends Archive.
 

OS (operating system) command

Started by Bot Dev, January 04, 2003, 02:39 PM

Previous topic - Next topic

Bot Dev

Could anyone tell or give me a place to find .os command for Visual Basics?

erase

#1
Private Sub FindMyOS()
    Dim MsgEnd As String
    Dim junk
    Dim osvi As OSVERSIONINFO
    osvi.dwOSVersionInfoSize = 148
    junk = GetVersionEx(osvi)


    If junk <> 0 Then


        Select Case osvi.dwPlatformId
            Case VER_PLATFORM_WIN32s '0
            MsgEnd = "Microsoft Win32s"
            Case VER_PLATFORM_WIN32_WINDOWS '1
            If ((osvi.dwMajorVersion > 4) Or _
            ((osvi.dwMajorVersion = 4) And (osvi.dwMinorVersion > 0))) Then
            MsgEnd = "Microsoft Windows 98"
        Else
            MsgEnd = "Microsoft Windows 95"
        End If
        Case VER_PLATFORM_WIN32_NT '2
        If osvi.dwMajorVersion <= 4 Then _
        MsgEnd = "Microsoft Windows NT"
        If osvi.dwMajorVersion = 5 Then _
        MsgEnd = "Microsoft Windows 2000"
    End Select
End If
(straight off pscode.com)

Usage:

Call FindMyOS

ILurker

#2
hit ctrl+t in your vb6 program, and find the "sysinfo" ocx, and double click on it on the toolbar, with your main form, If you are using bnls, then do the following,

Private sub cleanslatebot_usertalk(whatever goes here, easy for you to find out)
if message = "?os" then cleanslatebot1.send " Os: " & sysinfo1.name & " Build: " & sysinfo1.build

And there you go, very easy way to do thge ?os command, unless you want to add other things for when a user talks,

Noodlez

#3
ocxs are ew, what erase posted is better

ILurker

#4
Ocx's are allot easier, and it would be a more efficiant way for the sysinfo command for people that are new with vb6

Yoni

#5
Yes, and you will enjoy licensing and registering annoyances with the sysinfo OCX too.

(Tons of pointless tech support calls had this been a "real" project.)

ILurker

#6
You spelt "Listening" wrong.  :o

Noodlez

um? he didn't even say listening, he said licensing. but, you wouldn't know what that is.

btw, using ocx's is not "more effecient" for one thing, your application now wont run unless they have that ocx, another, it has to be licensed. then vb has to load it into the process memory and waste your precious resources.

ILurker

#8
Oops, :) wasnt reading it very well

Banana fanna fo fanna

#9
owned.

ILurker

#10
That code is kind of messed up, you can't
dim something as OSVERSIONINFO

Noodlez

yes you can, assuming you have the type declared.

ilurker, i honestly dont think you should be making a bot with the limited knowledge you have of visual basic. dont take that offensively

erase, maybe you should provide the constants and the type OSVERSIONINFO

anyway, this is better way
Private Function FindMyOS()  As string
    Dim MsgEnd As String
    Dim junk
    Dim osvi As OSVERSIONINFO
    osvi.dwOSVersionInfoSize = 148
    junk = GetVersionEx(osvi)


    If junk <> 0 Then


        Select Case osvi.dwPlatformId
            Case VER_PLATFORM_WIN32s '0
            MsgEnd = "Microsoft Win32s"
            Case VER_PLATFORM_WIN32_WINDOWS '1
            If ((osvi.dwMajorVersion > 4) Or _
            ((osvi.dwMajorVersion = 4) And (osvi.dwMinorVersion > 0))) Then
            MsgEnd = "Microsoft Windows 98"
        Else
            MsgEnd = "Microsoft Windows 95"
        End If
        Case VER_PLATFORM_WIN32_NT '2
        If osvi.dwMajorVersion <= 4 Then _
        MsgEnd = "Microsoft Windows NT"
        If osvi.dwMajorVersion = 5 Then _
        MsgEnd = "Microsoft Windows 2000"
    End Select
FindMyOs = MsgEnd
End If

Usage:

msgbox FindMyOS


your wouldnt return a value or anything...

ILurker

#12
- Making something hard is a good way to start off in visual basic 6, so how about you stop rating other people about their skills, and help people, if you dont want to help then leave

Noodlez

Quote- Making something hard is a good way to start off in visual basic 6, so how about you stop rating other people about their skills, and help people, if you dont want to help then leave
lol...not if you dont understand half of what your doing.

and wtf is it with you and preceding your sentences with a dash?

ILurker

#14
Quotelol...not if you dont understand half of what your doing.

and wtf is it with you and preceding your sentences with a dash?

Bad habit to break  :-/
And i do know what im doing, and i can make a bot easily, im just trying to make harder stuff on it, like for example, minimizing to tray, now i know how to do that because i got it from someone else.