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.

How to make a simple command script

Old posts that have not been replied to for several years.
V
Vyrus

How to make a simple command script

Post by Vyrus »

In mirc I see many eggdrop bots that respond to a command in the channel like:

Random Person: .commands
Bot: Available commands are .news - .staff - .website
Random Person: .website
Bot: Website - www.website.com

Where can I find a script like this or can someone please script an example I can follow.
User avatar
Kurupt
Voice
Posts: 26
Joined: Sun Aug 22, 2004 7:57 pm
Location: Hermanstat

get a script

Post by Kurupt »

www.eggdrop.conf and www.tclscript. i thin there you would find what you search
V
Vyrus

Post by Vyrus »

www.eggdrop.conf ?? You mean the eggdrop.conf file right?
User avatar
esix
Voice
Posts: 39
Joined: Thu Aug 12, 2004 11:16 am
Location: [esix@localhost]
Contact:

Post by esix »

something like this?

Code: Select all

set commands "commands are .news ..bla bla"
bind pub -|- .commands commands
proc commands {nick host handle chan arg} {
global commands
 putserv "notice $nick :$commands"
}
The End
V
Vyrus

Post by Vyrus »

Thank you so much esix, that example has really helped me alot.
User avatar
esix
Voice
Posts: 39
Joined: Thu Aug 12, 2004 11:16 am
Location: [esix@localhost]
Contact:

Post by esix »

no problem
The End
User avatar
WeiJie
Halfop
Posts: 73
Joined: Thu May 20, 2004 9:30 pm
Location: Singapore

Post by WeiJie »

Any idea where can I find it? Tried egghelp.org and tclscript's but seems that it doesn't find any tcl that fit my needs... (noob about tcl scripting/coding) ;P
WeiJie
Admin of IntelFusion
Http://dj-online.org
#Sparks@Boatquay @ mIRC Galaxynet
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Find what?! :-?
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
WeiJie
Halfop
Posts: 73
Joined: Thu May 20, 2004 9:30 pm
Location: Singapore

Post by WeiJie »

Random Person: .commands
Bot: Available commands are .news - .staff - .website
Random Person: .website
Bot: Website - www.website.com

Something like tis... Right now i'm using info's tcl, like when i type...
<user> !explain website
<bot> the website is http://www.<>.com
awyeah wrote:Find what?! :-?
WeiJie
Admin of IntelFusion
Http://dj-online.org
#Sparks@Boatquay @ mIRC Galaxynet
User avatar
esix
Voice
Posts: 39
Joined: Thu Aug 12, 2004 11:16 am
Location: [esix@localhost]
Contact:

Post by esix »

esix wrote:something like this?

Code: Select all

set commands "commands are .news ..bla bla"
bind pub -|- .commands commands
proc commands {nick host handle chan arg} {
global commands
 putserv "notice $nick :$commands"
}
try to read next time :lol:
The End
User avatar
WeiJie
Halfop
Posts: 73
Joined: Thu May 20, 2004 9:30 pm
Location: Singapore

Post by WeiJie »

I knew nothing about scripting/coding. Perhaps nothing to do with reading?
esix wrote:
esix wrote:something like this?

Code: Select all

set commands "commands are .news ..bla bla"
bind pub -|- .commands commands
proc commands {nick host handle chan arg} {
global commands
 putserv "notice $nick :$commands"
}
try to read next time :lol:
WeiJie
Admin of IntelFusion
Http://dj-online.org
#Sparks@Boatquay @ mIRC Galaxynet
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

WeiJie wrote:Random Person: .commands
Bot: Available commands are .news - .staff - .website
Random Person: .website
Bot: Website - www.website.com

Something like tis... Right now i'm using info's tcl, like when i type...
<user> !explain website
<bot> the website is http://www.<>.com
awyeah wrote:Find what?! :-?
Well, you can always use something like:

Code: Select all

#Usage: !explain microsoft

#Set the word here to match.
set explainword "mircosoft"

#Set the website matching the word here to display.
set explaindef "http://www.microsoft.com/"

### SCRIPT ###
bind pub n !explain explanation

explanation {nick uhost hand chan text} {
 global botnick explainword explaindef
  if {([string equal -nocase $explainword [lindex $text 0]])} {
   putserv "PRIVMSG $chan :The website for $explainword is: $explaindef"; return 0
   }
}
Something like this should work if this is what you are trying todo. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
WeiJie
Halfop
Posts: 73
Joined: Thu May 20, 2004 9:30 pm
Location: Singapore

Post by WeiJie »

Thanks alot ;)
awyeah wrote:
WeiJie wrote:Random Person: .commands
Bot: Available commands are .news - .staff - .website
Random Person: .website
Bot: Website - www.website.com

Something like tis... Right now i'm using info's tcl, like when i type...
<user> !explain website
<bot> the website is http://www.<>.com
awyeah wrote:Find what?! :-?
Well, you can always use something like:

Code: Select all

#Usage: !explain microsoft

#Set the word here to match.
set explainword "mircosoft"

#Set the website matching the word here to display.
set explaindef "http://www.microsoft.com/"

### SCRIPT ###
bind pub n !explain explanation

explanation {nick uhost hand chan text} {
 global botnick explainword explaindef
  if {([string equal -nocase $explainword [lindex $text 0]])} {
   putserv "PRIVMSG $chan :The website for $explainword is: $explaindef"; return 0
   }
}
Something like this should work if this is what you are trying todo. :mrgreen:
WeiJie
Admin of IntelFusion
Http://dj-online.org
#Sparks@Boatquay @ mIRC Galaxynet
V
Vyrus

Post by Vyrus »

bind pub -|- .commands commands

proc commands {nick host handle chan text} {
putserv "NOTICE $nick :My Message"
}


The problem with this is I dont know how to specify the channel I want the bot to only respond in. I have the bot in 3 channels and I would like the bot to respond to those commands only in 1 out of the 3 channels.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Vyrus wrote:bind pub -|- .commands commands

proc commands {nick host handle chan text} {
putserv "NOTICE $nick :My Message"
}


The problem with this is I dont know how to specify the channel I want the bot to only respond in. I have the bot in 3 channels and I would like the bot to respond to those commands only in 1 out of the 3 channels.
Use $chan from the proc, what else.

Code: Select all

#Will respond to the channel where the command ".commands" is triggered.
putserv "NOTICE $chan :My Message"

#Will respond to the channel you will specify it to respond on.
putserv "NOTICE #mychannel :My Message"

#Conclusion
$chan = The channel where the script is triggered on.
#channel = Any channel where you want to display your message on.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked