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 

Bot action response

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
gasak
Halfop


Joined: 09 Aug 2010
Posts: 45

PostPosted: Tue Aug 10, 2010 12:51 am    Post subject: Bot action response Reply with quote

Code:
set crazybib {
"$nick are the real crazy"
}

bind pubm - *v1rus?crazy* pub_crazy

proc pub_crazy {nick uhost handle chan args} {
   global crazybib oldreplytime botnick
   
   set replytime [unixtime]

   if { $replytime - $oldreplytime  > 7} {
      set crazyline [lindex $crazybib [rand [llength $crazybib]]]
      puthelp "PRIVMSG $chan :$crazyline"
      set oldreplytime $replytime
   }
}

set oldreplytime 0


Can someone help me on change that script above to ACTION? means of somone on channels using action (/me) with mention the bot name with specific word the bot will answer also with the specific word to encounter the person.

Thanks a lot before for the help.
_________________
Learning Knows No Boundaries!!
Back to top
View user's profile Send private message
Ashoq
Voice


Joined: 17 Jul 2010
Posts: 11

PostPosted: Tue Aug 10, 2010 3:34 pm    Post subject: Reply with quote

im a newbie in TCL but ...

for ACTION (/me)
change this:
Code:
puthelp "PRIVMSG $chan :$crazyline"

to this:
Code:
puthelp "PRIVMSG $chan :ACTION: $crazyline"


if isnt work try this script (from fishbot.tcl):

Code:
bind pubm -|- "% crazy*" crazybot_crazy
bind pubm -|- "% hello*" crazybot_hello

#crazy
proc crazybot_crazy { nick host hand chan text } {
    putmsg $chan "action: $nick are the real crazy"
}
#hello
proc crazybot_hello{ nick host hand chan text } {
    putmsg $chan "action: says hello to $nick "
}
Back to top
View user's profile Send private message
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Tue Aug 10, 2010 4:46 pm    Post subject: Reply with quote

Does that script work? It doesn't look like it would. There is no check to see if $oldreplytime exists. Also, you have a var set after the last close brace, which isn't doing anything at all.

I will answer the questions first. There are two ways to send an action to the channel. You can use
Code:
putserv "PRIVMSG $chan :\001ACTION does something.\001"
or, if you have have alltools.tcl loaded:
Code:
putact $chan "does a /me action"
is a shortcut for that essentially. Second, if you want this wo work on actions, you must also change the bind and procs:

Code:
bind ctcp * ACTION pub_crazy
proc pub_crazy {nick host hand chan kw arg} {
  if {[string match -nocase "*v1rus?crazy*" $arg]} { ... }


So you'll need to make a few changes there in order to make that work. I would suggest fixing the proc itself first though. Smile

See here as well: http://www.eggheads.org/support/egghtml/1.6.15/tcl-commands.html That whole page is very useful.


Last edited by Luminous on Tue Aug 10, 2010 5:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
gasak
Halfop


Joined: 09 Aug 2010
Posts: 45

PostPosted: Wed Aug 11, 2010 1:02 am    Post subject: Reply with quote

Thanks for the response. But what i mean is not the bot that reply with action. But the bot will reply to to channel when some one on channel do an action (/me) that mention the bot name.

For example the bot name is "v1rus". Than i make an action on channel such "/me v1rus is crazy" then the bot will react for the action because the bot name mention on the action.

please advice.

many thanks
_________________
Learning Knows No Boundaries!!
Back to top
View user's profile Send private message
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Wed Aug 11, 2010 5:25 pm    Post subject: Reply with quote

Yes, that is what the last part is for. Smile You have to use a different bind/method to capture /me action text. The first two bits of code I showed was to make the bot send a /me.
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
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