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 

long text help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
tdmondo
Voice


Joined: 26 Feb 2014
Posts: 5

PostPosted: Tue Mar 04, 2014 4:28 am    Post subject: long text help Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Mar 04, 2014 5:13 am    Post subject: Reply with quote

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. Wink
_________________
Once the game is over, the king and the pawn go back in the same box.
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 -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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