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.

chan mode script

Old posts that have not been replied to for several years.
Locked
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

chan mode script

Post by DarkJFMan »

Code: Select all

bind pub - `mode pub:mode
proc pub:mode {nick uhost hand chan arg} {
set modechan [lindex $arg 0]
if {$modechan == ""} {
putserv "NOTICE $nick :The correct way of using `mode is - `mode +/-<chan mode>"
return 0 
}
if {![isop $nick $chan]} {
putserv "NOTICE $nick :You don't have acess over this command."
} else {
putserv "MODE $chan $modechan"
}
}
Even if an op uses `mode comannd he's noticed "You don't have access over this command" any ideas why?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

isop <nickname> [channel]
Returns: 1 if someone by the specified nickname is on the channel (or
any channel if no channel name is specified) and has ops; 0 otherwise
Module: irc
Seems that should work. Try a test by adding them as an op in the bot and see what happens.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

weird, even tho it should be on the chan, because everytime i add remove someon as an op, i have to do it to bot too.

i never messed the bot's list, can you tell me how you add an op the bot's list?
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

you wouldnt happen to be on a ircd server (unreald) where they have ~and & flags ?

if you do, make sure that your net-type setting and set opchar setting is correct. otherwise isop/isvoice wont work
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

This is not the best way for doing, what you are trying to do.
There is a more better and easier technique for doing this.
Try this code:

Code: Select all

bind pub - `mode pub:mode 

proc pub:mode {nick uhost hand chan arg} { 
 set modechan [lindex $arg 0] 
  if {($modechan == "")} { 
   putserv "NOTICE $nick :The correct way of using `mode is - `mode +/-<chan mode>" 
   return 0 
  } 
  if {[isop $nick $chan]} { 
   putserv "MODE $chan $modechan"
   return 0
  } 
  if {![isop $nick $chan]} { 
  putserv "NOTICE $nick :You don't have acess over this command."
  return 0
  } 
}
You can change the last 'if' to 'elseif' or 'else' depending upon how
you want it to function, supponsingly if you have many if statements.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

for some reason, it won't work i tried "if", "elseif", "else" none of them allowed an op to change the topic. Any ideas?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

I am clueless, to me this is a very simple piece of code, quite
straight forward and should work. hmmmm :-?
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

yea it's working fine, the only probelm i had too many scripts in same file, when i put it on a new file then it worked fine.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Yes if you have too many useless scripts remove them, they might clash with other fine working ones.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked