Central Forums Code Wiki Characters Tools 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: !recruits  (Read 548 times)
« on: January 22, 2010, 18:39:38 »
Administrator
Apprentice

View Profile
*****

Epeen: 3
Posts: 219


AO sends these "someone recruited someone else" messages to org channel, which is monitored by the notify plugin (I think).  Since I'm not on all the time and new faces show up, I'd like to know who recruited whom when.  The bot monitors this activity anyways.  I would just like the bot to keep a database of say... the last months or 2 months worth or recruits.

I would like to propose a:
Code:
!recruits
command that would display the recruits name, date they joined my org (UTC/GMT would be fine -- I don't need to know the local time they joined), and who recruited them.

Is this hard?

Complete, tested and tidied. Thanks Llie for the fundamentals.

Edit: Updated download:

* ll_Recruits.cs (3.56 KB - downloaded 20 times.)
« Last Edit: January 27, 2010, 11:38:45 by veremit »
Logged
« Reply #1 on: January 23, 2010, 16:10:22 »
VhaBot Developers
Rookie

View Profile
***

Epeen: 2
Posts: 84


Thanks Mit. I looked at the results in our org bot.  It appears that FC mucks with the user data and old members disappear and reappear from org roster from time to time causing the bot to record their "re-invitation" by "System".  I propose the following change to this plugin:

Where the code used to read:

Code:
                    try
                    {
                            window.AppendHighlight( reader.GetString(0) );
[... bunch of window.Appends here]
                            window.AppendLineBreak();
                    }
                    catch { }

The new code should be:

Code:
                    try
                    {
                        if ( reader.GetString(1) != "System" )
                        {
                            window.AppendHighlight( reader.GetString(0) );
[... same bunch of window.Appends here]
                            window.AppendLineBreak();
                        }
                    }
                    catch { }
Logged
« Reply #2 on: January 23, 2010, 17:05:24 »
Administrator
Apprentice

View Profile
*****

Epeen: 3
Posts: 219


Yes, thanks for flagging this up. There is also a method of adjusting the SQL query statement, which I think would be an equally valid, if not better solution (probably an 'AND' in the 'WHERE' statement).

I'll get onto that asap.
Logged
« Reply #3 on: January 27, 2010, 05:11:18 »
VhaBot Developers
Rookie

View Profile
***

Epeen: 2
Posts: 84


Ok. I think the SQL would look like:

Code:
SELECT Username, AddedBy, AddedOn FROM CORE_Members WHERE AddedOn >= {0} AND AddedBy <> "System" ORDER BY AddedOn DESC

Logged
« Reply #4 on: January 27, 2010, 11:36:42 »
Administrator
Apprentice

View Profile
*****

Epeen: 3
Posts: 219


Done. Amended link on top post.

SQL syntax is != I believe not <> Smiley
« Last Edit: January 27, 2010, 11:39:19 by veremit »
Logged
« Reply #5 on: January 27, 2010, 15:13:04 »
VhaBot Developers
Rookie

View Profile
***

Epeen: 2
Posts: 84


Done. Amended link on top post.

SQL syntax is != I believe not <> Smiley

Well, that would have been my guess based on all my other programming experience, but Google says otherwise.  Since I don't know a thing about SQL, I went with the all-knowing-Google.  Did you test it?
Logged
« Reply #6 on: January 27, 2010, 15:21:46 »
Administrator
Apprentice

View Profile
*****

Epeen: 3
Posts: 219


Err .. you haven't tried it on Lliesbot?! Tongue
Logged
« Reply #7 on: January 27, 2010, 19:54:52 »
VhaBot Developers
Rookie

View Profile
***

Epeen: 2
Posts: 84


I haven't logged on since before you posted the change. I'm stuck at work all day today.
Logged
« Reply #8 on: March 08, 2010, 03:47:35 »
Noob

View Profile


Epeen: -2
Posts: 7


just a clarification about "!=" versus "<>"

both will/should work, but "!=" is the old way, and "<>" is the proper way Smiley
Logged
Pages: [1]   Go Up
Print
Jump to: