This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

bots personal protection

Old posts that have not been replied to for several years.
D
Doom
Voice
Posts: 34
Joined: Fri Jun 20, 2003 9:33 am

bots personal protection

Post by Doom »

How can i make the http://www.egghelp.org/files/tcl/Azzurra.zip works for DALnet?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

#################################################################
#                      	       Azzurra		                #
#  		Script per il network DALnet		                #
#								                #
#            Written by IRC Club Staff (SerialCRACK)            #
#                       Managed by Sir_Fz		                #
#################################################################

### SETS
set identified 0
set CS_no_access 0
# Imposta qui la password del nick del bot.
# N.B.: E' obbligatorio registrare il nick se si vuole usare
#       questo script ed il bot deve essere almeno VOp nel canale.
set NS_pass ""

### BINDS
bind evnt - init-server init_NS_id
bind notc S "*This nick is owned by someone else.*" NS:ided
bind notc S "*is incorrect." CS:no_access
bind need - "* invite" azzurra:invite
bind need - "* unban" azzurra:unban
bind need - "* op" azzurra:op

if {![info exists NS:pass]} {die "TCL (Azzurra.tcl (E' necessario registrare il nick per poter usare questo script.))"}
adduser NickServ NickServ!service@dal.net
adduser ChanServ ChanServ!service@dal.net
chattr NickServ -hp+fS
chattr ChanServ -hp+fS

### PROCS
proc init_NS_id {type} {NS:id}

proc NS:id {} {
	global NS_pass
	putserv "PRIVMSG NickServ@services.dal.net :identify $NS_pass"
}

proc NS:ided {nick host hand text dest} {set identified 1}

proc CS:no_access {nick host hand text dest} {set CS_no_access 1}

proc azzurra:invite {chan type} {
	global identified
	if {$identified == 1} {
		putlog "Tento di invitarmi sul canale $chan tramite ChanServ."
		putquick "PRIVMSG ChanServ@services.dal.net :invite $chan"
		putserv "JOIN $chan"
	} else {NS:id}
}

proc azzurra:unban {chan type} {
	global identified
	if {$identified == 1} {
		putlog "Tento di rimuovermi il ban su $chan tramite ChanServ."
		putquick "PRIVMSG ChanServ@services.dal.net :unban $chan me"
		putserv "JOIN $chan"
	} else {NS:id}
}

proc azzurra:op {chan type} {
	global identified CS_no_access botnick
	if {$identified == 1} {
		if {$CS_no_access == 0} {
			putlog "Tento di riprendermi l'op su $chan tramite ChanServ."
			putquick "PRIVMSG ChanServ@services.dal.net :op $chan $botnick"
		} else {putlog "Non è possibile riprendere l'op su $chan : \"Accesso negato\"."}
	} else {set CS_no_access 0 ; NS:id}
}

putlog "TCL Script: Azzurra for DALnet v1.0 created by IRC managed by Sir_Fz Club Staff - http://irc-club.6go.net"
I think I got it right, this one will work for DALnet.
D
Doom
Voice
Posts: 34
Joined: Fri Jun 20, 2003 9:33 am

Post by Doom »

i added some code in it:
#################################################################
# Azzurra #
# Script per il network DALnet #
# #
# Written by IRC Club Staff (SerialCRACK) #
# Managed by Sir_Fz #
#################################################################

### SETS
set identified 0
set CS_no_access 0
# Imposta qui la password del nick del bot.
# N.B.: E' obbligatorio registrare il nick se si vuole usare
# questo script ed il bot deve essere almeno VOp nel canale.
set NS_pass "ircsandzak960081"

### BINDS
bind evnt - init-server init_NS_id
bind notc S "*This nick is owned by someone else.*" NS:ided
bind notc S "*is incorrect." CS:no_access
bind need - "* invite" azzurra:invite
bind need - "* unban" azzurra:unban
bind need - "* op" azzurra:op

if {![info exists NS:pass]} {die "TCL (Azzurra.tcl (E' necessario registrare il nick per poter usare questo script.))"}
adduser NickServ NickServ!service@dal.net
adduser ChanServ ChanServ!service@dal.net
chattr NickServ -hp+fS
chattr ChanServ -hp+fS

### PROCS
proc init_NS_id {type} {NS:id}

proc NS:id {} {
global NS_pass
putserv "PRIVMSG NickServ@services.dal.net :identify Sandzak $NS_pass"
}

proc NS:ided {nick host hand text dest} {set identified 1}

proc CS:no_access {nick host hand text dest} {set CS_no_access 1}

proc azzurra:invite {chan type} {
global identified
if {$identified == 1} {
putlog "Pokusavam da invajtujem sebe na $chan preko Chanserv-a."
putquick "PRIVMSG ChanServ@services.dal.net :invite $chan"
putserv "JOIN $chan"
} else {NS:id}
}

proc azzurra:unban {chan type} {
global identified
if {$identified == 1} {
putlog "Pokusavam da Izbrisem ban na $chan preko Chanserv-a."
putquick "PRIVMSG ChanServ@services.dal.net :unban $chan me"
putserv "JOIN $chan"
} else {NS:id}
}

proc azzurra:op {chan type} {
global identified CS_no_access botnick
if {$identified == 1} {
if {$CS_no_access == 0} {
putlog "Pokusavam da se opnem preko ChanServ-a."
putquick "PRIVMSG ChanServ@services.dal.net :op $chan $botnick"
} else {putlog "Nemoguce je dobit op od Chanserva : \"Access Denied\"."}
} else {set CS_no_access 0 ; NS:id}
}

putlog "TCL Script: Azzurra for DALnet v1.0 created by IRC managed by Sir_Fz Club Staff - http://irc-club.6go.net"

### bot unbans him self if he is op
bind mode -|- "* +b" ban:check
# Catches all bans

proc ban:check { nick address handle channel mode victim } {
if { [string match [string tolower $victim] [string tolower "$botnick!$botname"]] } {
# If the bot was banned...
pushmode $channel -o $nick
pushmode $channe -b $victim
# Deop the user & unban
}
}
and when i loaded tcl script and typed .rehash into, bot msg me that and died
*** BOT SHUTDOWN (TCL (Azzurra.tcl (E' necessario registrare il nick per poter usare questo script.)))
[21:43:45] <bot> [12:38] * TCL (Azzurra.tcl (E' necessario registrare il nick per poter usare questo script.))
[21:43:45] <bot> [17] Chat closed
any ide why this happend?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Replace from:

Code: Select all

if {![info exists NS:pass]} {die "TCL (Azzurra.tcl (E' necessario registrare il nick per poter usare questo script.))"} 
to:

Code: Select all

if {![info exists NS_pass]} {die "TCL (Azzurra.tcl (E' necessario registrare il nick per poter usare questo script.))"} 
I wonder if Sir_Fz dosen't have the same *problem* with the NS_pass thing :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

No, i never used this script, I use another script that only identifies the bot with nickserv and ops the bot when identified.

as for the needs, I just use the eggdrop's need-unban, need-op, need-limit.....

y're u asking ?, all I did is change from nickserv to nickserv@services.dal.net.... and the notice string... lol :P
D
Doom
Voice
Posts: 34
Joined: Fri Jun 20, 2003 9:33 am

Post by Doom »

proc azzurra:invite {chan type} {
global identified
if {$identified == 1} {
putlog "Pokusavam da invajtujem sebe na $chan preko Chanserv-a."
putquick "PRIVMSG ChanServ@services.dal.net :invite $chan"
putserv "JOIN $chan"
} else {NS:id}
}

if it is mode +i the bot cant join chan...he just Identify him self lots of time but he never join channel

Tcl error [ban:check]: can't read "botnick": no such variable
and then there is something wrong there too?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I sugest you get another script for this cos this is a little (more?) buggy.. Something like IRC Services by MC8.
Once the game is over, the king and the pawn go back in the same box.
D
Doom
Voice
Posts: 34
Joined: Fri Jun 20, 2003 9:33 am

Post by Doom »

### bot unbans him self if he is op
bind mode -|- "* +b" ban:check
# Catches all bans

proc ban:check { nick address handle channel mode victim } {
if { [string match [string tolower $victim] [string tolower "$botnick!$botname"]] } {
# If the bot was banned...
pushmode $channel -o $nick
pushmode $channe -b $victim
# Deop the user & unban
}
}

ok i see, that one is more advanced and probably better...but there is no protection for the code up there...but like you said there is some bugs..can you fix the bugs pls.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Here is my version of the script:

Code: Select all

# What user and password should the eggdrop use to loign to NickServ?
set dalnet(stuff) "user password"

#
###
#### Done with configurations, do not edit past here unless you know TCL!
###
#

# binds #
bind mode - "* +b" my:channel:ban

##
# user/pass?
if {[llength $dalnet(stuff)] == 2} {
  bind evnt - init-server my:connect
  bind notc f "*is incorrect." oups:no:access
  bind notc f "This nick is owned by someone else. Please choose another." ns:my:login
  bind need - * cs:my:needs
}

##
# services?
if {![validuser Services]} {
  adduser Services
  setuser Services HOSTS NickServ!service@dal.net 
  setuser Services HOSTS ChanServ!service@dal.net 
  chattr Services -hp+f
  putlog "Added ChanServ and NickServ to user Services."
}

##
# connect login
proc my:connect init-server {
  putquick "PRIVMSG X@channels.undernet.org :login [lindex $::x(stuff) 0] [lindex $::x(stuff) 1]" -next
  putquick "MODE $::botnick +x" -next
}

##
# relogin
proc ns:my:login {nick uhost hand text dest} {
  if {[lindex [split $dest "@"] 0] != $::botnick} {
    return
  }
  putquick "PRIVMSG NickServ@services.dal.net :identify [lindex $::dalnet(stuff) 0] [lindex $::dalnet(stuff) 1]" -next
}

##
# something wrong
proc oups:no:access {nick uhost hand text dest} {
  if {[lindex [split $dest "@"] 0] != $::botnick} {
    return
  }
  putlog "\002Warning!\002 There is something wrong with my user/password cos I can't login to NickServ.. ;("
}

##
# channel ban
proc channel:ban {nick uhost hand chan mc ban} {
  if {![botisop $chan] || ![string match "$ban" "$::botname"]} {
    return
  }
  putquick "MODE $chan -bo $ban $nick" -next
}

##
# ChanServ needs
proc cs:my:needs {channel type} { 
  switch -- [strlwr $type] {
    "op" {
      if  {![onchan ChanServ $channel]} {
        return 1
      }
      putserv "PRIVMSG ChanServ@services.dal.net :op $channel"
      return 1
    }
    "unban" {
      putserv "PRIVMSG ChanServ@services.dal.net :unban $channel"
      return 1
    }
    "invite" {
      putserv "PRIVMSG ChanServ@services.dal.net :invite $channel"
      return 1
    }
    "limit" {
      putserv "PRIVMSG ChanServ@services.dal.net :invite $channel"
      return 1
    }
  }
}

putlog "dalnet.tcl.. loaded."
Just tell me if something is wrong. Also, please do change the user and password in the cs(stuff) thing.
Once the game is over, the king and the pawn go back in the same box.
D
Doom
Voice
Posts: 34
Joined: Fri Jun 20, 2003 9:33 am

Post by Doom »

[15:52:47] *** Doom sets mode: -o Bot
[15:53:00] *** Doom sets mode: +o Bot
-
[15:53:26] *** Bot was kicked by Doom
[15:53:26] *** Doom sets mode: +b *!*identd@free.host.org
[15:53:40] *** Doom sets mode: -b *!*identd@free.host.org
-
[15:54:19] *** Doom sets mode: +l 5
[15:54:23] *** Bot was kicked by Doom
[15:54:40] *** Doom sets mode: -l
-
[16:01:35] *** Doom sets mode: +i
[16:01:48] *** Bot was kicked by Doom
[16:02:14] *** Doom sets mode: -i
1) when I Deoped Him he didn't oped him self again using Chanserv
2) when i Kick banned him , he didnt Unban and him and Join Channel agaun
3) when i set +l he didn't Invite him into Chan again
4) When i set mode +i he didn't invite him self in the channel.
-
[15:50:14] <(Sandzak> [06:40] Tcl error [my:channel:ban]: invalid command name "my:channel:ban"
[15:53:06] <(Sandzak> [06:42] Tcl error [my:channel:ban]: invalid command name "my:channel:ban"
This was the errors i got in Dcc Chat when i was testing bot
--

Thanks for all help before i hope you'll help me again :)[/quote]
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Oups, I've forgot the my: thing.. replace from:

Code: Select all

proc channel:ban {nick uhost hand chan mc ban} { 
to:

Code: Select all

proc my:channel:ban {nick uhost hand chan mc ban} { 
Have you changed the "dalnet(stuff)" to "user password"? he should aks for his needs only if the user and password are set in the dalnet(stuff) thing. It should ask for what he needs, just wait a bit longer and see what happens.
Once the game is over, the king and the pawn go back in the same box.
D
Doom
Voice
Posts: 34
Joined: Fri Jun 20, 2003 9:33 am

Post by Doom »

# What user and password should the eggdrop use to loign to NickServ?
set dalnet(stuff) "user password"
yeah i've set "set dalnet(stuff) "user password" " to my bots passwd
# ChanServ needs
proc cs:my:needs {channel type} {
switch -- [strlwr $type] {
"op" {
if {![onchan ChanServ $channel]} {
return 1
Can you explain this? should this be set to " if {![onchan ChanServ $channel]} {
PRIVMSG ChanServ@services.dal.net :op $chan } "
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

If Chanserv is not on channel then nothing should happen.. remove that if in case the ChanServ is invisible or something..
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Well on DALnet in order to use chanserv for :
1. INVITE : "msg chanserv@services.dal.net :invite $channel $botnick"
2. UNBAN : "msg chanserv@services.dal.net :unban $channel"
3. OP : "msg chanserv@services.dal.net :op $channel $botnick"

as for need-limit, we also use invite on DALnet.
so fix this in caesar's Code and it should work, I think
D
Doom
Voice
Posts: 34
Joined: Fri Jun 20, 2003 9:33 am

Post by Doom »

Code: Select all

    "op" { 
      putserv "msg chanserv@services.dal.net :op $channel $botnick" 
      return 1 
    } 
    "unban" { 
      putserv "MSG ChanServ@services.dal.net :unban $channel" 
      return 1 
    } 
    "invite" { 
      putserv "MSG ChanServ@services.dal.net :invite $channel $botnick" 
      return 1 
    } 
    "limit" { 
      putserv "MSG ChanServ@services.dal.net :invite $channel $botnick" 
      return 1 
    } 
  } 
} 
Tcl error [cs:my:needs]: can't read "botnick": no such variable hmmmm??
Locked