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 

Public command script

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


Joined: 13 Feb 2006
Posts: 8

PostPosted: Wed Feb 15, 2006 8:10 am    Post subject: Public command script Reply with quote

hu experts helo again Smile

im a total noob and want to write my own script
for !join #chan !part #chan !kick !kickbann !voice !unbann !op

i found the The_Quickening script for that but i want to write my own script

can somebody give me an example for a easy !join #chan script not that complicated like in The_Quickening. the rest i want to do alone Smile

thx 2 all helpers :>
Back to top
View user's profile Send private message
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Wed Feb 15, 2006 11:15 am    Post subject: Reply with quote

Here, is mine:

Code:

#  __                __      __   
# /\ \              /\ \  __/\ \   
# \ \ \         __  \ \ \/\ \ \ \ 
#  \ \ \  __  /'__`\ \ \ \ \ \ \ \
#   \ \ \_\ \/\ \_\ \_\ \ \_/ \_\ \
#    \ \____/\ \__/ \_\\ `\___ ___/
#     \/___/  \/__/\/_/ '\/__//__/
#
# Commands Script by LaW.
#
# Don't change anything.
# Report bugs to #GeeX on Quakenet.


#  Join/Part/Hop/Say/Nick/Broadcast

  #  configuration

     #  variables

          set cmd(trigger) "\."
          set cmd(author)  "LaW (#GeeX on Quakenet)"
          set cmd(version) "1.0"

     #  bindings

          bind PUB n|- "$cmd(trigger)join" pub:join
          bind PUB n|- "$cmd(trigger)part" pub:part
          bind PUB n|- "$cmd(trigger)hop"  pub:hop
          bind PUB n|- "$cmd(trigger)say"  pub:say
          bind PUB n|- "$cmd(trigger)nick" pub:nick
          bind PUB n|- "$cmd(trigger)bc"   pub:bc

     #  copyright

          putlog "Commands Script version $cmd(version) scripted by $cmd(author)"

     #  source (again DO NOT change anything if you are not 100% sure)

          proc pub:part { nick uhost hand chan text } {
           if {$text == ""} {
            channel remove $chan }
           else {
            channel remove $text }
          }

          proc pub:join { nick uhost hand chan text } {
           channel add $text
          }

          proc pub:hop { nick uhost hand chan text } {
           if {$text == ""} {
            putserv "PART $chan" }
           else {
            putserv "PART $text" }
          }

          proc pub:say { nick uhost hand chan text } {
           putserv "PRIVMSG $chan :$text" }

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

          proc pub:bc {nick host hand chan text} {
           putquick "PRIVMSG [join [channels] ","] :[join [split $text]]"
          }
Back to top
View user's profile Send private message
mAxP
Voice


Joined: 13 Feb 2006
Posts: 8

PostPosted: Wed Feb 15, 2006 1:09 pm    Post subject: Reply with quote

thx works all fine

but ".hop"
bot parts chan but doesnt rejoin

[17:50] Tcl error [pub:part]: invalid command name "else"

some one got a sollution?

same error, but commad works
[17:50] Tcl error [pub:part]: invalid command name "else"


and another question

is it possible to ".part #chan" because part only works on the channel you want to part with ".part"

THX GUYZ :]
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Feb 15, 2006 7:21 pm    Post subject: Reply with quote

Code:
}
else {

is incorrect syntax. Use:
Code:
} else {

or
Code:
} {

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Ian-Highlander
Op


Joined: 24 Sep 2001
Posts: 165
Location: Ely, Cambridgeshire

PostPosted: Thu Feb 16, 2006 8:35 am    Post subject: Reply with quote

The only thing to bear in mind is that written that way that script is completely insecure, anyone could spoof an owners hostmask and have full access to all the commands built into that and any scripts like it.

One of the reasons The_Quickening is as "complicated" as it is (I didnt think it actually was particularly complicated) is that when I wrote it I deliberately tried to make it as secure as I could because I'd seen the results of insecure public commands scripts, thats why it has the extra protection of a password protected authentication system built in.

Of course you are completely free to do what you want but it wouldnt be right to let you do so without letting you know the implications of it first. Very Happy
_________________
"Insanity Takes Its Toll, Please Have Exact Change"
Back to top
View user's profile Send private message Send e-mail
mAxP
Voice


Joined: 13 Feb 2006
Posts: 8

PostPosted: Thu Feb 16, 2006 9:43 am    Post subject: Reply with quote

thx for all replys
@sir_fz now all works without errors Smile
@highlander

for me as noob its very difficult to understand this maybe changes in a few weeks ;> and your right its not very secure but its secure enouth for me

so thx guys every question done
Back to top
View user's profile Send private message
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Mon Feb 27, 2006 11:28 am    Post subject: Reply with quote

Lil Update:

Code:

#  __                __      __   
# /\ \              /\ \  __/\ \   
# \ \ \         __  \ \ \/\ \ \ \ 
#  \ \ \  __  /'__`\ \ \ \ \ \ \ \
#   \ \ \_\ \/\ \_\ \_\ \ \_/ \_\ \
#    \ \____/\ \__/ \_\\ `\___ ___/
#     \/___/  \/__/\/_/ '\/__//__/
#
# Commands Script by LaW.
#
# Don't change anything.
# Report bugs to #GeeX on Quakenet.


#  Join/Part/Hop/Say/Nick/Broadcast/Msg/Jump

  #  configuration

     #  variables

          set cmd(trigger) "\!"
          set cmd(author)  "LaW (#GeeX on Quakenet)"
          set cmd(version) "1.1"

     #  bindings

          bind PUB n|- "$cmd(trigger)join" pub:join
          bind PUB n|- "$cmd(trigger)part" pub:part
          bind PUB n|- "$cmd(trigger)hop"  pub:hop
          bind PUB n|- "$cmd(trigger)say"  pub:say
          bind PUB n|- "$cmd(trigger)nick" pub:nick
          bind PUB n|- "$cmd(trigger)bc"   pub:bc
          bind PUB n|- "$cmd(trigger)msg"  pub:msg

     #  copyright

          putlog "Commands Script version $cmd(version) scripted by $cmd(author)"

     #  source (again DO NOT change anything if you are not 100% sure)

          proc pub:part { nick uhost hand chan text } {
           if {$text == ""} {
            channel remove $chan
           } else {
            channel remove $text }
          }

          proc pub:join { nick uhost hand chan text } {
           channel add $text
          }

          proc pub:hop { nick uhost hand chan text } {
           if {$text == ""} {
            putserv "PART $chan" }
           else {
            putserv "PART $text" }
          }

          proc pub:say { nick uhost hand chan text } {
           putserv "PRIVMSG $chan :$text"
          }

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

          proc pub:bc { nick host hand chan text } {
           foreach chan [channels] { puthelp "privmsg $chan :$text" }
          }
         
          proc pub:msg { nick host hand chan text } {
           set chan [lindex $text 0]
           set msg [lrange $text 1 end]
           putserv "PRIVMSG $chan :$msg"
          }
         
          proc pub:jump {nick host hand chan text} {
           set server [lindex $text 0]
           set port [lindex $text 1]
           jump $server $port
          }
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Tue Feb 28, 2006 5:27 am    Post subject: Reply with quote

this script is worthless in my opinion because you do no checking for anything at all.

You don't split any arguments at all so it won't work with special characters such as {}[]\.

Furthermore the fact that you escape '!' as trigger tells me you don't know what placing an \ before it does.

Here is a proper script..

(yes i know it's just a good version of what he made)

Code:
# you can set any trigger, setting $ won't make a difference and you don't have to escape it.
set trigger "!"

# i left out things i found utterly useless. add them yourself if you still want it
bind PUB n|-  ${trigger}join  pub:join
bind PUB n|-  ${trigger}part  pub:part
bind PUB n|-  ${trigger}hop   pub:hop
bind PUB n|-  ${trigger}nick  pub:nick
bind PUB n|-  ${trigger}bc    pub:bc

proc pub:part {nickname hostname handle channel arguments} {
  if {![llength [split $arguments]]} {
    channel remove $channel
  } elseif {![validchan [set channel [lindex [split $arguments] 0]]]} {
    putserv "NOTICE $nickname :Unknown channel '$channel'"
  } else {
    channel remove $channel
  }
}

proc pub:join {nickname hostname handle channel arguments} {
  if {![llength [split $arguments]] || [validchan [set channel [lindex [split $arguments] 0]]]} {
    putserv "NOTICE $nickname :Please use $::lastbind #channel"
  } else {
    channel add $channel
  }
}

proc pub:hop {nickname hostname handle channel arguments} {
  if {![llength [split $arguments]]} {
    putquick "PART $channel"
  } elseif {![validchan [set channel [lindex [split $arguments] 0]]]} {
    putserv "NOTICE $nickname :Unknown channel '$channel'"
  } else {
    putquick "PART $channel"
  }
}


proc pub:nick {nickname hostname handle channel arguments} {
  if {![llength [split $arguments]]} {
    putserv "NOTICE $nickname :Please use $::lastbind <new-nickname>"
  } else {
    set ::nick [lindex [split $arguments] 0]
  }
}

proc pub:bc {nickname hostname handle channel arguments} {
  if {![llength [split $arguments]]} {
    putserv "NOTICE $nickname :Please use $::lastbind <message>"
  } else {
    # i think most ircd's support this way of messaging but incase yours doesn't
    # remove the comment from the next line and comment the other one
    # foreach c [channels] { puthelp "PRIVMSG $c :[join [split $arguments]]" }
    putquick "PRIVMSG [join [channels] ,] :(Broadcast) [join [split $arguments]]"
  }
}
Back to top
View user's profile Send private message
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Thu Mar 02, 2006 5:23 am    Post subject: Reply with quote

The "\" is for users that want user this trigger: "$"
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Mar 02, 2006 8:29 am    Post subject: Reply with quote

As stated in the piece of script i made, you don't need to set it if you set your triggers properly.
Back to top
View user's profile Send private message
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Sun Mar 05, 2006 12:48 pm    Post subject: Reply with quote

well, it doens't matter, or does it? Very Happy
Back to top
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Fri Mar 24, 2006 9:08 pm    Post subject: Reply with quote

MeTroiD, how would one go about for adding more commands like .op .deop .voice .devoice etc.?
Im very new at this, but im trying to learn.
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 -> 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