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 

Pub Voiceme script

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
sarius
Voice


Joined: 05 Aug 2005
Posts: 20

PostPosted: Tue Aug 09, 2005 6:09 am    Post subject: Pub Voiceme script Reply with quote

Hi guys,

I searched the archive for the script in the topic and found voiceme.tcl by Silviu. However I think it's limited to only 1 channel. Can it be edited to include more than 1? Also, is this script secure to be allowed for pub? Thanks Very Happy

Code:
set vchan #channel

bind msg - voiceme msg:voiceme
proc msg:voiceme { nick host hand text } {
   global vchan
        global botnick
   if {![onchan $nick $vchan]} {
      puthelp "NOTICE $nick :I do not see you on $vchan"
      return 0
   }
   if {[isvoice $nick $vchan]} {
      puthelp "NOTICE $nick :You already have +v on $vchan. If you do not need use /msg $botnick devoiceme"
      return 1
   }
   pushmode $vchan +v $nick
   puthelp "NOTICE $nick :Have fun and enjoy your stay here"
   return 1
}
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Aug 09, 2005 6:58 am    Post subject: Reply with quote

Code:
set vchans "#channel #channel2"

bind msg - voiceme msg:voiceme
proc msg:voiceme { nick host hand text } {
 global vchans botnick
 foreach vchan [split $vchans] {
  if {![onchan $nick $vchan]} {
   puthelp "NOTICE $nick :I do not see you on $vchan"
   continue
  }
  if {[isvoice $nick $vchan]} {
   puthelp "NOTICE $nick :You already have +v on $vchan. If you do not need use /msg $botnick devoiceme"
   continue
  }
  pushmode $vchan +v $nick
  puthelp "NOTICE $nick :Have fun and enjoy your stay here"
 }
 return 1
}

_________________
Follow me on GitHub

- Opposing

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


Joined: 05 Aug 2005
Posts: 20

PostPosted: Tue Aug 09, 2005 9:02 am    Post subject: Reply with quote

Hey Sir_Fz

Thanks for the prompt reply. It's all good except it assumes that the user is on both channels. So if the user is only on #channel, he'll receive the message: "I do not see you on #channel2"

Is there anyway to make the bot scan which channels the user is on and then voice him in that channel without noticing him that he is not on the other channels in the script? Or do I need to bind another keyword like voiceme2?
Back to top
View user's profile Send private message
sarius
Voice


Joined: 05 Aug 2005
Posts: 20

PostPosted: Tue Aug 09, 2005 9:52 am    Post subject: Reply with quote

Ok. I played around and this seemed to work.

Code:

set vchan1 #channel1
set vchan2 #channel2
##### Channel 1 #####
bind msg - voiceme1 msg:voiceme1
proc msg:voiceme1 { nick host hand text } {
   global vchan1
        global botnick
   if {![onchan $nick $vchan1]} {
      puthelp "NOTICE $nick :I do not see you on $vchan1"
      return 0
   }
   if {[isvoice $nick $vchan1]} {
      puthelp "NOTICE $nick :You already have +v on $vchan1. If you do not need use /msg $botnick devoiceme1"
      return 1
   }
   pushmode $vchan1 +v $nick
   puthelp "NOTICE $nick :Have fun and enjoy your stay here"
   return 1
}
##### Channel 2 #####
bind msg - voiceme2 msg:voiceme2
proc msg:voiceme2 { nick host hand text } {
   global vchan2
        global botnick
   if {![onchan $nick $vchan2]} {
      puthelp "NOTICE $nick :I do not see you on $vchan2"
      return 0
   }
   if {[isvoice $nick $vchan2]} {
      puthelp "NOTICE $nick :You already have +v on $vchan2. If you do not need use /msg $botnick devoiceme2"
      return 1
   }
   pushmode $vchan2 +v $nick
   puthelp "NOTICE $nick :Have fun and enjoy your stay here"
   return 1
}


One question I have is, is it possible to bind 2 trigger wrods to one command? For example:

Code:
bind msg - vm #channel1 msg:voiceme1
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Aug 09, 2005 10:02 am    Post subject: Reply with quote

Use
Code:
bind msgm - "vm #channel1 *" msg:voiceme1

This way the channel name is [lindex [split $arg] 1].
_________________
Follow me on GitHub

- Opposing

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


Joined: 05 Aug 2005
Posts: 20

PostPosted: Tue Aug 09, 2005 10:58 am    Post subject: Reply with quote

Dude! It worked!

Thanks muchos! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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