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 

Q auth

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


Joined: 20 Aug 2006
Posts: 10

PostPosted: Fri Jan 05, 2007 10:44 am    Post subject: Q auth Reply with quote

Code:

bind raw - 354 qauth:who_info
bind raw - 315 qauth:end_of_who
bind pub - !auth qauth:who_pubcmd

proc getchanlogin {nick} {
  if {$nick == ""} { return }
  putquick "WHO $nick n%na"
  sleep 1000
  global whois_replyarray
  set auth $whois_replyarray($nick)
  return $auth
}

proc qauth:who_info {from keyword text} {
  global whois_replyarray
  set targetnick [lindex $text 1]
  set auth [lindex $text 2]
  set whois_replyarray($targetnick) $auth
}

proc qauth:end_of_who {from keyword text} {
  global whois_replyarray
  set targetnick [lindex [split $text] 1]
  if {![info exists whois_replyarray($targetnick)]} {
    set whois_replyarray($targetnick) 0
  }
}

proc sleep {time} {
  after $time set end 1
  vwait end
}

proc qauth:who_pubcmd {nick host hand chan text} {
  putchan "#secretchannel" [getchanlogin $text]
}


I need to get auth from nick. I have seen many scripts, but they usually are taking auth name only from nicks who are in same channel where is the bot. I need to get their auth even, if he isn't in any channel.
This code problem, is that it dosent show auth name on first request.
Back to top
View user's profile Send private message
smash
Halfop


Joined: 31 Jul 2006
Posts: 45

PostPosted: Sat Jan 06, 2007 12:07 am    Post subject: Reply with quote

Code:
# Author : MeTroiD, #v1per on Quakenet.
   # Please don't be lame and rip my script.
   # I've made it for Quakenet but i assume if the ircd you want to use it on has the same RAW's you can use it just fine.
   set whois(author) "MeTroiD, #v1per on Quakenet"   

   # Version History
   # 0.1      - Made a start, first expermimental test.
   # 0.2-0.5  - Finished some more code
   # 0.6-0.8  - The script was fully functional
   # 0.9      - Removed some silly crap that didnt work for Quakenet anyhow (shows which server he was on)
   # 1.0      - Cleaned some of the code, and it works fine on Quakenet, It also shows idle time and signon time now.
   set whois(version) "0.10"
   # End of Version History

   # Config:
   # What is the minimum access someone needs to perform a whois with the bot?
   # o = global op, m = global master, n = global owner
   # |o = channel op, |m = channel master, |n = channel owner
   set whois(acc) "n|n"
   # End of Config

   bind pub $whois(acc) "!whois" whois:nick

   proc whois:nick { nickname hostname handle channel arguments } {
   global whois
      set target [lindex [split $arguments] 0]
   if {$target == ""} {
   putquick "PRIVMSG $channel :Please choose a target first."
   return 0
   }
   if {[string length $target] >= "14"} {
   putquick "PRIVMSG $channel :Sorry, That nickname is too long. Please try a user with less than 14 characters."; return
   }
   if {[regexp -all -- {[~\[\]\{\}\|\_\\]} $target]} {
   putquick "PRIVMSG $channel :Sorry, I can't whois a user with special characters in it."; return
   }
   putquick "WHOIS $target $target"
      set ::whoischannel $channel
   set ::whoistarget $target
   bind RAW - 401 whois:nosuch
   bind RAW - 311 whois:info
   bind RAW - 319 whois:channels
   bind RAW - 301 whois:away
   bind RAW - 313 whois:ircop
   bind RAW - 330 whois:auth
   bind RAW - 317 whois:idle
   }

   proc whois:putmsg { channel arguments } {
      putquick "PRIVMSG $channel :$arguments"
   }

   proc whois:info { from keyword arguments } {
      set channel $::whoischannel
      set nickname [lindex [split $arguments] 1]
      set ident [lindex [split $arguments] 2]
      set host [lindex [split $arguments] 3]
      set realname [string range [join [lrange $arguments 5 end]] 1 end]
      whois:putmsg $channel "$nickname - $ident@$host * $realname"
      unbind RAW - 311 whois:info
   }

   proc whois:ircop { from keyword arguments } {
      set channel $::whoischannel
      set target $::whoistarget
      whois:putmsg $channel "$target is an IRC Operator"
      unbind RAW - 313 whois:ircop
   }

   proc whois:away { from keyword arguments } {
      set channel $::whoischannel
      set target $::whoistarget
      set awaymessage [string range [join [lrange $arguments 2 end]] 1 end]
      whois:putmsg $channel "$target is away: $awaymessage"
      unbind RAW - 301 whois:away
   }

   proc whois:channels { from keyword arguments } {
      set channel $::whoischannel
      set channels [string range [join [lrange $arguments 2 end]] 1 end]
      set target $::whoistarget
      whois:putmsg $channel "$target on $channels"
      unbind RAW - 319 whois:channels
   }

   proc whois:auth { from keyword arguments } {
      set channel $::whoischannel
      set target $::whoistarget
      set authname [lindex [split $arguments] 2]
      whois:putmsg $channel "$target is authed as $authname"
      unbind RAW - 330 whois:auth
   }

   proc whois:nosuch { from keyword arguments } {
      set channel $::whoischannel
      set target $::whoistarget
      whois:putmsg $channel "No such nickname \"$target\""
      unbind RAW - 401 whois:nosuch
   }

   proc whois:idle { from keyword arguments } {
      set channel $::whoischannel
      set target $::whoistarget
      set idletime [lindex [split $arguments] 2]
      set signon [lindex [split $arguments] 3]
      whois:putmsg $channel "$target has been idle for [duration $idletime]. signon time [ctime $signon]"
      unbind RAW - 317 whois:idle
   }

   putlog "Public whois script $whois(version) by $whois(author)"
Back to top
View user's profile Send private message
innu
Voice


Joined: 20 Aug 2006
Posts: 10

PostPosted: Sat Jan 06, 2007 7:17 am    Post subject: Reply with quote

put auth to channel or nick isn't hard. But i need to use auth-s in other procs. So somehow i need to return auth name.

Last edited by innu on Sat Jan 06, 2007 5:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Jan 06, 2007 3:53 pm    Post subject: Reply with quote

wow, that script is old Smile

(it's also not that good as it doesn't always remove the binds, I made a better one later)
Back to top
View user's profile Send private message
innu
Voice


Joined: 20 Aug 2006
Posts: 10

PostPosted: Mon Jan 08, 2007 6:21 pm    Post subject: Reply with quote

still need help!
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 -> 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