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 

Preset topics

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


Joined: 13 Nov 2005
Posts: 21

PostPosted: Sun Nov 13, 2005 10:59 am    Post subject: Preset topics Reply with quote

i would like to have say 3 preset topics which could be used by a command in 1 chat room to change another chat rooms topic, any idea how i would do this?
Back to top
View user's profile Send private message Send e-mail
]Kami[
Owner


Joined: 24 Jul 2003
Posts: 590
Location: Slovenia

PostPosted: Sun Nov 13, 2005 11:12 am    Post subject: Reply with quote

This should work:

Code:
bind pub n "!topic" pub:topic

set topic1 "topic 1"
set topic2 "topic 2"
set topic3 "topic 3"

set topicchan "#yourchan"

proc pub:topic {nick uhost hand chan text}
{
   switch -- [string tolower [lindex $text 0]]
   {
   
   "1"
    {
       putquick "TOPIC $::topicchan :$::topic1"
       return
    }
   
    "2"
    {
       putquick "TOPIC $::topicchan :$::topic2"
       return
    }
   
    "3"
    {
       putquick "TOPIC $::topicchan :$::topic3"
       return
    }
  }
}
     


Use command !topic 1 or !topic 2 or !topic 3 in any channel you want and bot will set topic for channel you defined in variable $topicchan.
_________________
Slovene Eggdrop Page


Last edited by ]Kami[ on Sun Nov 13, 2005 11:42 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
neilpkemp
Voice


Joined: 13 Nov 2005
Posts: 21

PostPosted: Sun Nov 13, 2005 11:37 am    Post subject: Reply with quote

i get this when i try to rehash the bot

[15:36] <ToF> [07:35] Tcl error in file 'bot.conf':
[15:36] <ToF> [07:35] wrong # args: should be "proc name args body"
[15:36] <ToF> while executing
[15:36] <ToF> "proc pub:topic {nick uhost hand chan text}"
[15:36] <ToF> (file "scripts/Topic.tcl" line 9)
[15:36] <ToF> invoked from within
[15:36] <ToF> "source scripts/Topic.tcl"
[15:36] <ToF> (file "bot.conf" line 177)
[15:36] <ToF> [07:35] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Back to top
View user's profile Send private message Send e-mail
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Nov 13, 2005 12:47 pm    Post subject: Reply with quote

Code:
proc pub:topic {nick uhost hand chan text}
{

should be
Code:
proc pub:topic {nick uhost hand chan text} {

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
neilpkemp
Voice


Joined: 13 Nov 2005
Posts: 21

PostPosted: Sun Nov 13, 2005 1:31 pm    Post subject: Reply with quote

getting this error now :/

<ToF> [11:53] Tcl error [pub:topic]: wrong # args: should be "switch ?switches? string pattern body ... ?default body?"
Back to top
View user's profile Send private message Send e-mail
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Nov 14, 2005 6:39 am    Post subject: Reply with quote

I guess ]Kami[ got used to C or something Razz
Code:
bind pub n "!topic" pub:topic

set topic1 "topic 1"
set topic2 "topic 2"
set topic3 "topic 3"

set topicchan "#yourchan"

proc pub:topic {nick uhost hand chan text} {
   switch -- [string tolower [lindex $text 0]] {
   "1" {
       putquick "TOPIC $::topicchan :$::topic1"
       return
    }
    "2" {
       putquick "TOPIC $::topicchan :$::topic2"
       return
    }
    "3" {
       putquick "TOPIC $::topicchan :$::topic3"
       return
    }
  }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
neilpkemp
Voice


Joined: 13 Nov 2005
Posts: 21

PostPosted: Mon Nov 14, 2005 1:52 pm    Post subject: Reply with quote

thank you works now Smile
Back to top
View user's profile Send private message Send e-mail
]Kami[
Owner


Joined: 24 Jul 2003
Posts: 590
Location: Slovenia

PostPosted: Mon Nov 14, 2005 3:29 pm    Post subject: Reply with quote

You are right, didn't use TCL for some time now (only C++) Smile
_________________
Slovene Eggdrop Page
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
neilpkemp
Voice


Joined: 13 Nov 2005
Posts: 21

PostPosted: Tue Nov 15, 2005 4:02 am    Post subject: Reply with quote

sorry o be a pain, is thier anyway i can have public command like !topic and it shows the topic either in a message or notice on the channel?
Back to top
View user's profile Send private message Send e-mail
]Kami[
Owner


Joined: 24 Jul 2003
Posts: 590
Location: Slovenia

PostPosted: Tue Nov 15, 2005 4:17 am    Post subject: Reply with quote

Don't understand what you want.

Please explain it better Smile
_________________
Slovene Eggdrop Page
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Nov 15, 2005 8:03 am    Post subject: Reply with quote

Seems we want a variation on the original request. The topic not only being set but also when !topic is used the topic on the channel is sent to the user who triggered it?
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
neilpkemp
Voice


Joined: 13 Nov 2005
Posts: 21

PostPosted: Tue Nov 15, 2005 2:21 pm    Post subject: Reply with quote

ye when someone says does !topic in a channel i would like the bot to either msg the channel the topic or notice the person , just wondered if anyone could show me how to do this Smile
Back to top
View user's profile Send private message Send e-mail
]Kami[
Owner


Joined: 24 Jul 2003
Posts: 590
Location: Slovenia

PostPosted: Tue Nov 15, 2005 3:29 pm    Post subject: Reply with quote

If i understood you good:

Code:
bind pub n "!topic" pub:topic

set topic1 "topic 1"
set topic2 "topic 2"
set topic3 "topic 3"

set topicchan "#yourchan"

proc pub:topic {nick uhost hand chan text} {
   switch -- [string tolower [lindex $text 0]] {
   "1" {
       putquick "TOPIC $::topicchan :$::topic1"
       putquick "NOTICE $nick :Topic for channel $::topicchan is now $::topic1"      
       return
    }
    "2" {
       putquick "TOPIC $::topicchan :$::topic2"
       putquick "NOTICE $nick :Topic for channel $::topicchan is now $::topic2"   
       return
    }
    "3" {
       putquick "TOPIC $::topicchan :$::topic3"
       putquick "NOTICE $nick :Topic for channel $::topicchan is now $::topic3"   
       return
    }
  }

_________________
Slovene Eggdrop Page
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
neilpkemp
Voice


Joined: 13 Nov 2005
Posts: 21

PostPosted: Tue Nov 15, 2005 3:31 pm    Post subject: Reply with quote

i just need it so if anyone wishes to view the topic in the channel they can just do a certain command like !topic and the bot will message them it Smile (sorry if im not making sense)
Back to top
View user's profile Send private message Send e-mail
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