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.

Clan Script if possible...

Old posts that have not been replied to for several years.
M
Magma
Voice
Posts: 9
Joined: Fri Jun 03, 2005 7:59 pm

Post by Magma »

hmm added a bracket but i tried the commands in IRC and it wont work.

Code: Select all

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" 
        } 
    } 
}
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Hmm odd. ok try it this way

Code: Select all

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
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

not odd at all considering that the pub bind doesnt support wildcards :wink:
photon?
M
Magma
Voice
Posts: 9
Joined: Fri Jun 03, 2005 7:59 pm

Post by Magma »

spock wrote:not odd at all considering that the pub bind doesnt support wildcards :wink:
so I have to bind each command then...
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Ooooooops my bad. change 'pub' to 'pubm' :oops:
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
D
Decl
Voice
Posts: 26
Joined: Thu Jul 14, 2005 1:50 am
Location: Tartu, Estonia
Contact:

Post by Decl »

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
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Add an if statement to it.

Code: Select all

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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 :D
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

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
D
Decl
Voice
Posts: 26
Joined: Thu Jul 14, 2005 1:50 am
Location: Tartu, Estonia
Contact:

Post by Decl »

Thank you ;) Works perfectly... :o
Contact: [CB]Decl @ #ClanBase (QuakeNet)
www.clanbaseradio.com
D
Decl
Voice
Posts: 26
Joined: Thu Jul 14, 2005 1:50 am
Location: Tartu, Estonia
Contact:

Post by Decl »

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Probably not the best way to do it, load the same script with different commands and different channels.
D
Decl
Voice
Posts: 26
Joined: Thu Jul 14, 2005 1:50 am
Location: Tartu, Estonia
Contact:

Post by Decl »

It doesn't work by some reason.. :f Any more suggestions ?
Contact: [CB]Decl @ #ClanBase (QuakeNet)
www.clanbaseradio.com
Locked