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 1, 2  Next
 
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: Fri Jun 03, 2005 8:04 pm    Post subject: Clan Script if possible... Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Jun 03, 2005 8:59 pm    Post subject: Reply with quote

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


Joined: 03 Jun 2005
Posts: 9

PostPosted: Fri Jun 03, 2005 9:11 pm    Post subject: Reply with quote

I dont know what im looking for that would auto voice any user with [11W] before there name
Back to top
View user's profile Send private message
Dizzle
Op


Joined: 28 Apr 2005
Posts: 109

PostPosted: Fri Jun 03, 2005 11:54 pm    Post subject: Reply with quote

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


Joined: 03 Jun 2005
Posts: 9

PostPosted: Sat Jun 04, 2005 12:07 am    Post subject: Reply with quote

so would I save that as a tcl script now...

sorry im super new to eggdrop
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Jun 04, 2005 6:01 am    Post subject: Reply with quote

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
View user's profile Send private message
kanibus
Halfop


Joined: 03 May 2005
Posts: 44

PostPosted: Sat Jun 04, 2005 9:34 pm    Post subject: Reply with quote

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


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Sun Jun 05, 2005 5:07 am    Post subject: Reply with quote

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. 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
kanibus
Halfop


Joined: 03 May 2005
Posts: 44

PostPosted: Sun Jun 05, 2005 5:52 pm    Post subject: Reply with quote

thanks for the tip doom Smile
Back to top
View user's profile Send private message
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Sun Jun 05, 2005 5:59 pm    Post subject: Reply with quote

Pleasure 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
Magma
Voice


Joined: 03 Jun 2005
Posts: 9

PostPosted: Sun Jun 05, 2005 11:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dizzle
Op


Joined: 28 Apr 2005
Posts: 109

PostPosted: Sun Jun 05, 2005 11:59 pm    Post subject: Reply with quote

Right Very Happy
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Mon Jun 06, 2005 3:20 am    Post subject: Reply with quote

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 Wink

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 Cool
_________________
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
Magma
Voice


Joined: 03 Jun 2005
Posts: 9

PostPosted: Mon Jun 06, 2005 1:39 pm    Post subject: Reply with quote

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


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Mon Jun 06, 2005 2:05 pm    Post subject: Reply with quote

you are missing a close-brace. Paste your trigger script in here so i can see it please Smile
_________________
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
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 1, 2  Next
Page 1 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