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.

Pub Voiceme script

Old posts that have not been replied to for several years.
Locked
s
sarius
Voice
Posts: 20
Joined: Fri Aug 05, 2005 10:30 am

Pub Voiceme script

Post by sarius »

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 :D

Code: Select all

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
}
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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
}
s
sarius
Voice
Posts: 20
Joined: Fri Aug 05, 2005 10:30 am

Post by sarius »

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?
s
sarius
Voice
Posts: 20
Joined: Fri Aug 05, 2005 10:30 am

Post by sarius »

Ok. I played around and this seemed to work.

Code: Select all

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: Select all

bind msg - vm #channel1 msg:voiceme1
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Use

Code: Select all

bind msgm - "vm #channel1 *" msg:voiceme1
This way the channel name is [lindex [split $arg] 1].
s
sarius
Voice
Posts: 20
Joined: Fri Aug 05, 2005 10:30 am

Post by sarius »

Dude! It worked!

Thanks muchos! :D
Locked