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.

my mode changer

Old posts that have not been replied to for several years.
Locked
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

my mode changer

Post by metroid »

I made a small script that changes the chan modes, its really simple but i can't see to figure this out.

Code: Select all

proc pub:modeset {nick uhost hand chan text} {
	global lastbind
      set chanmodes [lindex [getchanmode $chan] 0]
	if {$chanmodes == "+"} {
	set chanmodes "No chanmodes set"
	} else {
	set chanmodes [lindex [getchanmode $chan] 0]}
	if {$text == ""} {
	putquick "NOTICE $nick :Syntax : $lastbind +/-\[mode\]"
	putquick "NOTICE $nick :Current modes set on $chan are: $chanmodes"
	} else {
	putquick "MODE $chan $text"
	putquick "NOTICE $nick :Done."
      set chanmodes2 [lindex [getchanmode $chan] 0]
	putquick "NOTICE $nick :The current modes set on $chan are now: $chanmodes2"
	}
}
When i change a mode, it won't show it in the new list, eventhough its made after the mode change, Plz help me to fix it
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

try using pushmode and flushmode

Code: Select all

 } else { 
   pushmode $chan $text
   flushmode $chan
   putquick "NOTICE $nick :Done." 
      set chanmodes2 [lindex [getchanmode $chan] 0] 
   putquick "NOTICE $nick :The current modes set on $chan are now: $chanmodes2" 
 }
if that doesn't work add a utimer to get the chanmodes
Elen sila lúmenn' omentielvo
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

putquick is using the mode queue, so pushmode/flushmode won't make a difference, but the mode change won't be seen by the bot untill later on, so you better use a timer or "fake" it by interpreting the requested change like the irc server would.
Have you ever read "The Manual"?
Locked