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 

Retrieve something with !
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Sun Jan 22, 2006 8:45 am    Post subject: Retrieve something with ! Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jan 22, 2006 8:57 am    Post subject: Reply with quote

This belongs in the Scripts requests forum. My suggestion would be to do a forum search or simply check the Tcl Archive.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Sun Jan 22, 2006 1:43 pm    Post subject: Reply with quote

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


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

PostPosted: Sun Jan 22, 2006 9:00 pm    Post subject: Reply with quote

"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
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Tue Jan 24, 2006 10:32 am    Post subject: Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jan 24, 2006 6:01 pm    Post subject: Reply with quote

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


Joined: 21 Jan 2006
Posts: 155

PostPosted: Wed Jan 25, 2006 1:13 pm    Post subject: Reply with quote

Where do I have to pass my channame in the script
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jan 25, 2006 4:08 pm    Post subject: Reply with quote

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


Joined: 21 Jan 2006
Posts: 155

PostPosted: Wed Jan 25, 2006 5:42 pm    Post subject: Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jan 25, 2006 7:19 pm    Post subject: Reply with quote

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


Joined: 21 Jan 2006
Posts: 155

PostPosted: Thu Jan 26, 2006 2:43 am    Post subject: Reply with quote

I typed this in my channel: sadfdfsg: !donate. But the bot didnt react.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jan 26, 2006 5:01 am    Post subject: Reply with quote

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


Joined: 21 Jan 2006
Posts: 155

PostPosted: Thu Jan 26, 2006 5:13 am    Post subject: Reply with quote

But it must be possible without messaging the bot.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jan 26, 2006 8:48 am    Post subject: Reply with quote

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


Joined: 21 Jan 2006
Posts: 155

PostPosted: Thu Jan 26, 2006 3:50 pm    Post subject: Reply with quote

WOW, it really works. Is it possible that the Bot only considers the first 10 letters?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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