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 

Clan Script if possible...
Goto page Previous  1, 2
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Magma
Voice


Joined: 03 Jun 2005
Posts: 9

PostPosted: Mon Jun 06, 2005 4:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Mon Jun 06, 2005 4:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
spock
Master


Joined: 12 Dec 2002
Posts: 319

PostPosted: Mon Jun 06, 2005 5:43 pm    Post subject: Reply with quote

not odd at all considering that the pub bind doesnt support wildcards Wink
_________________
photon?
Back to top
View user's profile Send private message
Magma
Voice


Joined: 03 Jun 2005
Posts: 9

PostPosted: Mon Jun 06, 2005 6:02 pm    Post subject: Reply with quote

spock wrote:
not odd at all considering that the pub bind doesnt support wildcards Wink


so I have to bind each command then...
Back to top
View user's profile Send private message
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Mon Jun 06, 2005 6:08 pm    Post subject: Reply with quote

Ooooooops my bad. change 'pub' to 'pubm' Embarassed
_________________
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
View user's profile Send private message Visit poster's website
Decl
Voice


Joined: 14 Jul 2005
Posts: 26
Location: Tartu, Estonia

PostPosted: Sun Jul 17, 2005 1:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Sun Jul 17, 2005 1:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jul 17, 2005 1:51 pm    Post subject: Reply with quote

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 Very Happy
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Sun Jul 17, 2005 1:58 pm    Post subject: Reply with quote

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 Wink
_________________
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
View user's profile Send private message Visit poster's website
Decl
Voice


Joined: 14 Jul 2005
Posts: 26
Location: Tartu, Estonia

PostPosted: Mon Jul 18, 2005 2:15 am    Post subject: Reply with quote

Thank you Wink Works perfectly... Surprised
_________________
Contact: [CB]Decl @ #ClanBase (QuakeNet)
www.clanbaseradio.com
Back to top
View user's profile Send private message Visit poster's website
Decl
Voice


Joined: 14 Jul 2005
Posts: 26
Location: Tartu, Estonia

PostPosted: Wed Aug 31, 2005 5:02 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Aug 31, 2005 8:26 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Decl
Voice


Joined: 14 Jul 2005
Posts: 26
Location: Tartu, Estonia

PostPosted: Wed Aug 31, 2005 1:14 pm    Post subject: Reply with quote

It doesn't work by some reason.. :f Any more suggestions ?
_________________
Contact: [CB]Decl @ #ClanBase (QuakeNet)
www.clanbaseradio.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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