vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Users in IRC - with eggdrop. html access (https://vborg.vbsupport.ru/showthread.php?t=46305)

Sasq 12-01-2002 10:00 PM

Users in IRC - with eggdrop. html access
 
################################################## #########
Users in IRC - with eggdrop. html access
Tested on vB 2.2.5 and 2.2.9
Hack Verson: 2.0.2 Beta
################################################## #########


This hack is an enhanced version of the one by sas1911 - details of which can be found here
https://vborg.vbsupport.ru/showthrea...threadid=40855

This hack uses an eggdrop bot to provide information to vB about who is online.
NEW IN BETA 2
This hack now comes in two main flavours on the bot side.
1) writes the user list to a local file, vB then can access it local (if the bot is on the vB server)
or the file can be access remotely via http
2) This is the new bit, the bot now has the ability to contact the server directly via http (using the http tcl library)
- more on the vB side later - it updates when someone joins the channel, changes nick and after a set period of time

On the vB side the two main choices are...
1) simple display of user names with the ability to hide certain users, ie the bot. also allows a '_' or whatever at the
end of a nick to show the user is offline
2) Accesses the user DB to try to match the user 1st by bot handle, then nick, user name (host) and link them the same way
as online forum users. it will also hide users if their forum invisible setting is turned on.
it provides the same overides as the first script as well as additional flags of [me] (overide the db lookup) and
[on](override the invisible flag)

The callhome script needs an access code that you set in both the bot and the script as well as the ip range for the bot.
if the access code and the ip range don't the script will give the user a 404 error - see instructions

The script for index.php has the two subsets for either a local file or remote file.
each different flavor for the index file i have placed in seperate files, so please read that file for install instructions


All files are included as well as the old ver 1 of this hack.

Known bugs:
None at the moment

Known quirks:
With using the db, online users number may display higher then the list of users displayed, but vB works the same way,
if this really bugs people I'll tweak it.
Sometimes the the script just doesn't get the user right - again db lookup, my solve for this is regular users I add to the bot, if there is enough interest I'll do a user cp hack or something
to either get vB to contact the bot and add the user, (and handle to the bot) or hack a way around so that the user can register
their nick and/or user name (host) into the db

TODO:
anything anyone suggests thats reasonable

Fixed Bugs:
Resolved the Excess db queries, now its only 1 query 2.0.1
Fixed a bug where it would hang if the server went offline or refused to answer, now set at a 7 second time out.
Fixed a small glitch where the script showed a warning if the file was unreachable.
- refixed this glitch should all be working now. 1.1.2
Multiple instances of the timer bug resolved. 1.1.1


Added functions:
See above for main changes to ver 2
Now strips all php and html tags from the file - just to be on the safe side.
Added commas after names

Modified files
2.0.2 index.php only
2.0.1 Both db access scripts have been updated
2.0.0 All files need to be updated
1.2.0 index.php only
1.1.2 index.php only
1.1.1 index.php only
1.1 usc.tcl only

You can see this hack in action at MURC
Thanks for you time, any questions/ideas/sugestions please don't hesitate to contact me via pm or email (email is in the file).

Dan

FASherman 12-03-2002 11:26 AM

I'd make several changes.

First, either install of have your host install Mytcl.

Next, create a table to hold the IRC info. Instead of writing to a file, write to the database directly.

Now, mod your bot to do database updates on connect, joins, parts, kicks, bans, quits and via a 10 minute timer. All of those except the latter makes your bot update the table in real-time and it need do it only for the channel where activity occurs, reducing your overall bot activity as well as your database activity.

All information is in real-time. The 10 minute timer takes care of undetectable events like server splits and the such.

Sasq 12-03-2002 11:38 AM

At the moment for this installation, the bot is on a different server. Hence the need for http or in the case of the other hack ftp access. So at least for the moment direct DB access is out.

The reason for the x second timer to write the file is the bot doesn't accuretly dump the online list after a part (it keeps the data so you can check to see for wallops etc).

But I will look into direct db access for a later revision of the hack for on server bots.

Thanks for the feedback

Dan

Sasq 12-03-2002 01:18 PM

Update, bug in the tcl script has been resolved.

FASherman 12-03-2002 03:30 PM

Quote:

Originally posted by Sasq
At the moment for this installation, the bot is on a different server. Hence the need for http or in the case of the other hack ftp access. So at least for the moment direct DB access is out.
You need not be on the same server as your database to access it. Thats what the listener and the hostname in the connect string is for.

Quote:

Originally posted by Sasq
The reason for the x second timer to write the file is the bot doesn't accuretly dump the online list after a part (it keeps the data so you can check to see for wallops etc)..
All you need to do is drop the nick that PARTed from the $online list.

Sasq 12-03-2002 11:32 PM

Quote:

Originally posted by FASherman


You need not be on the same server as your database to access it. Thats what the listener and the hostname in the connect string is for.


Sorry I replied while tired, as far as I know, our host (forum) only allows localhost connects to the DB, and personally for security I prefer it that way as well. - yes i am aware of locking down the ip ranges etc for logins but i'm trying to keep this hack simple.

Quote:


All you need to do is drop the nick that PARTed from the $online list.


Maybe be doable, have to look at how the bot responds. But up to the second reporting of who's online in irc (at least for us is not that needed)

But you have given me an idea... might get the bot to ftp the new list to the server... anyway I'll have a look on the weekend

Dan

|DarkManX| 12-04-2002 02:36 AM

got a screenshot of this?

Sasq 12-04-2002 11:07 AM

Ask, and ye shall receive :)

Also you can see it in action at MURC

Dan

PBC 12-08-2002 01:11 PM

I have TCL installed, but keep getting errors when I run this script...

Sasq 12-08-2002 01:23 PM

What does the error say?

Dan

Sparkz 12-08-2002 01:51 PM

Quote:

Originally posted by Sasq


Sorry I replied while tired, as far as I know, our host (forum) only allows localhost connects to the DB, and personally for security I prefer it that way as well. - yes i am aware of locking down the ip ranges etc for logins but i'm trying to keep this hack simple.

How the DB security is maintained has little to do with your hack. It's simply a matter of knowing how to do a GRANT in MySQL.

Sasq 12-08-2002 01:59 PM

Sparkz, the db atm has little to do with my hack period

Sparkz 12-08-2002 02:01 PM

They way you commented on the other guys comment (nice sentence, eh? :p) made it sound like that :)

Don't mind me, though... I'm just being an a$$ like usual :p

Sasq 12-08-2002 02:07 PM

hehe no problem :) I'm currently most of the way through an alpha version of the second release. In this version the bot calls home to the forum via a html/php script saves a small text file.
The idea being to save bandwidth. and load times.
If people really want it to go into the db, I'll look at that in a later release

Dan

Sparkz 12-08-2002 02:18 PM

My own version (the one sending names to vb.org) calls home. The code should be here somewhere. Not very pretty or anything, but it sorta works :p

Sasq 12-08-2002 02:22 PM

This is defiently not on the pretty side - but hey if it works ;), It'll be ready for beta release once i work out how to do some "better" error handling in the tcl script for the bot.

PBC 12-12-2002 11:32 PM

Quote:

Originally posted by Sasq
What does the error say?

Dan

[20:21] wrong # args: no script following "{[string compare [li" argument
while compiling
"if {[string compare [lindex $j 1] i2h:make] == 0} "
("foreach" body line 1)
while compiling
"foreach j [utimers] {if {[string compare [lindex $j 1] i2h:make] == 0}
{return [lindex $j 2]}}"
(compiling body of proc "utimerexists", line 2)
invoked from within
"utimerexists """
(procedure "i2h:make" line 17)
invoked from within
"i2h:make"
(file "scripts/online.tcl" line 47)
invoked from within
"source scripts/online.tcl"
(file "paintballchannel.conf" line 159)
[20:21] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)

Sasq 12-12-2002 11:59 PM

hmmm I'll double check that. I have no problem here, which version of tcl are you using?

This weekend I will be releasing version 2 of the beta.

Lots of extra funtions, including options
Bot side
-> for the current forum calls the bot option
-> bot calls home to the fori with an update (small text file stored on the forum server) - you will need the http library installed.

-> forum side
a small (secure I think) call home php script for the bot (option 2 above)
->either the current online user display or
->user table lookup in the db to match (in this order) handle on the bot, nick, host name.
- This script will also keep users hidden if their user option is to be hidden on the forum (admin can still see).
- added funtions for users to overide the lookup like the '[on]' at the end of the nick to overide the hidden flag and '[me]' to overide if the user db lookup looks up the wrong person.


I just have a minor bug to fix and need to write the documentation for install.


edit here is the code from my running bot, double check to see if there is a difference
Quote:

if {[utimerexists ""] == ""} {utimer 60 i2h:make}
return 1
}

proc utimerexists {i2h:make} {
foreach j [utimers] {if {[string compare [lindex $j 1] i2h:make] == 0} {return [lindex $j 2]}}
return
}
Dan

PBC 12-13-2002 12:18 AM

Quote:

edit here is the code from my running bot, double check to see if there is a difference
There was no real difference that I could see, but I c/p'd the code and it works fine now...go figure.

Thanks! :D

thakikka 12-13-2002 05:01 PM

hi,

i just installed this hack and it seems to work perfectly.

thakikka
http://forum.ksgemeinde.de

Fus][oN 12-14-2002 08:25 AM

Thnx m8! nice hack! Works great over here!

Sasq 12-14-2002 08:49 AM

Ok, after much slaveing, swearing and doing much more then i planned to do, go back and read the first post

Lots added, the db lookup can be a little quirky but give it a go.

I'm open to idea's on how to make it more stable, either via vB adding users to the bot, or something maybe in the user cp for them to store their irc info in...

of course the easy way is just to add them to the bot so they can identify.

screen shot, of db lookup included here


Dan

off for a beer now :glasses:

Kars10 01-06-2003 07:44 AM

I like this hack! I have installed it and it works perfect!!
But the only thing i don?t like, are the query-count.
If the chatroom is empty i have no querys, but if there 15 or 20 Chatters in the Room i get 20 Querys or more on index...thats not so good i think.
Is there a way to reduce the querys?? ;)

Sasq 01-06-2003 07:55 AM

I think there probably should be ;)

Just let me get the hack I'm working on outa the way - or at least released and I'll get on this :)

Dan

Kars10 01-06-2003 08:19 AM

Cool, thank you sasq... ;)

Sasq 01-09-2003 12:17 PM

All updated and working here at least.

reduced it to one query :D should all be happy now.

Only change is in the index.php file.

Let me know how it goes, if all is well, I'll see about moving this over to Full release ;)

Dan

Kars10 01-09-2003 12:59 PM

Cool Thanks!!
Will test it this evening!! :)

streamzone 01-12-2003 09:54 PM

Awesome hack.. installed beautifully..

However, I think I found a bug...

For some reason if the irc server adds a ~ to the beginning of rh member Ident it shows up something like this on the the vb page...

Tech-Max|b~Tech-Max@WonderNu-User-25863.ka.g.xxxxx.xx

INSTEAD OF just Tech-Max|b...

this happens with every user where the irc server puts a ~ in front of the members name.

Can this be fixed?

Awesome work!

Greetz!
Streamzone

Sasq 01-12-2003 10:07 PM

The Bot script is ment to strip the ~ before it sends..

I'll get to it tonight.

Dan

streamzone 01-13-2003 08:26 PM

This is just a thought...

But most irc servers have the "/NAMES" command to look up who and how many folks are in a channel.. it's used like this =>

/NAMES #channelname

it then spits out a list of all the members in that channel with their status before their name (i.e. @, %, or +)... and WITHOUT their Ident information.

It has been my experience that when using the "/NAMES #channelname" command, the information is displayed in the "Server" window, NOT the "Channel" windows in mIRC.

My question is... in theory.. would it not be easier to invoke the "/NAMES #channelname" command instead of trying to strip off all the Ident info for the users?

Just a thought.

Thanks for you help.

Greetz!
StreamZone

Sasq 01-14-2003 11:58 AM

Sorry I've been tied down with a host that decided to upgrade, and leave me a few fires to stamp out.

The bot itself provides the name list from its own internal list of who is online, the change thats needed is minor, but I'm flat out at the moment dealing with a db problem :mad:

I' promise I'll get to it as soon as possible :)

Dan

streamzone 01-14-2003 12:42 PM

Thanks for you dedication Dan...

Very much appreciated...

Regards,
StreamZone

StevenTN 01-15-2003 07:19 PM

Question... I just installed this hack (local without DB at the moment), and I have a couple of questions/concerns:

1) Why can't I get commas separating the usernames like you guys seem to? It just shows up as "Steven Marc Bob..."
2) When I tried the DB, "at j4" popped up at the top, and only when a user had a "_" in it (it didn't match the DB. If users have a space in their name it's automatically replaced with a "_").

Sasq 01-15-2003 10:27 PM

Well all of my small (and large) fires are stamped out, I'll get to that fix in a day or two.

StevenTN: In the series 2 of the code I don't have commas being placed in, I can add them if you really want..

As far as I know, IRC doesn't allow spaces in user names, hence the "_" replacement.

Did the users nick's match their user name on the board when you tried to use the db.

When using the DB it tries to match the users registered handle on the bot first, if it doesn't match, then it tries the users nick, then the users name via the host mask. if it all fails it just prints the users nick without any links.

So it really depends on the correct information being available. I run a private IRC server so there is not a problem with nicks being unavailable.

If you can show me some examles of the whosonline output, what it displays and what the real name in the user db is, I'll see if I can find a fix

Dan

StevenTN 01-16-2003 02:45 PM

As far as the commas... it's really not me that wants them... it's the owner (for consistency with members online, staff online (another hack we added), and birthdays, so it would be nice

As far as the "_" in nicknames... I am very well aware that IRC doesn't allow spaces (hence the reason our IRC client automatically replaces those spaces with underscores). Like yours, it is a private IRC server (hybrid server and JPilot for the client), and I was basically wondering if there was something that allows us to check to see if they do or don't have the underscore (since there are some members with them in their nickname), and if they don't have their underscore in their board nick, switch it back.

For example, many of our moderators/admin have spaces in their name as well as members (Like Alex Westerman, Erik Johnson, or PKI MAN). There are also some members with nicknames like MST3K_FREAK6666, so somehow it's gotta be able to catch it.

If you need any more info, let me know and I'll get it.

Deathdealer 01-20-2003 03:38 PM

ok im sorry but im a bit lost i can user a bot either local or remote which i have tried both ways...lets start by going remote first... ok i have choosen :
Bot remote, file access remote, no db lookup:
usc.tcl
nodbremote.txt

ok in the index.php file i have it set like this :$onlinefile = "http://www.myweburl.com/forums/chat/user.txt"; //path to online users file
now in the usc.tcl i have it set like this set i2h_htmlfile "http://www.myweburlcom/forums/chat/user.txt".

which does not work....Im not understanding how the bot can write to a file on a diffrent server.
also i have tried to make the bot write to a file that i put in the bots main dir /home/bot/user.txt
either way the bot gets a error on startup and will not load.
----
Now on using the bot local and the vbb server local

I have a bot on the same server as the vbb but it has a diffrent login...how does that work ?

Deathdealer 01-21-2003 12:57 AM

nm i got it working

Sasq 01-21-2003 11:01 PM

I do appologise for my delay in modding this, I've been snowed under with work..
Promise to get to it soon.

Evil job, Evil job

Dan

streamzone 02-05-2003 03:02 PM

I still never got my issue fixed....

Been about a month now...

Sasq 02-05-2003 10:33 PM

Very sorry streamzone, been caught up with work (I'm quiting so they have an extra load on me atm) and some personal problems. If the wife allows me to have some play time this weekend I'll be able to get to it then.

Dan


All times are GMT. The time now is 04:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01475 seconds
  • Memory Usage 1,842KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete