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.

how to make a !trigger tcl script?? help!

Old posts that have not been replied to for several years.
Locked
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

how to make a !trigger tcl script?? help!

Post by n00bster »

i want my eggdrop to notice some information related to the trigger that the user typed, i.e: if i type !commands - then the bot will notice me (private notice,not public) containing a list of commands (like !ping and !pong)... not only will the bot be able to do only !commands - but other triggers as well, like !help or something... so it will be an info bot containing several triggers with informations.

other notes: those triggers should only notice the nick the information related to the trigger that the nick types. it should not have any restrictions OR partyline commands, just public.

HOW do i make a tcl like this?? im pretty n00bie with this, so help me...

thx in advance!!
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Simple, like this

Code: Select all

bind pub -|- !commands pub:commands
bind pub -|- !help pub:help

proc pub:commands {nick host handle chan arg} { 

putquick "NOTICE $nick :Avalible commands:"
putquick "NOTICE $nick :!help, !ping, !pong

}


proc pub:help {nick host handle chan arg} { 

putquick "NOTICE $nick :Hello, i'm info bot at #xxx"
putquick "NOTICE $nick :If you wanna see my commands, type !commands in channel"

}
You can edit/add your own text/triggers etc...
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

so i just copy/paste this into the notepad, huh?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

'RTFM? :mrgreen: Copy this in notepad, and save it as .tcl (e.g. info.tcl).Then put file in your bot scripts folder, and add this to end of your eggdrop.conf: source scripts/info.tcl (it can be different aswell, depends how you saved it.If you saved it as help.tcl, then add: source scripts/help.tcl)...And then rehash bot..Tada :mrgreen:
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

hehe, i know the rest, i just got a bit confused...somehow. dang. thanks for your help anyway!
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

hmm... how to make it work in just one #chan and how to make it work on 2, 3 or 4 chans instead of every chan?
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Code: Select all

set reply_chans "#chan1 #chan2"

proc pub:commands {nick host handle chan arg} { 
 global reply_chans
 if {(([lsearch -exact [string tolower $reply_chans] [string tolower $chan]] != -1) || ($reply_chans == "*"))} {

   # ....
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

No Problem :mrgreen:
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

thanks, gb!

but... should i type the code (the one that you posted, gb) AFTER:

Code: Select all

bind pub -|- !commands pub:commands 
bind pub -|- !help pub:help 

proc pub:commands {nick host handle chan arg} { 

putquick "NOTICE $nick :Avalible commands:" 
putquick "NOTICE $nick :!help, !ping, !pong 

} 


proc pub:help {nick host handle chan arg} { 

putquick "NOTICE $nick :Hello, i'm info bot at #xxx" 
putquick "NOTICE $nick :If you wanna see my commands, type !commands in channel" 

} 
or BEFORE or somewhere in the text/code mentioned above??

thnx in advance!
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

;)

how do i add partyline cmds? cmds that will let other ops and those who have access to the partyline ADD, EDIT and DELETE the triggers... like if someone types: .add !trigname <description> - it will add the trigger + the trigger description to the trigger list. i.e: .add !support For more support commands, ask the ops!
i also want the .edit !trigname <new-description> trigger to be able in partyline. and ofcourse .delete !trigname (which will ofcourse delete the trigger from the script)

how do i make this?? do i have to have some sort of database for the commands/triggers + the commands/triggers info?? please help me if you can/bother... thanks a lot in advance! :)

note: if you use the .add command in the partyline,it should add the trigger to the database/script (or whatever) so the public can just type the added command in the chan and get the notice ifno about that trigger.
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

*bump*
n
n00bster
Voice
Posts: 12
Joined: Thu Jun 10, 2004 11:53 am

Post by n00bster »

this error comes up when i try to start the eggdrop:

Code: Select all

Tcl error in file 'infobot.conf':
missing close-brace
    while executing
"proc pub:commands {nick host handle chan arg}"
    (file "scripts/announce-script.tcl" line 30)
    invoked from within
"source scripts/announce-script.tcl"
    (file "infobot.conf" line 301)
what have i done wrong? should i type the code gb gave me after or before the command Kami gave me??
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

For every opening brace >> { << there has to be a matching closing brace >> }.

Recheck your code for correct closing braces.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked