| View previous topic :: View next topic |
| Author |
Message |
Magma Voice
Joined: 03 Jun 2005 Posts: 9
|
Posted: Mon Jun 06, 2005 4:12 pm Post subject: |
|
|
hmm added a bracket but i tried the commands in IRC and it wont work.
| 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 http://11th-wolverines.net"
}
"!contact" {
putserv "NOTICE $nick :Contact us through our public forums http://11thwolverines.forumsplace.com "
}
"!forums" {
putserv "NOTICE $nick :Check out our forums at http://11thwolverines.forumsplace.com"
}
"!staff" {
putserv "NOTICE $nick :Staff List is incomplete at this time"
}
"!help" {
putserv "NOTICE $nick :Commands for the bot are !url, !contact, !forums, !staff"
}
default {
putserv "NOTICE $nick :Unknown command: $trigger"
}
}
}
|
|
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Mon Jun 06, 2005 4:55 pm Post subject: |
|
|
Hmm odd. ok try it this way | Code: | bind pub - * triggers
proc triggers {nick uhost hand chan arg} {
set trigger [lindex [split $arg] 0]
set command [string tolower $trigger]
switch -- $command {
"!url" {
putserv "NOTICE $nick :Visit us at http://11th-wolverines.net"
}
"!contact" {
putserv "NOTICE $nick :Contact us through our public forums http://11thwolverines.forumsplace.com "
}
"!forums" {
putserv "NOTICE $nick :Check out our forums at http://11thwolverines.forumsplace.com"
}
"!staff" {
putserv "NOTICE $nick :Staff List is incomplete at this time"
}
"!help" {
putserv "NOTICE $nick :Commands for the bot are !url, !contact, !forums, !staff"
}
default {
putserv "NOTICE $nick :Unknown command: $trigger"
}
}
} |
_________________ 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 |
|
 |
spock Master
Joined: 12 Dec 2002 Posts: 319
|
Posted: Mon Jun 06, 2005 5:43 pm Post subject: |
|
|
not odd at all considering that the pub bind doesnt support wildcards  _________________ photon? |
|
| Back to top |
|
 |
Magma Voice
Joined: 03 Jun 2005 Posts: 9
|
Posted: Mon Jun 06, 2005 6:02 pm Post subject: |
|
|
| spock wrote: | not odd at all considering that the pub bind doesnt support wildcards  |
so I have to bind each command then... |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Mon Jun 06, 2005 6:08 pm Post subject: |
|
|
Ooooooops my bad. change 'pub' to 'pubm'  _________________ 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 |
|
 |
Decl Voice
Joined: 14 Jul 2005 Posts: 26 Location: Tartu, Estonia
|
Posted: Sun Jul 17, 2005 1:30 pm Post subject: |
|
|
But how to make these commands work only on some specific channels ? For example at clan's private channel only, not the other channels this bot is on ??? _________________ Contact: [CB]Decl @ #ClanBase (QuakeNet)
www.clanbaseradio.com |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Sun Jul 17, 2005 1:49 pm Post subject: |
|
|
Add an if statement to it.
| Code: |
set clanchan "#clanchan"
if { [string tolower $chan] != [string tolower $clanchan] } {
return
} else {
... do the rest of the code ...
} |
_________________ 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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Jul 17, 2005 1:51 pm Post subject: |
|
|
| Code: | set clanchans "#chan1 #chan2 #chan3"
# and inside the proc add:
if {[lsearch -exact [string tolower $::clanchans] [string tolower $chan]] == -1} { return 0 } |
Edit: ^DooM^ was faster  _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Sun Jul 17, 2005 1:58 pm Post subject: |
|
|
heh I may of been faster but your way is more usefull in the long run so I would suggest to you decl that you use Sir_Fz's code as it supports multiple channels rather than my way which only supports 1 channel.
Future Proofing is the way to go baby yeahhhh  _________________ 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 |
|
 |
Decl Voice
Joined: 14 Jul 2005 Posts: 26 Location: Tartu, Estonia
|
Posted: Mon Jul 18, 2005 2:15 am Post subject: |
|
|
Thank you Works perfectly...  _________________ Contact: [CB]Decl @ #ClanBase (QuakeNet)
www.clanbaseradio.com |
|
| Back to top |
|
 |
Decl Voice
Joined: 14 Jul 2005 Posts: 26 Location: Tartu, Estonia
|
Posted: Wed Aug 31, 2005 5:02 am Post subject: |
|
|
Another question. If I want the commands work on 2 channels ?
In clan case, two different priv channels, so different commands on them.. How to do so that #chan1 and #chan2 would have different commands ? But ONLY these two channels.. ? :f _________________ Contact: [CB]Decl @ #ClanBase (QuakeNet)
www.clanbaseradio.com |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Aug 31, 2005 8:26 am Post subject: |
|
|
Probably not the best way to do it, load the same script with different commands and different channels. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Decl Voice
Joined: 14 Jul 2005 Posts: 26 Location: Tartu, Estonia
|
Posted: Wed Aug 31, 2005 1:14 pm Post subject: |
|
|
It doesn't work by some reason.. :f Any more suggestions ? _________________ Contact: [CB]Decl @ #ClanBase (QuakeNet)
www.clanbaseradio.com |
|
| Back to top |
|
 |
|