Valhalla Legends Forums Archive | Battle.net Bot Development | Channel List Help~

AuthorMessageTime
HeRo
When people in a channel have been inactive for a certain time, how would I make it so their name(s) dim a little and the people in the channel that are active stays the same?
April 30, 2005, 1:09 AM
OnlyMeat
[quote author=HeRo link=topic=11430.msg110483#msg110483 date=1114823350]
When people in a channel have been inactive for a certain time, how would I make it so their name(s) dim a little and the people in the channel that are active stays the same?
[/quote]

I imagine you would store the result of a GetTickCount when a user is shown/joins the channel, then update it as you receive speak/emote events etc.

You could then set a timer using a pre-determined interval, for example every 10 seconds. In the timer handler you could then loop through the channel user list and compare the last tickcount against the current system tickcount. If the difference is greater than <pre-determined idle interval> then change the users channel icon to reflect this.
April 30, 2005, 2:03 AM
HeRo
Thanks for the idea I will try that right now
April 30, 2005, 7:32 AM
QwertyMonster
I have 2 question:

Im wondering how do i change the colour of a name after a certain amount of time.

And

How do i make it so when i right click a menu comes up like Stealthbot?
April 30, 2005, 9:55 AM
laurion
[quote author=QwertyMonster link=topic=11430.msg110522#msg110522 date=1114854953]
I have 2 question:

Im wondering how do i change the colour of a name after a certain amount of time.

And

How do i make it so when i right click a menu comes up like Stealthbot?
[/quote]
To your first question: [code]Form1.ListView1.FindItem("Bah").ForeColor = &HFF&[/code]
To your second question: Add the following to your listview_mouseup event:
[code]
    If Button = 2 Then
        PopupMenu mnuUsers
    End If
[/code]
Of course, you must use the menu editor and create an invisible menu named mnuUsers or whatever. Button = 2 is right click.
Hope this helps.
April 30, 2005, 12:47 PM
QwertyMonster
Hey laurion thanks for your help!

My first question: Answered + Works - Thanks!

Edit:

Both fixed.

Thanks!
April 30, 2005, 1:10 PM
OnlyMeat
[quote author=laurion link=topic=11430.msg110532#msg110532 date=1114865223]
To your first question: [code]Form1.ListView1.FindItem("Bah").ForeColor = &HFF&[/code]
[/quote]

If you don't know the hex values for a colour, you can construct it using the RGB() function, which is somewhat easier. Although i would say if you know the RGB before hand it's better to use a magic number constant to facilitate clean manageable code.

[quote author=laurion link=topic=11430.msg110532#msg110532 date=1114865223]
To your second question: Add the following to your listview_mouseup event:
[code]
    If Button = 2 Then
        PopupMenu mnuUsers
    End If
[/code]
Of course, you must use the menu editor and create an invisible menu named mnuUsers or whatever. Button = 2 is right click.
Hope this helps.
[/quote]

Again, there is a reason vb defines it's constants, it makes for more much manageable/readable code. Use this instead:-

[code]
    If Button = vbRightButton Then
        PopupMenu mnuUsers
    End If
[/code]

vbRightButton is  a member of the VBRUN.MouseButtonConstants enumeration.
April 30, 2005, 1:42 PM
QwertyMonster
Thanks for you help also OnlyMeat, but i got it fixed now :P

Thanks all for your help :D
April 30, 2005, 1:46 PM
LivedKrad
I would think checking the value from GetTickCount would not only be time assuming for say 30 users in the channel, but impractical. There may be another possibility. Check with sources or other bot authors who have done "idle banning" and see what method they have come up with.  However, for lack of coming up with an idea of my own because I'm extremely lazy, I will say no more.
April 30, 2005, 3:09 PM
raylu
It's not very impractical or time consuming. The checking code is in a timer and it would fire every minute or so.
April 30, 2005, 3:36 PM
HeRo
Thanks I got it all to work.
April 30, 2005, 5:33 PM
R.a.B.B.i.T
[quote author=LivedKrad link=topic=11430.msg110558#msg110558 date=1114873789]
I would think checking the value from GetTickCount would not only be time assuming for say 30 users in the channel, but impractical. There may be another possibility. Check with sources or other bot authors who have done "idle banning" and see what method they have come up with.  However, for lack of coming up with an idea of my own because I'm extremely lazy, I will say no more.
[/quote]That's how I've always done it.  I used a struct so I could hold a bunch of data about a user, then I used a timer to check every user.  In my "benchmark" tests checking a few user with about 15 different stored data sets only took a couple milliseconds.
May 1, 2005, 2:17 PM
LivedKrad
Wouldn't there be like 20 ms difference between checking the first user and the last user though? Such differences can be costly to the integrity of your clan!
May 1, 2005, 5:22 PM
R.a.B.B.i.T
How?  Flood bots can't really be prevented, only filtered.  It's not like any operation on Battle.Net will fail if you wait 20ms.
May 1, 2005, 6:32 PM

Search