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.

if $botnick !isop $chan

Help for those learning Tcl or writing their own scripts.
Post Reply
m
mindflow
Voice
Posts: 22
Joined: Thu Mar 10, 2005 11:14 am

if $botnick !isop $chan

Post by mindflow »

Hi, i was trying to make my bot see if it have ops on a channel, but i cant sove how the code should look like, it will be inplanted in a working TCL..

proc UnReal {nick uhost hand chan arg} {
global botnick
check if bot is oped here { do this if bot arent oped then a halt }
rest of code here, if bot is oped in the channel the script is triggered in
it should only keep on reading the TCL
}

hope you understand what i want to do, someone that can help me with this?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

if [botisop $chan] {
...
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
m
mindflow
Voice
Posts: 22
Joined: Thu Mar 10, 2005 11:14 am

Post by mindflow »

and if it's not oped? plz point me to the right doc about this info :)


This is what i get from tcl-commands.doc

botisop [channel]
Returns: 1 if the bot has ops on the specified channel (or any channel
if no channel is specified); 0 otherwise
Module: irc


but that dosent tell me anything on how to see if the bot is oped or not,

if [botisop $chan] {

trigger the script if the bot have op, and halt it if the bot dosent have op.. but i want to be able to send one line of text to the channel when the bot dosent have op, then halt the script, now it only halt if the bot dosent have ops.. :/ so what do i miss here?

this is what i have so far:

proc UnReal {nick uhost hand chan arg} {
set mess "[string tolower [lindex $arg 0]]"
set messa "[string tolower [lindex $arg 0]]"
if {[botisop $chan] == 0} {
puthelp "PRIVMSG $chan :$nick, message"
return 0
# working ok if bot is deoped
if [botisop $chan] {
# do the rest of the code dosent work, same with if i change it to if {[botisop $chan] == 1} still no luck ??? :(
I
IRCNick
Halfop
Posts: 64
Joined: Wed Oct 12, 2005 9:43 pm
Location: Germany
Contact:

Post by IRCNick »

Code: Select all

   if [botisop $chan] {
   #do something
   } else {
   #if the bot is not oped do something else
   }

User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

You seem to wish to know Tcl mindflow, so here's a link for you to bookmark. :D

http://www.tcl.tk/man/tcl8.4/TclCmd/
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply