| View previous topic :: View next topic |
| Author |
Message |
tdmondo Voice
Joined: 26 Feb 2014 Posts: 5
|
Posted: Tue Mar 04, 2014 4:28 am Post subject: long text help |
|
|
hello guys anyone can give me advise about scripting??
look i`ll explain
i want my eggdrop bot answer someone which will say hello on main channel
| Code: | bind pub - hello pub:hello
proc pub:hello {nick host handle chan text} {
putserv "PRIVMSG $chan :hello $nick"
} |
thats working super but..... i want something like this
i want my eggdrop bot answer someone which will say hello guys on main channel
for this what script i must to do?? i want my bot response only on hello guys and not only on hello
i made something this
| Code: | bind pub - hello_guys pub:hello_guys
proc pub:hello_guys {nick host handle chan text} {
putserv "PRIVMSG $chan :hello $nick"
} |
i type hello baby on main channel but my eggdrop still answering.... now u understood what i mean? i wanna only response on hello guys and not only on word hello
thanks before |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Mar 04, 2014 5:13 am Post subject: |
|
|
See pubm bind in tcl-commands.doc file.
Edit: I talked with tdmondo via PM's and helped him out with a piece of code. I'll post it here maybe someone else will find it useful.
| Code: |
dict set responses "hello" "heya %nick, welcome to %chan channel!"
dict set responses "beer?" "yeah %nick, hand me a cold one please!"
bind pubm * * fetch:response
proc fetch:response {nick uhost hand chan text} {
global responses
set text [split $text]
if {[lsearch -nocase [dict keys $responses] $text] != -1} {
set message [string map [list %chan $chan %nick $nick] [dict get $responses $text]]
puthelp "PRIVMSG $chan :$message"
}
}
|
In the first line the "hello" is the word it will trigger and the "heya %nick, welcome to %chan channel!" is the answer it will give to that.
Notice the presence of %nick and %chan that will be replaced with actual nick of the user that triggered the response and the %chan will be replaced with the actual name of the channel.
Haven't tested anything but he said it's working.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|