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.

A little script needed

Old posts that have not been replied to for several years.
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

A little script needed

Post by Kaarel »

I need a script where can I put together all the command that can use in bot

Like someone says in channel !command and then bot answer him/her commands
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

See in the docs/tcl-commands.doc file the bind pub and start making yourself one.
Once the game is over, the king and the pawn go back in the same box.
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

Still need help :(
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

read the suninet.nl tcl guide aswell.
searching the forum would return 375492726348 examples :>
photon?
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

I cant`t underestand what you try to say me
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

it's so easy...

Code: Select all

bind pub - !commands com_pub

proc com_pub {nick host handle chan args} {
set first "Here write the first command"
set second "Here write the second command"
set third "Here write the third command"
puthelp "NOTICE $nick :$first"
puthelp "NOTICE $nick :$second"
puthelp "NOTICE $nick :$third"
return 1
}
You can do it much better if you read the tcl-commands.doc or read a guide to write your own TCL scripts :wink:
«A fantastic spaghetti is a spaghetti that does not exist»
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

But if I want to put over 3 triggers

Do I have to use that code

Code: Select all

bind pub - !commands com_pub 

proc com_pub {nick host handle chan args} { 
set first "Here write the first command" 
set second "Here write the second command" 
set third "Here write the third command" 
ser fourth "Here write the third command
puthelp "NOTICE $nick :$first" 
puthelp "NOTICE $nick :$second" 
puthelp "NOTICE $nick :$third"
puthelp "NOTICE $nick :$fourth
return 1 
}
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

yes you can do that but don't forget the " in the end of:

Code: Select all

set fourth "Here write the fourth command
and

Code: Select all

puthelp "NOTICE $nick :$fourth
«A fantastic spaghetti is a spaghetti that does not exist»
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Also make sure you use "set" and not "ser"
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

I have that problem that I made 3 different

date.tcl
ops.tcl
rules.tcl

But I cant use them together. Even when I use ops trigger I get rules text. Where is the problem
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

what do you have in these files? I didn't understand :cry:
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

If you have all the 3 binds (public commands) to the same proc then that's a problem. You should change them to a different one for each of them. Use something like:

Code: Select all

bind pub - !date date_pub 
bind pub - !ops ops_pub 
bind pub - !rules rules_pub 

proc date_pub {nick host handle chan args} {
your code goes here..
}

proc ops_pub {nick host handle chan args} {
your code goes here..
}

proc rules_pub {nick host handle chan args} {
your code goes here..
}
Take this as an example not as a code..
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Do as caesar said.

Tcl doesn't operate in a fasion where each file is 100% indepenant of each other.

When the files are read, they go into a single memory buffer, which is read, as if the entire contents where stored in a single files, rather than the seperate ones.

As such, any names that are the same, either overwrite each other (as in your case) or cause an error.

This means that the names of the procedures need adjusting to a unique name (making sure the binds are also changed to unique names).
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

caesar wrote:If you have all the 3 binds (public commands) to the same proc then that's a problem. You should change them to a different one for each of them. Use something like:

Code: Select all

bind pub - !date date_pub 
bind pub - !ops ops_pub 
bind pub - !rules rules_pub 

proc date_pub {nick host handle chan args} {
your code goes here..
}

proc ops_pub {nick host handle chan args} {
your code goes here..
}

proc rules_pub {nick host handle chan args} {
your code goes here..
}
Take this as an example not as a code..

Even I try that code my bot says me <Botman> [19:58] Tcl error [rules_pub]: invalid command name "your"
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

when caesar says "your code goes here" you have to put what you want your bot to do.
for example in the date_pub put a code like this:

Code: Select all

putserv "PRIVMSG $chan :hi!"
or

Code: Select all

putserv "PRIVMSG $nick :hi!"
or whatevah you want it to say.
«A fantastic spaghetti is a spaghetti that does not exist»
Locked