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 

Give op on special text

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Sat Mar 25, 2006 10:16 am    Post subject: Give op on special text Reply with quote

Hello!
I want to make my bot to give me op when I send it a special message. For example I type: "/msg Bot opme".
Code:

bind msg - opme aop_op
proc aop_op {nick host hand chan text} {
pushmode $chan +o $nick
return 0
}

But when I send a private message, in the party-line of the bot appears an error: Tcl error [aop_op]: wrong # args: should be "aop_op nick host hand chan text"
Whats's wrong?
Back to top
View user's profile Send private message
Winters
Voice


Joined: 09 Jul 2005
Posts: 29

PostPosted: Sat Mar 25, 2006 10:52 am    Post subject: Reply with quote

Code:

MSG
         bind msg <flags> <command> <proc>
         procname <nick> <user@host> <handle> <text>

         Description: used for /msg commands. The first word of the user's
           msg is the command, and everything else becomes the text argument.


:> just change the proc with

proc aop_op {nick host hand text} {
Back to top
View user's profile Send private message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Sat Mar 25, 2006 11:31 am    Post subject: Reply with quote

When I do this the bot says: "No such variable $chan"
And when I replace $chan with the real chan and not with a variable, nothing happens.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Mar 25, 2006 5:55 pm    Post subject: Reply with quote

Code:
bind msg - opme opme

proc opme {nick uhost hand arg} {
 foreach chan [channels] {
  pushmode $chan +o $nick
 }
}

This will op you (or anyone) who msgs the bot opme on all channels. I suggest you change the '-' to some flag, probably o or n.
_________________
Follow me on GitHub

- Opposing

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


Joined: 09 Jul 2005
Posts: 29

PostPosted: Sat Mar 25, 2006 9:17 pm    Post subject: Reply with quote

and if you only want to get opped in one channel then try this Smile

Code:

bind msg - opme opme

proc opme {nick host hand arg} {
set chan "[lindex [split $arg] 0]"
if {"$chan" == "" || ![string match "#*" "$chan"]} {
puthelp "notice $nick :Wrong Channel Synthax! Try again."
return
} elseif {![validchan $chan]} {
puthelp "notice $nick :$chan isn't in my channellist"
return
} elseif {![botisop $chan]} {
puthelp "notice $nick :I'm not opped in $chan!"
return
} elseif {[isop $nick $chan]} {
puthelp "notice $nick :You're already opped in $chan!"
return
}
pushmode $chan +o $nick
puthelp "notice $nick :Done!"
}
Back to top
View user's profile Send private message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Sun Mar 26, 2006 4:06 pm    Post subject: Reply with quote

Thank you guys.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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