i cant get my idle to go past 60 seconds i am just using
idle.interval = txtidle
That is gross.
Use idle.interval = val(txtidle.text)
That should make your code more readable, and could make it work, too!
yea, but isnt there a cap on how many seconds you can use?
Quoteyea, but isnt there a cap on how many seconds you can use?
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?
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.
Quoteidle.interval = txtidle
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
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.
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
That's how I do it.
Should do something like
Private Sub OneSecondTimer_Timer()
Static SecondsPassed As Long
SecondsPassed = (SecondsPassed + 1) Mod HoweverManySecondsYouWantToCount
If SecondsPassed = 0 Then
' Do whatever
End If
End Sub
Exact same code if you want to count minutes instead of seconds, but use an Interval of 60000 instead of 1000.
if txtidle.text > 999 then txtidle.text = "" msgbox "idle too long :/"
haze, i know that and i already have that, but i want it to go past 60000
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. "
there isnt an easier way, that seems buggy dont you think?
wtf? Of course not.
inaccurate? yes. buggy? no.
inaccurate?
it'll work fine, but vb timers aren't known for triggering on time
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.