Valhalla Legends Forums Archive | Battle.net Bot Development | Idles...

AuthorMessageTime
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.
July 9, 2003, 1:23 AM
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.
July 9, 2003, 1:32 AM
PsYcHiC
[quote author=PsYcHiC link=board=17;threadid=1835;start=0#msg14210 date=1057713806]
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.
[/quote]
I know this post sounded newb, but I already have a bot made... I just need alittle help.
July 9, 2003, 1:59 AM
Eternal
Look up GetTickCount...
July 9, 2003, 9:34 AM
Stealth
or... because you should learn Visual Basic before attempting to write a bot in it?
July 9, 2003, 6:15 PM
Camel
I didn't really read if the question was answered, but the uptime question has already been addressed here: https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=1298;start=msg10502#msg10502

[quote author=Camel link=board=17;threadid=1298;start=15#msg10502 date=1053719396]
[code]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[/code]

[code]?UpTime
Computer on for 1w 2d 23h 03m 30s, running for 22h 04m 08s, logged on for 22h 04m 07s[/code]
[/quote]
July 9, 2003, 7:06 PM
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 :-)
July 9, 2003, 9:38 PM
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?
July 9, 2003, 9:42 PM
Kp
[quote author=Camel link=board=17;threadid=1835;start=0#msg14345 date=1057786967]
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?[/quote]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.
July 9, 2003, 9:55 PM
Skywing
[quote author=Camel link=board=17;threadid=1835;start=0#msg14345 date=1057786967]
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?
[/quote]
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).
July 9, 2003, 10:42 PM
Thing
Current longest uptime:
[img]http://www.vpnsys.com/uptime.gif[/img]
July 9, 2003, 10:56 PM
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.
July 9, 2003, 11:48 PM
Skywing
[quote author=Thing link=board=17;threadid=1835;start=0#msg14356 date=1057791375]
Current longest uptime:
[img]http://www.vpnsys.com/uptime.gif[/img]
[/quote]
I had about 170 on Win2K before a power outage zapped it..
July 9, 2003, 11:54 PM
Camel
Well that was easy:
[code]Public Function GetSecondCount() As Currency
Dim qpCounter As Currency, qpFrequency As Currency
QueryPerformanceCounter qpCounter
QueryPerformanceFrequency qpFrequency
GetSecondCount = qpCounter / qpFrequency
End Function[/code]
July 10, 2003, 12:00 AM
Thing
[quote]Thing, how does that have anything at all to do with windows uptime?[/quote]It doesn't.

[quote]104 is nothing to brag about.[/quote]I know. That is just my current longest uptime.

[quote]Besides, is this forum named "post your best uptime?" I think not.[/quote]I think you need a nap.
July 10, 2003, 12:10 AM
Camel
Yeah, sorry; I was feeling a little...eh...when I posted that.
July 10, 2003, 1:30 AM
JoeCool
nice big ass code
[quote]
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
[/quote]
by any change, what name would i name the "timer" :/ and is it for cbs and what would i put under UserTalk
[code]
Access=RetrieveAccess(Access,Username)
If Access= "M" Then
??????[/code]
July 10, 2003, 6:42 AM

Search