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.

Automatic undo +t and -o nick and kick with setudef flag

Old posts that have not been replied to for several years.
V
Volume
Halfop
Posts: 84
Joined: Fri May 23, 2003 5:08 am

Automatic undo +t and -o nick and kick with setudef flag

Post by Volume »

Hello, i have a problem.
i will have this script is about partyline adjustable.
the setudef flag TOPICCHECK must with .chanset #chan +TOPICCHECK always on for the other setudef flags.
example:
bot deop the user and set -t
so must the flags :
TOPICCHECK and deop for this chan must set on.

if all settingsflags are on and the TOPICCHECK flag off the bot do nothing

can somebody help me please ?
thank you very much

Code: Select all

bind mode - * topic

setudef flag TOPICCHECK
setudef flag undotopicmode
setudef flag deop
setudef flag kick

proc topic {nick uhost hand chan mode victim} {

    if {$mode == "+t"} {
    if {[matchattr $hand b] || [matchattr $hand n]} {

    return 0

    } else {
    
    if {[onchan $nick $chan]} {
      pushmode $chan -t
      pushmode $chan -o $nick
      set kick "putkick $chan $nick"
      utimer 5 $kick

        }       
}

return 0

	}
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Use [channel get $chan TOPICCHECK] to see if the channel has that flag or not.
Once the game is over, the king and the pawn go back in the same box.
V
Volume
Halfop
Posts: 84
Joined: Fri May 23, 2003 5:08 am

@caesar

Post by Volume »

caesar wrote:Use [channel get $chan TOPICCHECK] to see if the channel has that flag or not.
can you help me by this bug ?
Tcl error [topic]: wrong # args: should be "set varName ?newValue?"

thank you very much
bind mode - * topic

setudef flag TOPICCHECK
setudef flag undotopicmode
setudef flag deop
setudef flag kick

proc topic {nick uhost hand chan mode victim} {

if {$mode == "+t"} {
if {[matchattr $hand b] || [matchattr $hand n]} {

return 0

} else {

if {[onchan $nick $chan]} {
pushmode [channel get $chan TOPICCHECK && undotopicmode] $chan -t
pushmode [channel get $chan TOPICCHECK && deop] $chan -o $nick
set kick [channel get $chan TOPICCHECK && kick] "putkick $chan $nick"
utimer 5 $kick

}
}

return 0

}
}
V
Volume
Halfop
Posts: 84
Joined: Fri May 23, 2003 5:08 am

@caesar

Post by Volume »

caesar wrote:Use [channel get $chan TOPICCHECK] to see if the channel has that flag or not.
thank you for your help but i have bugs in this script
can you help me?

Tcl error [topic]: wrong # args: should be "set varName ?newValue?"

thank you very much

Code: Select all

bind mode - * topic 

setudef flag TOPICCHECK 
setudef flag undotopicmode 
setudef flag deop 
setudef flag kick 

proc topic {nick uhost hand chan mode victim} { 

    if {$mode == "+t"} { 
    if {[matchattr $hand b] || [matchattr $hand n]} { 

    return 0 

    } else { 
    
    if {[onchan $nick $chan]} { 
      pushmode [channel get $chan TOPICCHECK && undotopicmode] $chan -t 
      pushmode [channel get $chan TOPICCHECK && deop] $chan -o $nick 
      set kick [channel get $chan TOPICCHECK && kick] "putkick $chan $nick" 
      utimer 5 $kick 

        }        
} 

return 0 

       } 
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

pushmode [channel get $chan TOPICCHECK && undotopicmode] $chan -t
this is not the way it's used.. go see the tcl-commands.doc file. :P

Ps: Also, please don't post the same thing twice. :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

setudef flag topickeep

bind mode - "* +t" chan:topic

proc chan:topic {nick uhost hand chan mode victim} { 
  if {![channel get $chan topiccheck]} {
    return
  }
  if {![botisop $chan] || [matchattr $hand b] || [matchattr $hand n]} {
    return
  }
  if {[onchan $nick $chan] && $nick != $::botnick} {
    pushmode $chan -t
    pushmode $chan -o $nick
    utimer 5 [list putkick $chan $nick]
  }
}
looks a lot nicer.. hehe :P

Btw, what exactly do you want to do with this? I fail to understand exactly what this is ment to do..
Once the game is over, the king and the pawn go back in the same box.
V
Volume
Halfop
Posts: 84
Joined: Fri May 23, 2003 5:08 am

Post by Volume »

caesar wrote:

Code: Select all

setudef flag topickeep

bind mode - "* +t" chan:topic

proc chan:topic {nick uhost hand chan mode victim} { 
  if {![channel get $chan topiccheck]} {
    return
  }
  if {![botisop $chan] || [matchattr $hand b] || [matchattr $hand n]} {
    return
  }
  if {[onchan $nick $chan] && $nick != $::botnick} {
    pushmode $chan -t
    pushmode $chan -o $nick
    utimer 5 [list putkick $chan $nick]
  }
}
looks a lot nicer.. hehe :P

Btw, what exactly do you want to do with this? I fail to understand exactly what this is ment to do..
:)
sorry for my bad english
but i would -op and -t with userflags too
the topickeep flag must always on
is topickeep off and userflag op on the script not working (this is easyer to change the settings for owner the came into the shell !
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Oups.. :oops: instead of "topickeep" should be "topiccheck" as you wanted. The "topiccheck" channel flag tells it to react only on the channels that have the flag, that's all. To add or remove the flag just .chanset #channel +topiccheck because by default it's -topiccheck so that's why is not working..
Once the game is over, the king and the pawn go back in the same box.
V
Volume
Halfop
Posts: 84
Joined: Fri May 23, 2003 5:08 am

Post by Volume »

caesar wrote:Oups.. :oops: instead of "topickeep" should be "topiccheck" as you wanted. The "topiccheck" channel flag tells it to react only on the channels that have the flag, that's all. To add or remove the flag just .chanset #channel +topiccheck because by default it's -topiccheck so that's why is not working..
i would that topiccheck is the root button an and alliance so i can this script with this button on ore off switching.

the readout buttons are undotopicmode - deop - kick
if the kick flag is on and the deop flag is on and the undotopicmode is on
but the TOPICCHECK is of the script doing nothing.
is the TOPICCHECK is on the script do all the flags have a + .

the flags with - is not to do :) i hope you can understand me thank you for the time. iam a newbi in tcl , i hope will better ... its difficult with my english.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Well, yes, if the channel is not +topiccheck then nothing will happen there if someone dose the +t mode. By default it's -topiccheck for each channel.
Once the game is over, the king and the pawn go back in the same box.
V
Volume
Halfop
Posts: 84
Joined: Fri May 23, 2003 5:08 am

Post by Volume »

caesar wrote:Well, yes, if the channel is not +topiccheck then nothing will happen there if someone dose the +t mode. By default it's -topiccheck for each channel.
but your script can only change on change off.
wenn i will the bots set -t and deop no kick this funkton can not edit with the partyline.
or
wenn i will the bots set -t and kick but no deop, this can not edit with pl too :(

if i will have the script off must i turn off the TOPICCHECK
if i will have the scripts do not kick i turn off the kick
and the other pl chan flags are on.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

I would give you an answer if I could understand anything of what you are trying to say...
Elen sila lúmenn' omentielvo
V
Volume
Halfop
Posts: 84
Joined: Fri May 23, 2003 5:08 am

Post by Volume »

Papillon wrote:I would give you an answer if I could understand anything of what you are trying to say...
User defined channel flags:
-TOPICCHECK -undotopicmode -deop
-kick


TOPICCHECK: is for set the script on ore off for a channel
undotopicmode: set -t in the chan where the user set +t
deop: deop the user that sets +t in the chan
kick: kick the user that sets +t in the chan


all user definded channel flags are unload !
the script doing nothing !

.chanset #chan +undotopicmode
the flag undotopicmode is on now, but the bot doing nothing as the TOPICCHECK flag is off

.chanset #chan +TOPICCHECK
TOPICCHECK and undotopicmode is on now, the bot set mode -t on the chan

.chanset #chan +deop
TOPICCHECK and undotopicmode and deop is on now, the bot set mode -t on the chan and deop the user this have set +t

.chanset #chan +kick
TOPICCHECK and undotopicmode and deop and kick is on now, the bot set mode -t on the chan , deop the user and kick him

.chanset #chan -deop
TOPICCHECK and undotopicmode and kick is on now, the bot set mode -t on the chan , and kick the user

.chanset #chan -TOPICCHECK
undotopicmode and kick is on now, the bot doing nothing because the TOPICCHECK flag is off !
this is the on ore off flag for the script !!!

i hope you can understand me
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

setudef flag topiccheck
setudef flag undotopicmode 
setudef flag deop 
setudef flag kick 

bind mode - "* +t" chan:topic 

proc chan:topic {nick uhost hand chan mode victim} { 
  set chaninfo [channel info $chan]
  if {![string match "+topiccheck" $chaninfo]} { 
    return 
  } 
  if {![botisop $chan] || [matchattr $hand b] || [matchattr $hand n]} { 
    return 
  } 
  if {[onchan $nick $chan] && $nick != $::botnick} { 
    if {[string match "*+undotopicmode*" $chaninfo]} { pushmode $chan -t }
    if {[string match "*+deop"* $chaninfo]} { pushmode $chan -o $nick }
    if {[string match "*+kick*" $chaninfo]} { utimer 5 [list putkick $chan $nick] }
  } 
} 
Elen sila lúmenn' omentielvo
V
Volume
Halfop
Posts: 84
Joined: Fri May 23, 2003 5:08 am

Post by Volume »

Papillon wrote:

Code: Select all

setudef flag topiccheck
setudef flag undotopicmode 
setudef flag deop 
setudef flag kick 

bind mode - "* +t" chan:topic 

proc chan:topic {nick uhost hand chan mode victim} { 
  set chaninfo [channel info $chan]
  if {![string match "+topiccheck" $chaninfo]} { 
    return 
  } 
  if {![botisop $chan] || [matchattr $hand b] || [matchattr $hand n]} { 
    return 
  } 
  if {[onchan $nick $chan] && $nick != $::botnick} { 
    if {[string match "*+undotopicmode*" $chaninfo]} { pushmode $chan -t }
    if {[string match "*+deop"* $chaninfo]} { pushmode $chan -o $nick }
    if {[string match "*+kick*" $chaninfo]} { utimer 5 [list putkick $chan $nick] }
  } 
} 
hello, thank you for your help , but the script dont work :( i have correct this line:

Code: Select all

if {[string match "*+deop"* $chaninfo]} { pushmode $chan -o $nick }
to

Code: Select all

if {[string match "*+deop*" $chaninfo]} { pushmode $chan -o $nick }
but the bots dont restrict user. the bot dont change back to -t

[21:22:33] * Ralfos sets mode: +t
[21:24:53] * Ralfos sets mode: +t
[21:25:05] * Ralfos sets mode: -t
[21:25:25] * Ralfos sets mode: +t
[21:25:43] * Ralfos sets mode: -t
[21:26:16] * Ralfos sets mode: +t

[21:29:26] <fish> User defined channel flags:
[21:29:26] <fish> +topiccheck +undotopicmode +deop +kick
Locked