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 

help me on join chan auto whois code pls

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


Joined: 01 Aug 2022
Posts: 10

PostPosted: Mon Aug 01, 2022 1:00 am    Post subject: help me on join chan auto whois code pls Reply with quote

hello all

help me on join chan auto whois code pls code ..


Code:
##############################################################################################
##  ##     whois.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help        ##  ##
##############################################################################################
## To use this script you must set channel flag +whois (ie .chanset #chan +whois)           ##
##############################################################################################
##      ____                __                 ###########################################  ##
##     / __/___ _ ___ _ ___/ /____ ___   ___   ###########################################  ##
##    / _/ / _ `// _ `// _  // __// _ \ / _ \  ###########################################  ##
##   /___/ \_, / \_, / \_,_//_/   \___// .__/  ###########################################  ##
##        /___/ /___/                 /_/      ###########################################  ##
##                                             ###########################################  ##
##############################################################################################
##  ##                             Start Setup.                                         ##  ##
##############################################################################################
namespace eval whois {
## change cmdchar to the trigger you want to use                                        ##  ##
  variable cmdchar "!"
## change command to the word trigger you would like to use.                            ##  ##
## Keep in mind, This will also change the .chanset +/-command                          ##  ##
  variable command "whois"
## change textf to the colors you want for the text.                                    ##  ##
  variable textf "\017\00302"
## change tagf to the colors you want for tags:                                         ##  ##
  variable tagf "\017\002"
## Change logo to the logo you want at the start of the line.                           ##  ##
  variable logo "\017\00304\002\[\00306W\003hois\00304\]\017"
## Change lineout to the results you want. Valid results are channel users modes topic  ##  ##
  variable lineout "channel users modes topic"
##############################################################################################
##  ##                           End Setup.                                              ## ##
##############################################################################################
  variable channel ""
  setudef flag $whois::command
  bind pub -|- [string trimleft $whois::cmdchar]${whois::command} whois::lst
  bind raw -|- "311" whois::311
  bind raw -|- "312" whois::312
  bind raw -|- "319" whois::319
  bind raw -|- "317" whois::317
  bind raw -|- "313" whois::multi
  bind raw -|- "310" whois::multi
  bind raw -|- "335" whois::multi
  bind raw -|- "301" whois::301
  bind raw -|- "671" whois::multi
  bind raw -|- "320" whois::multi
  bind raw -|- "401" whois::multi
  bind raw -|- "318" whois::318
  bind raw -|- "307" whois::307
}
proc whois::311 {from key text} {
  if {[regexp -- {^[^\s]+\s(.+?)\s(.+?)\s(.+?)\s\*\s\:(.+)$} $text wholematch nick ident host realname]} {
    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Nick e IP virtual:${whois::textf} \
        $nick \(${ident}@${host}\)"
   putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Nombre:${whois::textf} $realname"
  }
}
proc whois::multi {from key text} {
  if {[regexp {\:(.*)$} $text match $key]} {
  set keys [subst $$key]
  set keys [lrange $keys 4 8]
  if {"$keys" == "Nick no presente en IRC"} { set keys [encoding convertfrom utf-8 "El nick que buscas, no está conectado al IRC."];
      putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Info:${whois::textf} $keys";
         return 1   
   }   
  }
}
proc whois::312 {from key text} {
  regexp {([^\s]+)\s\:} $text match server
  putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Servidor:${whois::textf} $server"
}
proc whois::319 {from key text} {
  if {[regexp {.+\:(.+)$} $text match channels]} {
    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Canales:${whois::textf} $channels"
  }
}
proc whois::317 {from key text} {
  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {
  set signonsp [duration [expr [unixtime] - $::uptime]]
  set signonsp [string map [list "year" "años" "years" "años" "month" "mes" "months" "meses" "week" "semana" "weeks" "semanas" "day" "día" "days" "días" "hour" "hora" "hours" "horas" "minute" "minuto" "minutes" "minutos" "second" "segundo" "seconds" "segundos"] $signonsp]
  set idlesp [duration $idle]
  set idlesp [string map [list "year" "años" "years" "años" "month" "mes" "months" "meses" "week" "semana" "weeks" "semanas" "day" "día" "days" "días" "hour" "hora" "hours" "horas" "minute" "minuto" "minutes" "minutos" "second" "segundo" "seconds" "segundos"] $idlesp]
    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Conectado :${whois::textf} \
        $signonsp ${whois::tagf}Inactivo:${whois::textf} $idlesp"
  }
}
proc whois::301 {from key text} {
  if {[regexp {^.+\s[^\s]+\s\:(.*)$} $text match awaymsg]} {
    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Away:${whois::textf} $awaymsg"
  }
}
proc whois::318 {from key text} {
  namespace eval whois {
        variable channel ""
  }
  variable whois::channel ""
}
proc whois::307 {from key text} {
  putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Estado:${whois::textf} Nick Registrado"
}
proc whois::lst {nick host hand chan text} {
  if {[lsearch -exact [channel info $chan] "+${whois::command}"] != -1} {
    namespace eval whois {
          variable channel ""
        }
    variable whois::channel $chan
##In the chathispano network the correct command is '/whois nick nick', if you put only '/whois nick' the network hidden  'uptime' and 'idle'  information of nick.##
    putserv "WHOIS $text $text"
  }
}
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1058
Location: France

PostPosted: Mon Aug 01, 2022 1:32 am    Post subject: Reply with quote

What is the trouble ? You just want to make the script run automatically on join ?
Add a bind join.
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Mon Aug 01, 2022 3:58 am    Post subject: Reply with quote

That's gonna be extremely spammy tho and possibly have your bot disconnect due to excess flood (excessive command use )
Back to top
View user's profile Send private message
kn1ghtt
Voice


Joined: 01 Aug 2022
Posts: 10

PostPosted: Mon Aug 01, 2022 9:15 am    Post subject: Reply with quote

example :

Code:
set whois_debugchan "#canal_ops"
set whois_mainchan "#canal"

bind join -|- * whois_cmd
bind raw -|- "319" whois_channels

proc whois_cmd {n u h c} {
   global whois_mainchan
   if {[string tolower $c] == [string tolower $whois_mainchan]} {
      putserv "WHOIS $n"
   }
}

proc whois_channels {f k t} {
   global whois_debugchan whois_mainchan botnick
   set whois_nick [lindex [split $t " "] 1]
   set whois_chan [string range [lindex [lrange [split $t " "] 2 end-1]] 1 end]
   if {$whois_nick != $botnick } {
      putserv "PRIVMSG $whois_debugchan :Canales de \002$whois_nick\002 -> $whois_chan"
   }
}

putlog "Script autowhois cargado"




bot: (Join) nick ident@vhost ingresa a #chan
bot: Modos: CHaN aplica +v nick en #chan
bot: (Realname) realnamenick
bot: (channels) #chan1 #chan2 chan3
bot: (IP) vhost.aqui de nick
bot: (Nodo) server.connect
bot: (ID) nick ident Chat
bot: (Conectado) 8secs (Inactividad) 5secs de nick
bot: (Quit) nick Deja el canal #chan


please help me and code
Back to top
View user's profile Send private message
kn1ghtt
Voice


Joined: 01 Aug 2022
Posts: 10

PostPosted: Mon Aug 01, 2022 1:01 pm    Post subject: Reply with quote

CrazyCat wrote:
What is the trouble ? You just want to make the script run automatically on join ?
Add a bind join.


yes automatically on join whois

channel1 "#channel"
channelreport "#channelbotinfowhois"

example bot report #channelbotinfowhois join user #channel

bot: (Join) nick ident@vhost ingresa a #chan
bot: Modos: CHaN aplica +v nick en #chan
bot: (Realname) realnamenick
bot: (channels) #chan1 #chan2 chan3
bot: (IP) vhost.aqui de nick
bot: (Nodo) server.connect
bot: (ID) nick ident Chat
bot: (Conectado) 8secs (Inactividad) 5secs de nick
bot: (Quit) nick Deja el canal #chan
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