egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Displaying the number of users on channels, in a webpage.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Apr 13, 2011 9:45 am    Post subject: Reply with quote

caesar wrote:
Quote:

if {"$nick" == "$botnick"} {

you should use the 'isbonick' function instead, or at least either 'string tolower' both variables


Right you are.
Thank you for catching this and pointing it out.

I've done this in the past, and it bit me in the butt, and I had to come back and I used string tolower to cover it.
(I must have a mental block... since I should know better now..sigh)

Question:
Does isbotnick take care of differences in case automatically?
I never thought to use isbotnick.....

Quote:

...
Here's my version of the code to exclude from the list:
[code]

bind time - "* * * * *" time:webusers

# Path to save text files.
set webusers(file) "you/need/to/edit/this/path/web_users.txt"
set webusers(count_file) "you/need/to/edit/this/path/web_users_count.txt"
set webusers(exclude) "bot1 bot2 bot3 user1 user2"


I think though, that he is looking for a way for the determination to happen automatically.... without having to maintain a list of nicks manually.

Quote:

proc cron:webusers {min hour day month year} {



The bind time above calls
time:webusers

Typo ?

....

Quote:

Eventually, instead of
[code]
[lsearch -nocase $webusers(exclude) $nick] == -1
[/code]
you could use:
[code]
[matchattr [nick2hand $nick] bf #AirfixDogfighter]
[/code]
to exclude all users that have the b or f flag, or whatever you wish for that specific channel or some global flags.


This is another form of a list that he'd have to maintain though.


I think that he owns the IRC server too, and requires all bots to set some mode on themselves... is it +B ? ....
such that a /whois has a line like this in it:
Quote:

Durga is a bot on irc.icq.com


We could do something where his bot sends a whois to each nick in the channel, and have a raw bind that traps for whatever numeric corresponds to that line.

If by now you are thinking that it is far easier (if the list is short and doesn't change very often) to maintain a simple list manually - I agree.

That doesn't mean that making it work automatically wouldn't be a fun project, just the for the heck of it. Smile
Back to top
View user's profile Send private message
rayvtirx
Voice


Joined: 31 May 2010
Posts: 16
Location: bristol,england

PostPosted: Wed Apr 13, 2011 11:16 am    Post subject: Reply with quote

doh!
i see, botnick is the nick of the bot this script is running on
oops Embarassed lol
its true all bots have to set +B but a whois every minute on every nick (although not a problem now) could cause problems if it ever got busy
ive gone back to the one you wrote its working great thanks
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Apr 13, 2011 2:33 pm    Post subject: Reply with quote

Ah, damn typo. Was going to redo the code using cron instead of time, but changed my mind and forgot about changing there too. Smile

I think 'isbotnick' function either dose the lowercase transformation before comparing (honestly doubt it's this method) or ignores it completely by using 'string equal -nocase' would be one of the ways to do it (I bet my money on this one).

Now, about that +B thing, well, it's easy as you said. All you need is a raw bind for that 'Durga is a bot on irc.icq.com' notice and add the host to a exclude list, either plain file or in the bot's internal userlist.

What happens if you would do a '/who #channel' Doesn't that 'B' flag show up or something?
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Apr 16, 2011 6:37 pm    Post subject: Reply with quote

caesar wrote:

...
What happens if you would do a '/who #channel' Doesn't that 'B' flag show up or something?


If this question was directed to me, ... Sorry, I don't know.
rayvtirx would have to try it and let you know.

But I think that flag is a mode flag set on each individual user, not a channel mode flag.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Apr 16, 2011 7:13 pm    Post subject: Reply with quote

Just a comment regarding "isbotnick" vs "string equal";
isbotnick uses the _rfc_casecmp(const char *, const char *) c function, which honors RFC1459 extended character sets, such as { and [ are the same character in upper/lowercase. String equal does not honor such mappings, regardless of the -nocase option.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber