• Welcome to Valhalla Legends Archive.
 

[VB] Idle Question

Started by FiReGoD, February 27, 2003, 04:48 PM

Previous topic - Next topic

FiReGoD

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

idle.interval = txtidle

Banana fanna fo fanna

That is gross.

Use idle.interval = val(txtidle.text)

That should make your code more readable, and could make it work, too!

FiReGoD

#2
yea, but isnt there a cap on how many seconds you can use?

Skywing

#3
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?

Crypticflare

#4
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.

Camel

#5
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

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.

FyRe

#7
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.

Yoni

#8
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.

haZe

#9
if txtidle.text > 999 then txtidle.text = "" msgbox "idle too long :/"

FiReGoD

#10
haze, i know that and i already have that, but i want it to go past 60000

warz

#11
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. "

FiReGoD

#12
there isnt an easier way, that seems buggy dont you think?

Banana fanna fo fanna

#13
wtf? Of course not.

Camel

#14
inaccurate? yes. buggy? no.