| View previous topic :: View next topic |
| Author |
Message |
Magma Voice
Joined: 03 Jun 2005 Posts: 9
|
Posted: Fri Jun 03, 2005 8:04 pm Post subject: Clan Script if possible... |
|
|
So I want to setup some stuff for my bot.
I want it so that if anyone with a name which starts with [11W] they get a +v when they join the channel
Along with something basic were if a user says a command it will be done.
So if they say !url
the bot will respond with our URL to our site
!url
!contact
!forums
!staff
basic commands were the bot is just gonna say it in the channel or in a PM or something.
The rest of the channel OP's and half-ops will be through Chanserv, just need a wild card for the +v |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Jun 03, 2005 8:59 pm Post subject: |
|
|
Have we bothered to even attempt a search of either the TCL Achive or the forums? _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Magma Voice
Joined: 03 Jun 2005 Posts: 9
|
Posted: Fri Jun 03, 2005 9:11 pm Post subject: |
|
|
| I dont know what im looking for that would auto voice any user with [11W] before there name |
|
| Back to top |
|
 |
Dizzle Op
Joined: 28 Apr 2005 Posts: 109
|
Posted: Fri Jun 03, 2005 11:54 pm Post subject: |
|
|
well this will autovoice pll with the tag [11W] on
| Code: |
#onjoin voice with the right tag
bind join - "*" voice:nicks
proc voice:nicks {nick uhost hand chan} {
if {[botisop $chan] && ([string match "[11W]*" $nick])} {
pushmode $chan +v $nick
}
}
## nichchange with the right tag
bind nick - "*" voice:nickch
proc voice:nickch {nick uhost hand chan newnick} {
if {[botisop $chan] && ([string match "[11W]*" $newnick])} {
pushmode $chan +v $newnick
}
}
|
|
|
| Back to top |
|
 |
Magma Voice
Joined: 03 Jun 2005 Posts: 9
|
Posted: Sat Jun 04, 2005 12:07 am Post subject: |
|
|
so would I save that as a tcl script now...
sorry im super new to eggdrop |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Jun 04, 2005 6:01 am Post subject: |
|
|
nope dizzle, that wouldn't.
You can't use braces because it will think it's a command
| Code: |
#onjoin voice with the right tag
bind join - "*" voice:nicks
proc voice:nicks {nick uhost hand chan} {
if {[botisop $chan] && ([string match "\[11W\]*" $nick])} {
pushmode $chan +v $nick
}
}
|
|
|
| Back to top |
|
 |
kanibus Halfop
Joined: 03 May 2005 Posts: 44
|
Posted: Sat Jun 04, 2005 9:34 pm Post subject: |
|
|
and the other stuff is pretty easy too
| Code: |
bind pub -|- !url show_url
bind pub -|- !contact show_contact
bind pub -|- !forums show_forums
bind pub -|- !staff show_staff
proc show_url {nick host hand chan text } {
putserv "NOTICE $nick : Visit us at www.mysitehere.com !!"
}
proc show_contact {nick host hand chan text } {
putserv "NOTICE $nick : You can contact me at my@email.com !!"
}
proc show_forums {nick host hand chan text } {
putserv "NOTICE $nick : Check out our forums at www.mysitehere.com/forums !!"
}
proc show_staff {nick host hand chan text } {
putserv "NOTICE $nick : the staff here, add more notices if you need"
}
|
you can have it send the info by pm simply by changing NOTICE with PRIVMSG |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Sun Jun 05, 2005 5:07 am Post subject: |
|
|
| kanibus wrote: | and the other stuff is pretty easy too
| Code: |
bind pub -|- !url show_url
bind pub -|- !contact show_contact
bind pub -|- !forums show_forums
bind pub -|- !staff show_staff
proc show_url {nick host hand chan text } {
putserv "NOTICE $nick : Visit us at www.mysitehere.com !!"
}
proc show_contact {nick host hand chan text } {
putserv "NOTICE $nick : You can contact me at my@email.com !!"
}
proc show_forums {nick host hand chan text } {
putserv "NOTICE $nick : Check out our forums at www.mysitehere.com/forums !!"
}
proc show_staff {nick host hand chan text } {
putserv "NOTICE $nick : the staff here, add more notices if you need"
}
|
you can have it send the info by pm simply by changing NOTICE with PRIVMSG |
What kanibus wrote will work fine but you end up with loads and loads of binds on your bot i would suggest using something like this that will keep your binds down to a minimum.
| Code: | bind pub - * triggers
proc triggers {nick uhost hand chan arg} {
set trigger [lindex [split $arg] 0]
switch -exact -- [string tolower $trigger] {
"!url" {
putserv "NOTICE $nick :Visit us at www.mysitehere.com !!"
}
"!contact" {
putserv "NOTICE $nick :You can contact me at my@email.com !!"
}
"!forums" {
putserv "NOTICE $nick :Check out our forums at www.mysitehere.com/forums !!"
}
"!staff" {
putserv "NOTICE $nick :the staff here, add more notices if you need"
}
default {
putserv "NOTICE $nick :Unknown command: $trigger"
}
}
} |
hope this helps.  _________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
kanibus Halfop
Joined: 03 May 2005 Posts: 44
|
Posted: Sun Jun 05, 2005 5:52 pm Post subject: |
|
|
thanks for the tip doom  |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Sun Jun 05, 2005 5:59 pm Post subject: |
|
|
Pleasure  _________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
Magma Voice
Joined: 03 Jun 2005 Posts: 9
|
Posted: Sun Jun 05, 2005 11:28 pm Post subject: |
|
|
so if I need to add more commands later I can just add something like
| Code: |
"!command" {
putserv "NOTICE $nick :info here"
}
|
Right?
Also do I just save that into a TCL script? |
|
| Back to top |
|
 |
Dizzle Op
Joined: 28 Apr 2005 Posts: 109
|
Posted: Sun Jun 05, 2005 11:59 pm Post subject: |
|
|
Right  |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Mon Jun 06, 2005 3:20 am Post subject: |
|
|
| Magma wrote: | so if I need to add more commands later I can just add something like
| Code: |
"!command" {
putserv "NOTICE $nick :info here"
}
|
Right?
Also do I just save that into a TCL script? |
As Dizzle Said that is correct but what he forgot to point out was it has to be above 'default' in the switch statement else you will break it
And yes just save that as triggers.tcl place it into your scripts directory and load it by putting | Code: | | source scripts/triggers.tcl | at the bottom of your config file  _________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
Magma Voice
Joined: 03 Jun 2005 Posts: 9
|
Posted: Mon Jun 06, 2005 1:39 pm Post subject: |
|
|
| Code: |
[13:36] Tcl error in file '11wpao.conf':
[13:36] missing close-brace
while executing
"proc triggers {nick uhost hand chan arg} {
set trigger [lindex [split $arg] 0]
switch -exact -- [string tolower $trigger] {
"!..."
(file "scripts/paocommand.tcl" line 3)
invoked from within
"source scripts/paocommand.tcl"
(file "11wpao.conf" line 1338)
[13:36] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Connection closed by foreign host.
|
what did I do wrong :s |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Mon Jun 06, 2005 2:05 pm Post subject: |
|
|
you are missing a close-brace. Paste your trigger script in here so i can see it please  _________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
|