• Welcome to Valhalla Legends Archive.
 

Bot Uptime

Started by OcTaViuS, May 10, 2003, 11:52 PM

Previous topic - Next topic

OcTaViuS

can anyone teach me how to do it correctly?  :-\

i know the general concept of how to do it, and tried searching the forums for the answer but all the examples confused me. (which is surprisingly ez with all the stress i been having to handle lately) i need to know stuff like how to properly declare all the neccassary functions like GetTickCount n'such.

Aswell it would be nice to get example coding on how to use the functions. I'm planning on using bot uptime for an idle, but that doesnt really matter, all im asking for is the general coding for it.

help is greatly appreciated.  :-\

Yoni

And we are to understand you are coding in Ada?

iago

I assumed it was java..

use System.getTime().
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


OcTaViuS


K

I'll try to help you without giving you code.  This makes you "smarter (tm)" and "more independent (tm)".

You want to know how long your bot has been connected.  You'll need to do three things:
1) Store at what time your bot connected.
2) Determine what time it is "now."
3) Find how much greater "now" is than the time in step 1.

Visual Basic has several helpful functions that you can use. Play around with Now()   and the DateDiff() function, which returns the difference between two DateTimes.

Good luck.

Camel

Quote from: K on May 11, 2003, 12:44 PM
Visual Basic has several helpful functions that you can use. Play around with Now()   and the DateDiff() function, which returns the difference between two DateTimes.

i prefer gettickcount, as long as you're only trying to find the ammount of time difference,t here's no need for those. may be a good idea if you're just learning tho.

K

Except that with GetTickCount() you have milliseconds which you need to convert into a readable format; the DateTime will take care of that for you, which is why I recommended it.

OcTaViuS

Quote from: K on May 11, 2003, 12:44 PM
I'll try to help you without giving you code.  This makes you "smarter (tm)" and "more independent (tm)".

You want to know how long your bot has been connected.  You'll need to do three things:
1) Store at what time your bot connected.
2) Determine what time it is "now."
3) Find how much greater "now" is than the time in step 1.

ya i knew that already  :P i coulda sworn i said i knew the concept of how its done.

and im more of a visual learner then someone who learns by doing. in other words i learn better by visually seeing the code then spending hours trying to figure it out. and i'd have to say im pretty independant. ive only known VB since last january (started programming with QB last november). my first project using VB is a chat bot and this is only the 2nd time ive required help. (for some reason i have a harder time working with the ez stuff then the hard stuff)

tA-Kane

Quote from: OcTaViuS on May 11, 2003, 02:34 PMfor some reason i have a harder time working with the ez stuff then the hard stuff
I know that feeling  ;)
All it takes to overcome that, though, is to try, try, and try harder. And if that fails, that you step back and take look at why you're trying too hard.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

drivehappy

#9
Private Sub Form_Load()
r = Now 'Set your first time to when it connects
End Sub

Private Sub Whatever()
g = Now 'Set your second time when you want to check date diff
Msgbox GetDiff(r,g)
End Sub

Private Function GetDiff(Date1 as Date, Date2 as Date)
GetDiff = DateDiff("h", Date1, Date2) '  "h" is an interval, check below for more settings
End Function



Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week of year
h Hour
m Minute
s Second

Banana fanna fo fanna

Quote from: iago on May 11, 2003, 10:49 AM
I assumed it was java..

use System.getTime().

no.

OcTaViuS

Quote from: drivehappy on May 11, 2003, 06:19 PM
Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week of year
h Hour
m Minute
s Second

umm, is "m" for Month or Minute? you listed it for both. im guessing its for month since it doesnt seem to work for me as minute. but if thats the case then wuts the one for minute?

Camel

Quote from: OcTaViuS on May 22, 2003, 08:35 PM
Quote from: drivehappy on May 11, 2003, 06:19 PM
Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week of year
h Hour
m Minute
s Second

umm, is "m" for Month or Minute? you listed it for both. im guessing its for month since it doesnt seem to work for me as minute. but if thats the case then wuts the one for minute?

yeah, for a while my bot was displaying the month instead of the minute in the timestamp >.<
minute is n

Slugger69

Case "sysuptime"
Send "
* Slugger69 Bot Uptime - " & vbTab & vbTab & vbTab & ConvertTime(GetTickCount - RunningTime)
Send "
* Slugger69 System Uptime - " & ConvertTime(GetTickCount()) & "

that would work on VB for uptime on bot and cpu

Noodlez

ConvertTime is not a standard VB function; it would be nice if you provided the code to it if you're going to use it in an example.