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 

Detecting a users umodes (not flags) in a tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
neo42
Voice


Joined: 19 Jul 2006
Posts: 5
Location: Alabama

PostPosted: Thu Jul 20, 2006 12:09 am    Post subject: Detecting a users umodes (not flags) in a tcl Reply with quote

I'd like for my "doorkeeper" script to kick/ban a user whose nick is not registered or has expired. I know that umodes like +o and +v are handled by isop(), isvoice(), etc... Is there a way to get/parse a user's umodes to determine if other modes (+r in this instance) are set? I've checked FAQ's, searched, done my homework... can't find reference to this anywhere. Ideas anybody?
_________________
--------------------------------------------
Neo42
NetAdmin, StrandedIRC
irc://irc.strandedirc.com:7000
Come join us on the #island, mon! Smile
ethercrash@yahoo.com
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Thu Jul 20, 2006 4:49 am    Post subject: Reply with quote

You will have to relay on the raw reply from whois to contain "blabla is a registered nick" or use a "MODE blabla" and bind RAW MODE to see if it replys something about +r (or +R, depending on ircd).
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
neo42
Voice


Joined: 19 Jul 2006
Posts: 5
Location: Alabama

PostPosted: Fri Jul 21, 2006 3:27 pm    Post subject: Reply with quote

That's kinda what I thought... I had tried a couple things along that line, but nothing has worked yet. I'll dig up what I tried and post the code in a bit. Thanks for the reply.
_________________
--------------------------------------------
Neo42
NetAdmin, StrandedIRC
irc://irc.strandedirc.com:7000
Come join us on the #island, mon! Smile
ethercrash@yahoo.com
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
neo42
Voice


Joined: 19 Jul 2006
Posts: 5
Location: Alabama

PostPosted: Fri Jul 21, 2006 6:44 pm    Post subject: Reply with quote

OK here goes... This is the script as it currently exists. It properly executes the whois, but seems to do nothing with the 379 numeric, which on Unreal Ircd is REPL_WHOISMODES. I can get the mode string with mIRC, so I know the reply is being made.

Code:

setudef flag sentry   # channel must have +sentry
bind raw - 379 test:whois
bind join * *!*@* exec:whois

proc test:whois { from keyword text } {
  putquick "PRIVMSG #mychan :$text"   # just dump reply into chan
}

proc exec:whois {nick uhost handle chan} {
set chan [string tolower $chan]
 if {[channel get $chan sentry]} {
   putserv "whois $nick"
 }
}

putlog "gatekeeper.tcl has been loaded successfully. (c)Neo42"

_________________
--------------------------------------------
Neo42
NetAdmin, StrandedIRC
irc://irc.strandedirc.com:7000
Come join us on the #island, mon! Smile
ethercrash@yahoo.com
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sat Jul 22, 2006 7:14 am    Post subject: Reply with quote

as "De_Kus2" made "WHOIS De_Kus":
Quote:
:irc.shockerz.net 307 De_Kus2 De_Kus :has identified for this nick

_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
neo42
Voice


Joined: 19 Jul 2006
Posts: 5
Location: Alabama

PostPosted: Sat Jul 22, 2006 8:20 am    Post subject: Reply with quote

Yep. I know about 307. Trick is, I want something to happen when a user is not registered. Not as easy as trapping the 307. It should be simple to take the reply from 379, split it, and check for "r" in the umode string, but for some reason the bot isn't getting the 379 response.
_________________
--------------------------------------------
Neo42
NetAdmin, StrandedIRC
irc://irc.strandedirc.com:7000
Come join us on the #island, mon! Smile
ethercrash@yahoo.com
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Jul 22, 2006 9:09 am    Post subject: Reply with quote

neo42 wrote:
Yep. I know about 307. Trick is, I want something to happen when a user is not registered.


then catch the "End of /WHOIS List" numeric reply

if you still haven't received 307 upon receiving EOW, the nick is not registered (needless to say, you need to maintain track of nicks you inquired about by sending WHOIS; this is commonly done using Tcl's associative arrays)
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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