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.

Retrieve something with !

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Retrieve something with !

Post by darton »

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?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

This belongs in the Scripts requests forum. My suggestion would be to do a forum search or simply check the Tcl Archive.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

OK, I tried this:
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:
bind pub - *: !word
proc word {nick host hand chan rest} {
puthelp "privmsg $chan :text"
}
But this doesn't work. What can I do?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

"rest" contains any text used after the the trigger.

Code: Select all

puthelp "privmsg $chan :$rest"
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

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: Select all

bind pub - !donate donate
proc donate {nick host hand chan rest} {
  puthelp "privmsg $chan :!msg Donate is OFF!"
}
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

bind to msg, but that way you'll have to pass the #channame in your message.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

Where do I have to pass my channame in the script
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

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.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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).
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

I typed this in my channel: sadfdfsg: !donate. But the bot didnt react.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Sir_Fz wrote:this will msg all channels "!msg Donate is OFF!" when someone msgs the bot !donate (anywhere in the sentence).
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

But it must be possible without messaging the bot.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Then use bind pubm. and NO, I'm not going to write it for you. Read tcl-commands.doc about the pubm bind.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

WOW, it really works. Is it possible that the Bot only considers the first 10 letters?
Post Reply