This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Msg the input

Old posts that have not been replied to for several years.
Locked
User avatar
AbuAli
Voice
Posts: 35
Joined: Sat Jun 12, 2004 2:49 am

Msg the input

Post by AbuAli »

Hello, i need a code .. send a msg to what a nick say...

like EX:
if <nick1> say on #channe1 test
will. the bot do "privmsg test :msg1"

if <nick1> say on #channel1 something
will. the bot do "privmsg something :msg1"

if <nick1> say on #channel1 blahblahblah
will. the bot do "privmsg blahblahblah :msg1"

i need to
set nick1 "the nick who will talk the nicks on the channel"
set channel1 "the channel when will read the nicks"
set msg1 "the msg what the bot will send"

thx for help :D
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Very...easy this is almost near to basics. :mrgreen:
Use, this it should work.

Code: Select all

bind pubm - "*" private:talk

set nick1 "awyeah"
set channel1 "#elite"
set msg1 "I am a bot!"

proc private:talk {nick uhost hand chan text} {
 global botnick nick1 channel1 msg1
 if {([string equal -nocase $chan $channel1]) && ([string equal -nocase $nick $nick1]) && (![string equal -nocase $botnick $nick])} { 
  set text [lindex $text 0]; putserv "PRIVMSG $text :$msg1"
  return 0
  }
}
Whenever nick "X" types anything on the defined channel:

<X> hello!
The bot will privmsg 'hello!"
In this case the message will not be sent, as 'hello!' is not a valid nick.
Just make sure, hello! is a valid nick, as the '!' character is not valid for nicks.

So X should have to say:

<X> hello
Then the bot will privmsg 'hello' with your defined msg.

Also in case if X says more than 1 word in the text:

<X> hello there!
In this case, the privmsg will still be sent to the first word said.
So the privmsg will be sent to the nick 'hello' (the first word of the text).
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
AbuAli
Voice
Posts: 35
Joined: Sat Jun 12, 2004 2:49 am

Post by AbuAli »

hello awyeah,
another qs?
if i need to send direct without useing channel1
like..
if "nick1" msg botnick "blahblah"
botnick "privmsg blahblah :msg1"
thx
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well then, use this:

Code: Select all

bind pubm - "*" private:talk 

set nick1 "awyeah" 
set msg1 "I am a bot!" 

proc private:talk {nick uhost hand chan text} { 
 global botnick nick1 msg1 
  if {([string equal -nocase $nick $nick1]) && (![string equal -nocase $botnick $nick])} { 
  set text [lindex $text 0]; putserv "PRIVMSG $text :$msg1" 
  return 0 
  } 
} 
By now you should know how to manipulate a small/easy peice of code, to function slightly different.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
AbuAli
Voice
Posts: 35
Joined: Sat Jun 12, 2004 2:49 am

Post by AbuAli »

hello how can i use CMSG on this code.. ?

i try modify "PRIVMSG $text :$msg1" to "CMSG $text :$msg1"
but not working .. :(

Code: Select all

bind pubm - "*" private:talk 

set nick1 "awyeah" 
set msg1 "I am a bot!" 

proc private:talk {nick uhost hand chan text} { 
 global botnick nick1 msg1 
  if {([string equal -nocase $nick $nick1]) && (![string equal -nocase $botnick $nick])} { 
  set text [lindex $text 0]; putserv "PRIVMSG $text :$msg1" 
  return 0 
  } 
} 
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

There's no CMSG in tcl/eggdrop
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

And the magic question now is... what in blue blazes is "CMSG"?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Maybe he means:
I would suggest, heh... :D

Code: Select all

proc name { bla bla } {
 global bla
 ...........
 ...........
 if {($bla == $bla1)} { set CMSG "PRIVMSG" }
 if {($bla == $bla2)} { set CMSG "NOTICE" }
 putserv "$CMSG $text :$msg1"
 .................
 }
}
Either one of these, based upon some 'if' condition. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Possibly :D
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
AbuAli
Voice
Posts: 35
Joined: Sat Jun 12, 2004 2:49 am

Post by AbuAli »

no its not that awyeah :(
on my network.. we have command "cmsg nick channel msg"
you have to be oped to do this command...

:-?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

putserv "CMSG $nick $channel :$msg"
should work then
Elen sila lúmenn' omentielvo
Locked