| View previous topic :: View next topic |
| Author |
Message |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Wed Apr 13, 2011 9:45 am Post subject: |
|
|
| 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.  |
|
| Back to top |
|
 |
rayvtirx Voice
Joined: 31 May 2010 Posts: 16 Location: bristol,england
|
Posted: Wed Apr 13, 2011 11:16 am Post subject: |
|
|
doh!
i see, botnick is the nick of the bot this script is running on
oops 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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Apr 13, 2011 2:33 pm Post subject: |
|
|
Ah, damn typo. Was going to redo the code using cron instead of time, but changed my mind and forgot about changing there too.
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Apr 16, 2011 6:37 pm Post subject: |
|
|
| 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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Apr 16, 2011 7:13 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
|