| View previous topic :: View next topic |
| Author |
Message |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Sun Jan 22, 2006 8:45 am Post subject: Retrieve something with ! |
|
|
Hello!
I want to have a script which can save something such as the rules in my channel and with !rules I can retrieve that what I have saved. Is that possible? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Sun Jan 22, 2006 1:43 pm Post subject: |
|
|
OK, I tried this:
| Quote: |
bind pub - !word
proc word {nick host hand chan rest} {
puthelp "privmsg $chan :text"
}
|
It works. But my channel is connected with a game. And when someone in game types something, in channel it is displayed as follows:
"player: text"
So when someone in game types "!word" the text should be displayed. I tried this script:
| Quote: |
bind pub - *: !word
proc word {nick host hand chan rest} {
puthelp "privmsg $chan :text"
}
|
But this doesn't work. What can I do? |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Jan 22, 2006 9:00 pm Post subject: |
|
|
"rest" contains any text used after the the trigger.
| Code: | | puthelp "privmsg $chan :$rest" |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Tue Jan 24, 2006 10:32 am Post subject: |
|
|
OK, I try to make it as easy as possible to understand.
You can see here that I write a command in game and in the channel. But my bot answers only on the second command. What do I have to change with my script, that my bot answers on both commands?
| Code: | bind pub - !donate donate
proc donate {nick host hand chan rest} {
puthelp "privmsg $chan :!msg Donate is OFF!"
}
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Jan 24, 2006 6:01 pm Post subject: |
|
|
bind to msg, but that way you'll have to pass the #channame in your message. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Wed Jan 25, 2006 1:13 pm Post subject: |
|
|
| Where do I have to pass my channame in the script |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Jan 25, 2006 4:08 pm Post subject: |
|
|
| Code: | bind msg - !donate msg:donate
proc msg:donate {nick uhost hand arg} {
set chan [lindex [split $arg] 0]
puthelp "privmsg $chan :!msg Donate is OFF!"
} |
so /msg bot !donate #channel. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Wed Jan 25, 2006 5:42 pm Post subject: |
|
|
But I dont want to write everytime: /msg bot !donate #channel.
I only want to write !donate. It must be possible that the bot reacts also when !donate isnt at first position. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Jan 25, 2006 7:19 pm Post subject: |
|
|
| Code: | bind msgm - *!donate* msg:donate
proc msg:donate {nick uhost hand arg} {
foreach chan [channels] {
puthelp "privmsg $chan :!msg Donate is OFF!"
}
} |
this will msg all channels "!msg Donate is OFF!" when someone msgs the bot !donate (anywhere in the sentence). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Thu Jan 26, 2006 2:43 am Post subject: |
|
|
| I typed this in my channel: sadfdfsg: !donate. But the bot didnt react. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jan 26, 2006 5:01 am Post subject: |
|
|
| Sir_Fz wrote: | | this will msg all channels "!msg Donate is OFF!" when someone msgs the bot !donate (anywhere in the sentence). |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Thu Jan 26, 2006 5:13 am Post subject: |
|
|
| But it must be possible without messaging the bot. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jan 26, 2006 8:48 am Post subject: |
|
|
Then use bind pubm. and NO, I'm not going to write it for you. Read tcl-commands.doc about the pubm bind. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
darton Op
Joined: 21 Jan 2006 Posts: 155
|
Posted: Thu Jan 26, 2006 3:50 pm Post subject: |
|
|
| WOW, it really works. Is it possible that the Bot only considers the first 10 letters? |
|
| Back to top |
|
 |
|