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 

how to make a bot respond to !<something>

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


Joined: 19 Jan 2011
Posts: 2

PostPosted: Wed Jan 19, 2011 12:25 pm    Post subject: how to make a bot respond to !<something> Reply with quote

@Melkimo> !beer nadine
* +SecsyDiva gives a beer to nadine


atm it says: * +SecsyDiva gives a beer to Melkimo

I am looking for how to make the bot respond to !(something) <nick refered too) message
But at this point I got to where it responds to the nick saying the !something (and ignores the $nick it should respond too)

Code:
proc pub_water {nick uhost hand channel arg} {
 global botnick
 putserv "PRIVMSG $channel :\001ACTION gives $nick a bottle of water\001"
 return 0
 }
bind pub - !water pub_water


What should I change or add to make this work Smile
It should be easy, but uhmm yea, I am looking over it.
Back to top
View user's profile Send private message
doggo
Halfop


Joined: 05 Jan 2010
Posts: 97

PostPosted: Wed Jan 19, 2011 2:11 pm    Post subject: Reply with quote

Code:

bind pub - !water pub_water

proc pub_water {nick uhost hand channel arg} {
set who [lindex $arg 0]
if {$who == ""} {set who $nick}
putserv "PRIVMSG $channel :\001ACTION gives $who a bottle of water\001"
}

[05:58pm] <doggo> !water
[05:58pm] * [spunky] gives doggo a bottle of water
[05:58pm] <doggo> !water [spunky]
[05:58pm] * [spunky] gives [spunky] a bottle of water
[06:00pm] <doggo> !water nadine
[06:00pm] * [spunky] gives nadine a bottle of water



Code:
set who [lindex $arg 0]

sets the VAR who to the nick you want to give water to



Code:
if {$who == ""} {set who $nick}

if who is empty then your nick or whoever triggered the cmd will be used



hope this helped
_________________
NON geeky!! http://gotcode4u.com/
Back to top
View user's profile Send private message Visit poster's website
Melkimo
Voice


Joined: 19 Jan 2011
Posts: 2

PostPosted: Wed Jan 19, 2011 8:03 pm    Post subject: Reply with quote

Yea that works ! Thanks

Is it possible to make the same !command in private with the bot but sending the output to a specified channel?

Like

/msg <bot> !beer Nadine #channel
And it responds in
#channel <botnick> /me gives Nadine a beer
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Jan 20, 2011 6:24 pm    Post subject: Reply with quote

Code:
proc pub_water {nick uhost hand channel arg} {
should be
Code:
proc pub_water {nick uhost hand channel text} {
arg is special. and remenber to use
Code:
[lindex [split $text] 0]
Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Jan 20, 2011 6:42 pm    Post subject: Reply with quote

Actually, arg is fine. It's the word "A R G S" or args, which has special meaning. Just to clarify that part. Wink
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Jan 20, 2011 7:01 pm    Post subject: Reply with quote

lol was close enough arg today, args tomorrow maybe Razz
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Amr
Halfop


Joined: 14 Sep 2007
Posts: 94
Location: Egypt

PostPosted: Sat Mar 26, 2011 1:35 pm    Post subject: Reply with quote

What about adding more , for example !shoot it will be "bot shoots $who"
!kill ..etc.
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