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.

Public Commands

Help for those learning Tcl or writing their own scripts.
Post Reply
S
SkiZm
Voice
Posts: 4
Joined: Thu Nov 24, 2005 10:11 pm

Public Commands

Post by SkiZm »

How would one go about executing a public command via your bot just as a normal user would.

Example: !help from a user will give some information on the channel in the channel.

If I wanted the bot to execute !help, what would the code look like?

I have tried a generic PRIVMSG line, but all I get is !help but no execution, which is prolly correct.
User avatar
dusk
Halfop
Posts: 91
Joined: Sun Mar 06, 2005 7:25 pm
Location: Belgium

Post by dusk »

Did you even try a search on this forum?
S
SkiZm
Voice
Posts: 4
Joined: Thu Nov 24, 2005 10:11 pm

Post by SkiZm »

dusk wrote:Did you even try a search on this forum?

Of course I did. I would take it from your remark that this question has been asked and answered. Obviously, I must be searching with the wrong terms.

In the time it took you to post a reply, you could of been more productive and provided me a link or at least pointed me to a search that would have yielded better results.

I hate it when an individual spends time looking for answers and finally (reluctantly I may add because of your type of responses) decides to ask the question in a public forum only to receive a non-helpful answer. By non-helpful I mean going out of your way to be obtrusive.

If you can't help me foo, don't reply and don't patronize me.
User avatar
dusk
Halfop
Posts: 91
Joined: Sun Mar 06, 2005 7:25 pm
Location: Belgium

Post by dusk »

I never said I wouldn't help you.

If you want a simple bind and proc maybe this can set you on your way :

Code: Select all

proc pub_help {nick uhost hand chan arg} {
  global botnick
  puthelp "PRIVMSG $chan :yourhelpline 1"
  puthelp "PRIVMSG $chan :yourhelpline 2" 
  return 0
 }
bind pub - !help  pub_help



It wasn't my meaning to patronize anyone, but something like this is found in many scripts (let's say mostely funscripts),just a little adaption would bring you this far...

GRTZ
Merry Christmass btw
S
SkiZm
Voice
Posts: 4
Joined: Thu Nov 24, 2005 10:11 pm

Post by SkiZm »

dusk wrote:I never said I wouldn't help you.

If you want a simple bind and proc maybe this can set you on your way :

Code: Select all

proc pub_help {nick uhost hand chan arg} {
  global botnick
  puthelp "PRIVMSG $chan :yourhelpline 1"
  puthelp "PRIVMSG $chan :yourhelpline 2" 
  return 0
 }
bind pub - !help  pub_help



It wasn't my meaning to patronize anyone, but something like this is found in many scripts (let's say mostely funscripts),just a little adaption would bring you this far...

GRTZ
Merry Christmass btw

Thanks for the response Dusk. I guess I should have been a little more detailed in my question.

I already have a script loaded that will do that for me via a public command. What I need to know how one would make the bot call the same command or proc without the public command being issued via the channel?

The best example I could give is if I wanted a bot to say a message in a channel every 24 hours, and that message was in another loaded module within that bot that could be called via a public command (!text), how would I have the bot either call that command in the channel, or call the proc itself, even though it's in another loaded tcl?

Merry Christmas to you as well.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

pub_help * * * #channel *
Post Reply