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.

whats wrong with my code?

Old posts that have not been replied to for several years.
Locked
e
eiSiQ

whats wrong with my code?

Post by eiSiQ »

hi there!

can you tell me, why the code doesn't work?

Code: Select all

bind pubm - .op pubm:do_op

proc pubm:do_op {nick uhost hand chan text} {
  if {![botisop $chan]} {
    notice $nick "\002 I don't have op in $chan \002"
    return 0
  }
  if {[string tolower $text] == "me"} {
    pushmode $chan +o $nick
    return 0
  }
  if {[string tolower $text] == [string tolower $nick]} {
    pushmode $chan +o $nick
    return 0
  }  
}
thx for your help!!
d
darko``
Op
Posts: 121
Joined: Sun Sep 08, 2002 5:33 pm
Location: Malta

Post by darko`` »

Well, several things. First, the way you are processing your msg, you would need to bind pub, not pubm. Secondly, there is no TCL command notice, it is rather:

putserv "NOTICE $nick :Sorry... blah"

Code is generally lousy, but will probably work if you change those two things.

p.s.
You may want to consider changing flags field in bind command, cause as you have it now, everyone can op themselves. Change it to something like n|n or at least o|o. Also, unless you make a mechanisam that will listen only to users who logged in, anyone who matches certain hostmask will be able to use the command. Public commands are very dangerous and imho lame. I cannot think of a reason why any comand should be public. A priv msg to bot or even better partyline commands are the adequate solution.
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
e
eiSiQ

Post by eiSiQ »

yep thx! how to organize this code better?

or code it better?

what would you suggest?

oh and what's the differenc between pub and pubm?
d
darko``
Op
Posts: 121
Joined: Sun Sep 08, 2002 5:33 pm
Location: Malta

Post by darko`` »

Can't really tell you more than i allready did about organizing your code. It would become writting it for you then.
As for pub and pubm, read doc/tcl-commands.doc for info on it. Use search string "bind pub".
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
e
eiSiQ

Post by eiSiQ »

mmh, ok thanks.

but i can't see the difference, sorry, can you please explain it to me?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Beyond the fact it clearly states that each one does (allthough, pubm refers you to msgm, which aint so hard to look for (look up)).

Pumb matches against a whole line, wuch that, it can pick out (EG) your nickname in a line of text.

pub is simply for trigger like commands, based on the first block of characters up to a space.
e
eiSiQ

Post by eiSiQ »

ahh ok thanks!

i got it now ;)
Locked