Valhalla Legends Forums Archive | Battle.net Bot Development | [VB] Idle Question

AuthorMessageTime
FiReGoD
i cant get my idle to go past 60 seconds i am just using

idle.interval = txtidle
February 27, 2003, 10:48 PM
St0rm.iD
That is gross.

Use idle.interval = val(txtidle.text)

That should make your code more readable, and could make it work, too!
February 27, 2003, 11:31 PM
FiReGoD
yea, but isnt there a cap on how many seconds you can use?
February 27, 2003, 11:56 PM
Skywing
[quote]yea, but isnt there a cap on how many seconds you can use?
[/quote]
That depends on how you're doing your timers.  It's not difficult to devise a system which permits quite long wait intervals.  Perhaps you should elaborate on just what exactly you're doing now?
February 28, 2003, 12:02 AM
Crypticflare
Well for my idles, I set the timer  for 30 Second Intervals that way you won't flood yourself off. All I did was if your idle was 20, it would idle for 10 minutes, since there are two sets of 30's in a minute.. not the greatest thing ever, but it works for me.
February 28, 2003, 8:25 AM
Camel
[quote]idle.interval = txtidle[/quote]

interval is an integer, so it is capped at 65535 ms, or "65ish" seconds (they're not very accurate). you cannot push it past that afaik; but you can have it not execute whatever idle code you have every time it calls idle_Timer()

If (GetTickCount - LastChat) > IdleTime Then
February 28, 2003, 1:14 PM
warz
Just set timer interval to one second, and have it increment a variable by one each second. when that variable is equal to your idle time, have it send the idle message and reset the variable to zero.
February 28, 2003, 2:47 PM
FyRe
[code]Private Sub TimerAway_Timer()
   Dim Timer As Integer
   If Not frmMain.wsBnet.State = sckConnected Then: Exit Sub
   If BNET.varAwayIdle = "1" Then
       If GetTickCount - LastTalk >= 60000 Then
           If awayFlag = False Then
           End If
           awayFlag = True
           idleFlag = True
           Send "/away Bot has been idle for " & FormatCount(GetTickCount - LastTalk, 3) & ".", frmMain.wsBnet
       End If
       Else
           If GetTickCount - LastTalk >= 90000 Then
               SendBanner
           End If
   End If
End Sub[/code]

That's how I do it.
February 28, 2003, 5:10 PM
Yoni
Should do something like
[code]
Private Sub OneSecondTimer_Timer()
 Static SecondsPassed As Long
 SecondsPassed = (SecondsPassed + 1) Mod HoweverManySecondsYouWantToCount
 If SecondsPassed = 0 Then
   ' Do whatever
 End If
End Sub
[/code]
Exact same code if you want to count minutes instead of seconds, but use an Interval of 60000 instead of 1000.
February 28, 2003, 5:19 PM
haZe
if txtidle.text > 999 then txtidle.text = "" msgbox "idle too long :/"
February 28, 2003, 6:06 PM
FiReGoD
haze, i know that and i already have that, but i want it to go past 60000
February 28, 2003, 6:27 PM
warz
Read what I posted.

"Just set timer interval to one second, and have it increment a variable by one each second. when that variable is equal to your idle time, have it send the idle message and reset the variable to zero. "
February 28, 2003, 7:41 PM
FiReGoD
there isnt an easier way, that seems buggy dont you think?
February 28, 2003, 8:39 PM
St0rm.iD
wtf? Of course not.
February 28, 2003, 8:54 PM
Camel
inaccurate? yes. buggy? no.
February 28, 2003, 10:35 PM
FiReGoD
inaccurate?
February 28, 2003, 11:54 PM
Camel
it'll work fine, but vb timers aren't known for triggering on time
March 1, 2003, 12:21 AM
Yoni
It should be accurate.

The VB Timer control is a wrapper around the Win32 SetTimer function and WM_TIMER message (aka the "User32 timer").
Although the User32 timer is a low-resolution timer, for such high intervals (an entire second) it will be accurate. (You may still lose a millisecond or three because of the VB VM's overhead.)

It will only be inaccurate if you specify a low interval that requires a high-resolution timer. I wouldn't trust it to be accurate with an interval lower than about 50.
March 1, 2003, 9:14 PM

Search