• Welcome to Valhalla Legends Archive.
 

Idles...

Started by PsYcHiC, July 08, 2003, 08:23 PM

Previous topic - Next topic

PsYcHiC

This is in Visual Basic 6, How would I make Idles so people can choose what idle they want? EX. Connected Uptime, System Uptime, Quotes. I'm using CSB.  And if this was posted anywhere else, direct me to it please.

Tuberload

I think you should learn how to program first... Either way all you have to do is create a group of radio buttons, each represent a different idle, then have it send the idle based on the selected button.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

PsYcHiC

Quote from: PsYcHiC on July 08, 2003, 08:23 PM
This is in Visual Basic 6, How would I make Idles so people can choose what idle they want? EX. Connected Uptime, System Uptime, Quotes. I'm using CSB.  And if this was posted anywhere else, direct me to it please.
I know this post sounded newb, but I already have a bot made... I just need alittle help.

Eternal

Look up GetTickCount...
^-----silly Brit
-----------------------------
www.brimd.com

Stealth

or... because you should learn Visual Basic before attempting to write a bot in it?
- Stealth
Author of StealthBot

Camel

I didn't really read if the question was answered, but the uptime question has already been addressed here: http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=1298;start=msg10502#msg10502

Quote from: Camel on May 23, 2003, 02:49 PM
Public Function UpTime() As String
   Dim ticks As Long
   ticks = GetTickCount
   UpTime = "Computer on for " & GetTime(ticks) & _
            ", running for " & GetTime(ticks - StartTime) & _
            ", logged on for " & GetTime(ticks - LogTime)
End Function

Public Function Zero(str As String, Count As Long, Optional Char As Byte = "0") As String
   Zero = String(Count - Len(str), CStr(Char)) & str
End Function

Public Function GetTime(ByVal ticks As Long, Optional ShowDecimals As Boolean = False) As String
   Dim TS As Long, TM As Long, TH As Long, TD As Long, TW As Long

   TS = ticks \ 1000: ticks = ticks - TS * 1000
   TM = TS \ 60:            TS = TS - TM * 60
   TH = TM \ 60:            TM = TM - TH * 60
   TD = TH \ 24:            TH = TH - TD * 24
   TW = TD \ 7:             TD = TD - TW * 7
   
   GetTime = Zero(CStr(TS), 2) & IIf(ShowDecimals, "." & Zero(CStr(ticks), 3), "") & "s"
   If TM + TH + TD + TW > 0 Then GetTime = Zero(CStr(TM), 2) & "m " & GetTime
   If TH + TD + TW > 0 Then GetTime = Zero(CStr(TH), 2) & "h " & GetTime
   If TD + TW > 0 Then GetTime = CStr(TD) & "d " & GetTime
   If TW > 0 Then GetTime = CStr(TW) & "w " & GetTime
End Function


?UpTime
Computer on for 1w 2d 23h 03m 30s, running for 22h 04m 08s, logged on for 22h 04m 07s


Skywing

Remember that GetTickCount will reset every 49.7 days; I'd recommend against using it for uptime.  That is, unless you're expecting to crash every few days :-)

Camel

Very few windows users leave their computers on for longer than 20 or so. Besides, if you're not going to provide a better solution, what's the point of posting?

Kp

Quote from: Camel on July 09, 2003, 04:42 PM
Very few windows users leave their computers on for longer than 20 or so. Besides, if you're not going to provide a better solution, what's the point of posting?
I stay up until the system forces me to go down, usually either due to hardware change or installing anything from Microsoft.  Skywing tends to maintain uptimes even longer than mine.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Skywing

#9
Quote from: Camel on July 09, 2003, 04:42 PM
Very few windows users leave their computers on for longer than 20 or so. Besides, if you're not going to provide a better solution, what's the point of posting?
This has been covered before.

Query the performance counter "System\System Up Time" or use QueryPerformanceCounter/QueryPerformanceFrequency (the former is slower, the latter isn't guaranteed to work right under all processors).

Thing

Current longest uptime:
That sucking sound you hear is my bandwidth.

Camel

I said "most users" intentionally.
I'll look into that, Skywing.

Thing, how does that have anything at all to do with windows uptime? I've had 230+ days on a linux box before; 104 is nothing to brag about. Besides, is this forum named "post your best uptime?" I think not.

Skywing

Quote from: Thing on July 09, 2003, 05:56 PM
Current longest uptime:

I had about 170 on Win2K before a power outage zapped it..

Camel

Well that was easy:
Public Function GetSecondCount() As Currency
   Dim qpCounter As Currency, qpFrequency As Currency
   QueryPerformanceCounter qpCounter
   QueryPerformanceFrequency qpFrequency
   GetSecondCount = qpCounter / qpFrequency
End Function

Thing

QuoteThing, how does that have anything at all to do with windows uptime?
It doesn't.

Quote104 is nothing to brag about.
I know.  That is just my current longest uptime.

QuoteBesides, is this forum named "post your best uptime?" I think not.
I think you need a nap.
That sucking sound you hear is my bandwidth.