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 

opers.tcl [SOLVED]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Tue Dec 05, 2006 7:29 pm    Post subject: opers.tcl [SOLVED] Reply with quote

hey all
i have this script her what do i need to change so my staff can use the functions as weel at the moment i am the only who can use them...?

Code:
# opers tcl version1.0
# techie
# http://www.linuxirc.com

bind pub o !h pub:h
bind pub o !c pub:c
bind pub o !op pub:op
bind pub o !vo pub:vo
bind pub o !devo pub:devo
bind pub o !k pub:kick
bind pub o !b pub:ban
bind pub o !ub pub:ub
bind pub o !kb pub:kb
bind pub o !hop pub:hop
bind pub o !dehop pub:dehop
bind pub o !t pub:topic
bind pub - !p pub:p
bind pub n !jump pub:jump
bind pub n !die pub:die
bind pub o !status pub:status
bind pub o !broadcast pub:broadcast
bind pub o !deop pub:deop
bind pub o !info pub:info

proc pub:h {nick uhost hand chan text} {
  puthelp "NOTICE $nick :!c !op !deop !hop !dehop !vo !devo !k !b !ub !kb !t !p !info !jump !die !status
!broadcast"
}

proc pub:c {nick uhost hand chan text} {
  if {[botisop $chan] == 1} {
    if {[isop $nick $chan] == 1} { pushmode $chan -o $nick } else { pushmode $chan +o $nick }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:op {nick uhost hand chan text} {
  if {[botisop $chan] == 1} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[onchan $tnick $chan]} {
        if {[onchan $tnick $chan]} { pushmode $chan +o $tnick }
      } else { puthelp "NOTICE $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !op <nick> -  ops a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}
proc pub:deop {nick uhost hand chan text} {
  if {[botisop $chan] == 1} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[onchan $tnick $chan]} {
        if {[onchan $tnick $chan]} { pushmode $chan -o $tnick }
      } else { puthelp "NOTICE $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !deop <nick> - deop a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}


proc pub:vo {nick uhost hand chan text} {
  if {[botisop $chan] == 1} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[onchan $tnick $chan]} {
        if {[onchan $tnick $chan]} { pushmode $chan +v $tnick }
      } else { puthelp "NOTICE $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !vo <nick> - voices a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:devo {nick uhost hand chan text} {
  if {[botisop $chan] == 1} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[onchan $tnick $chan]} {
        if {[onchan $tnick $chan]} { pushmode $chan -v $tnick }
      } else { puthelp "NOTICE $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !devo <nick> - devoices a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:hop {nick uhost hand chan text} {
  if {[botisop $chan] == 1} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[onchan $tnick $chan]} {
        if {[onchan $tnick $chan]} { pushmode $chan +h $tnick }
      } else { puthelp "NOTICE $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !hop <nick> - hop a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:dehop {nick uhost hand chan text} {
  if {[botisop $chan] == 1} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[onchan $tnick $chan]} {
        if {[onchan $tnick $chan]} { pushmode $chan -h $tnick }
      } else { puthelp "NOTICE $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !dehop <nick> - dehop a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}



proc pub:kick {nick uhost hand chan text} {
  if {[botisop $chan]} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[string length [lindex $text 1]] == 0} { set reason kicked } else { set reason [lrange $text 1 end] }
      if {[onchan $tnick $chan]} { putkick $chan $tnick $reason } else { puthelp "NOTICE $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !k <nick> reason - kicks a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:ban {nick uhost hand chan text} {
  if {[botisop $chan]} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[onchan $tnick $chan]} {
        if {[string length [lindex $text 1]] == 0} { set reason banned } else { set reason [lrange $text 1 end] }
        newchanban $chan *!*@[lindex [split [getchanhost $tnick $chan] @] 1] $nick $reason 10
      } else { puthelp "notice $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !b <nick> reason - bans a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:ub {nick uhost hand chan text} {
  if {[botisop $chan]} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[ischanban $tnick $chan]} { killchanban $chan $tnick } else { puthelp "NOTICE $nick :no such ban on $chan" }
    } else { puthelp "NOTICE $nick :usage !ub <nick!user@host> - unbans an address" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:kb {nick uhost hand chan text} {
  if {[botisop $chan]} {
    if {[string length $text] > 0} {
      set tnick [lindex $text 0]
      if {[onchan $tnick $chan]} {
        if {[string length [lindex $text 1]] == 0} { set reason banned } else { set reason [lrange $text 1 end] }
        newchanban $chan *!*@[lindex [split [getchanhost $tnick $chan] @] 1] $nick $reason 10
        utimer 5 [putkick $chan $tnick $reason]
      } else { puthelp "notice $nick :no such nick on channel!" }
    } else { puthelp "NOTICE $nick :usage !kb <nick> reason - kicks and bans a nick" }
  } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:topic {nick uhost hand chan text} {
  if {[botisop $chan]} { putserv "TOPIC $chan :$text" } else { puthelp "NOTICE $nick :i dont have ops!" }
}

proc pub:p {nick uhost hand chan text} { putserv "PRIVMSG $chan :connected!" }

proc pub:jump {nick uhost hand chan text} { jump $text }

proc pub:die {nick uhost hand chan text} { die $text }

proc pub:info {nick uhost hand chan test} { putserv "PRIVMSG $chan :opers.tcl version 1.0" }


proc pub:status {nick uhost hand chan text} {
  global server botname version
  puthelp "PRIVMSG $chan :user records: [countusers], channels: [channels], date: [date], time: [time], os: [unames], server: $server, host: $botname,egg version: [lindex $version 0]"
}

proc pub:broadcast {nick uhost hand chan text} {
  if {[string length $text] > 0} {
    set text [string trim $text "{}"]
    foreach n [channels] { puthelp "PRIVMSG $n :$text" }
  } else { puthelp "NOTICE $nick :!broadcast <message> - sends message to all channels that the bot is" }
}

putlog "tcl: opers tcl loaded"


What do i need so that user can reg with this code, man maybe is it possibel to make it like this !regnick and then i will read the email and user name and maybe put out a passkey with an url where the user need to go to active there account ???

here is the code
Code:
bind PUB n|- !regnick pub:regnick

proc regnick { nickname hostname handle channel arguments } {
set nick [lindex [split $arguments] 0]
set password [lindex [split $arguments] 1]
set email [lindex [split $arguments] 2]
if {$nick == "" || $password == "" || $email == ""} {
putquick "NOTICE $nickname :Not enough arguments."
return 0
}
if {[string length $password] < 5} {
putquick "NOTICE $nickname :The password isn't long enough"
return 0
}
if {![string match -nocase "*@*" $email]} {
putquick "NOTICE $nickname :Invalid email adress."
return 0
}
##DO YOUR STUFF
}

_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze


Last edited by Fire-Fox on Thu Sep 20, 2007 10:36 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Dec 05, 2006 9:04 pm    Post subject: Reply with quote

Maybe let the bot send you a note when someone uses the command.
Code:
sendnote regnick fire-fox "$nick - $password - $email"

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Wed Dec 06, 2006 10:24 am    Post subject: Reply with quote

I don't follow Sir_fz ???

Can i bind it to a chanserv ??

let me tell what im looking for Very Happy

im looking for a script. rhat i can have on my eggdrop, that let's user reg there nick on my chanserv and so on ???

and forward some code or guides Smile

I know i have alot of cards in the air Very Happy but this is sometime i need Very Happy

is adminserv.conf set up correctly ?
if not help me plz Smile and is it right that this script can do the function like chanserv og nickserv can do ???

( when a user enters my channel this my bot USB gives the status )
Code:

#---------------------------------------------------
# AdminServ v2.0 (stable)
#
# *
#
# AdminServ is a channel service bot,
# intended primarily to act as a
# complete combination of ChanServ,
# NickServ, OpServ, HelpServ, and
# Global.
#
# For questions & comments, you may
# visit http://adminserv.cmx-networks.net
# or irc.hazenet.org on channel
# #adminserv
#
# *
#
# adminserv.conf
#
# *
#
# $Id: adminserv.conf,v 2.0 2004/04/20 18:49:55 emac Exp $
#
#---------------------------------------------------

# Informational Settings
set nick "USB" // my botname
set altnick "USBhub"
set realname "Userbits.org bot"
set username "Apache"
set admin "Apache <email: firesecret@gmail.com>"
set owner "Apache"

# Server Flags/Privledges
bind evnt - init-server evnt:init_server

proc evnt:init_server {type} {
  global botnick
  putquick "privmsg nickserv :identify xxxxx"
  putquick "OPER USB xxxxxx"
  putquick "MODE $botnick +ixkXno"
}

# Official Channel for AdminServ
  set official(channel) "#userbits.org"

# Global Settings
set global-flood-chan 0:0
set global-flood-deop 0:0
set global-flood-kick 0:0
set global-flood-join 0:0
set global-flood-ctcp 0:0
set global-flood-nick 0:0

# Staff Channel that will report admin cmds being used.
  set staff(channel) "#userbits.staff"

# Trigger that users will use for commands.
  set trigger "-"

# Version identifcation. (DO NOT CHANGE)
global botnick
  set adminserv(version) "$botnick Channel Services v2.0 (alpha), Built: April 20, 2004, 18:49:55"
  set adminserv(versionarch) "dev@$botnick--2004-ASDev/$botnick--devo--2.0--patch-0"

# Comment this out when you've edited your config. This ensures you've reviewed this file.
# die "adminserv.conf unsuccessfully edited."

# Do Not Edit
unbind msg - hello *msg:hello
bind msg - root *msg:hello

# AdminServ Loaded Files
source scripts/chanserv.c
source scripts/nickserv.c
source scripts/opserv.c
source scripts/global.c
source scripts/help.c

### END OF CONFIGURATION ###

putlog "AdminServ adminserv.conf loaded"

_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Back to top
View user's profile Send private message MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Dec 06, 2006 7:52 pm    Post subject: Reply with quote

I was talking about your regnick procedure.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
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 -> Script Requests 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