Central Forums Helpbot
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1]   Go Down
Print
Topic: Guest Channel automatic online listing  (Read 1950 times)
« on: December 30, 2011, 01:05:56 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


I've been spending a fair amount of time in our org bot's Guest Channel lately as I've been trying to level an out-of-org alt.

I'd really like to get the automated listing of who's online when I join the channel.  Unfortunately !Online is handled by vh_Online.cs and Guest Channel notify is handled by vh_PrivateGroup.cs.  Is there a simple way for PrivateGroup to trigger a Online? 

Logged
« Reply #1 on: January 02, 2012, 06:16:35 PM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


I have done this for our bot .. will see if the function is enabled for our running version of the plugin Smiley

FYI, its simply a matter of 'faking' the !online command when a user joins the private channel - just as it does in the normal way when a user logs on.
Logged
« Reply #2 on: January 04, 2012, 07:54:07 PM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


Right. My question was how one would accomplish that.
Logged
« Reply #3 on: January 06, 2012, 01:59:32 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


Codewise .. something like ..
Code:
            if (this._sendOnline)
            {
                // Fake the user sending !online to the bot ;)
                CommandArgs args = new CommandArgs(CommandType.Tell, 0, e.SenderID, e.Sender, e.SenderWhois, "online", "", false, null);
                ((OnlineBase)bot.Plugins.GetPlugin("vhOnline")).OnOnlineCommand(bot, args);
            }
Logged
« Reply #4 on: January 06, 2012, 04:58:04 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


Ah! Thank you!

Code:
.GetPlugin("vhOnline"))

It's the secret sauce that I'm always missing.

Edit: Thanks! works like a charm.  One suggestion is to wrap a try/empty catch around it in case someone doesn't load the vhOnline plugin but does load the vhPrivateGroup plugin.

Can't wait to see it on our org bot.
« Last Edit: January 06, 2012, 05:06:01 AM by Llie »
Logged
« Reply #5 on: January 06, 2012, 06:24:43 PM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


Yes, for the purposes of that post, I chopped the relevant "ifs" out because the version I have running uses one of two different OnlineBase plugin classes .. so has to pick the right one.

I'll enable it on ours forthwith!
Logged
« Reply #6 on: January 08, 2012, 06:18:35 AM »
VhaBot Developers
Full Member

View Profile
***

Epeen: 5
Posts: 204


It's a thing of beauty to be treated equally whether in org or on guest channel.  Very happy.  Thank you.
Logged
Pages: [1]   Go Up
Print
Jump to: