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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Danik
Halfop
Posts: 49 Joined: Sun Jun 15, 2008 12:59 pm
Location: Moldova
Contact:
Post
by Danik » Mon Jan 05, 2009 4:15 pm
does anybody know (code) how can I make the egg to respond on commands like: botnick op, botnick voice .... instead of !op and !voice
Nimos
Halfop
Posts: 80 Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos » Tue Jan 06, 2009 5:07 pm
Code: Select all
bind pubm o|o "$botnick op *" pubm:op
proc pubm:op {nick host hand chan text} {
set target [lindex [split $text] 2]
pushmode $chan +o $target
}
if you know a very little about scripting, you could write the other commands by editing this template
[/code]
Last edited by
Nimos on Wed Jan 07, 2009 7:03 am, edited 1 time in total.
Danik
Halfop
Posts: 49 Joined: Sun Jun 15, 2008 12:59 pm
Location: Moldova
Contact:
Post
by Danik » Wed Jan 07, 2009 6:18 am
something is wrong ... it doesn't work .
I've added this command in my lol script and it dowsnt respond on commands
Code: Select all
bind pub o|o .op pub_lol_op
bind pub o|o "$botnick op" pub_lol_op
Nimos
Halfop
Posts: 80 Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos » Wed Jan 07, 2009 7:05 am
I dont know lol script, but your new bind has 2 words instead of one, thats the problem^^
Danik
Halfop
Posts: 49 Joined: Sun Jun 15, 2008 12:59 pm
Location: Moldova
Contact:
Post
by Danik » Wed Jan 07, 2009 7:08 am
Nimos wrote: I dont know lol script, but your new bind has 2 words instead of one, thats the problem^^
i just replaces: !op with "$botnick op *" .. and nothing hapens
Nimos
Halfop
Posts: 80 Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos » Wed Jan 07, 2009 7:19 am
try without the asterisk then...that was for pubm bind only
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Wed Jan 07, 2009 9:02 am
Thats the wrong way to go about it, use something like this:
Code: Select all
bind pubm o|o {*} bot:cmds
proc bot:cmds {nick host hand chan text} {
global botnick
if {![string equal -nocase $botnick [lindex [split $text] 0]]} { return }
set cmd [lindex [split $text] 1]
set arg [join [lrange $text 2 end]]
switch -exact -- $cmd {
"op"
set who [lindex [split $arg] 0]
if {![onchan $who $chan]} {
putserv "NOTICE $nick :ERROR: $who is not on $chan."
} elseif {![botisop $chan]} {
putserv "NOTICE $nick :ERROR: I require op to do that!"
} elseif {[isop $who $chan]} {
putserv "NOTICE $nick :ERRRR: $who is already op on $chan."
} else {
putserv "MODE $chan +o $who"
putserv "NOTICE $nick :Done. Op'd $who on $chan."
}
}
"deop"
set who [lindex [split $arg] 0]
if {![onchan $who $chan]} {
putserv "NOTICE $nick :ERROR: $who is not on $chan."
} elseif {![botisop $chan]} {
putserv "NOTICE $nick :ERROR: I require op to do that!"
} elseif {![isop $who $chan]} {
putserv "NOTICE $nick :ERRRR: $who is not op'd on $chan."
} else {
putserv "MODE $chan -o $who"
putserv "NOTICE $nick :Done. Deop'd $who on $chan."
}
}
"default" {
putserv "NOTICE $nick :SYNTAX: $botnick <command> ?arguements?"
putserv "NOTICE $nick :Available commands: op|deop."
}
}
}
putlog "Loaded botnick commands!"
This is untested, just an example to show you how to do it..
r0t3n @ #r0t3n @ Quakenet
Danik
Halfop
Posts: 49 Joined: Sun Jun 15, 2008 12:59 pm
Location: Moldova
Contact:
Post
by Danik » Wed Jan 07, 2009 11:04 am
I just need the code to replace this
with the: botnick op.
because i use the lol script
Nimos
Halfop
Posts: 80 Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos » Wed Jan 07, 2009 3:40 pm
bind pubm o|o "$botnick op" pub_lol_op_2
proc pub_lol_op_2 {nick host hand chan text} {
pub_lol_op "$nick $host $hand $chan [lrange [split $text] 2 end]"
}
do this for every lol script bind -.-
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Wed Jan 07, 2009 7:51 pm
Let me explain what i meant about going about it the wrong way.
Binding to $botnick is very well ok. but it will also error because $botnick is in the global namespace, so you need to call it via $::botnick
When your botnick changes nickname on irc, lets say from its alt-nick to its main nickname, the binds will still be bound to the alt-nick, which defeats the object of botnick commands.
Its not hard work to port lol-tools commands into my example, just reply the code inside:
With:
Code: Select all
"<command>" {
catch {procname $nick $host $hand $chan $arg}
}
For exampe, for op:
Code: Select all
"op" {
catch {pub_lol_op $nick $host $hand $chan $arg}
}
r0t3n @ #r0t3n @ Quakenet