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 

on 3r kick = remuser.

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


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Mon Jun 16, 2008 8:34 am    Post subject: on 3r kick = remuser. Reply with quote

Hi.

I have this code, it suspend when a Op kicked other Op via X.

So i want add when is first kick, suspend only 3Days. if kick again, suspend for 5 days, and if continue one kick more, my eggdrop run this comand:
.-user $kicker(user)
.msg x remuser #mychan username of kicker.

but the code only put chattr +Y, if continue, don't put -Y+E

something wrong?

code:
Code:
bind kick - * xstuff:kick

proc xstuff:kick {nick host hand chan target reason} {
   global knick
    if {[matchattr [nick2hand $target $chan] b|b $chan] || [matchattr [nick2hand $target $chan] o|o $chan]} {
    set kicker [string trim [lindex [split $reason] 0] {()}]
   set knick [nick2hand $kicker]
   if {$hand == "*"} {set hand $kicker}
          chattr $hand +Y
         putserv "PRIVMSG X :SUSPEND $chan $kicker 2d"
         putlog "Suspendiendo el username $kicker y cambiando flag a $hand"
          return 0
   } elseif {([matchattr $hand Y])} {
     chattr $hand -Y+E
         putserv "PRIVMSG X :SUSPEND $chan $kicker 3d"
          return 1
   } elseif {([matchattr $hand E])} {
     deluser $hand
      putserv "PRIVMSG X :REMUSER $chan $kicker"
          return 1
   }

}
putlog "Suspend and remuser"


some1 can helpme?

Thanks. Embarassed
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon Jun 16, 2008 3:18 pm    Post subject: Reply with quote

Code:
bind kick - * xstuff:kick

proc xstuff:kick {nick host hand chan target reason} {
   if {[matchattr [nick2hand $target $chan] b|b $chan] || [matchattr [nick2hand $target $chan] o|o $chan]} {
      set kicker [string trim [lindex [split $reason] 0] {()}]
      if {[string match -nocase "\*" [lindex [split $hand] 0] } {
         set hand [nick2hand $kicker]
      }
      if {[matchattr $hand E]} {
         deluser $hand
         putserv "PRIVMSG X :REMUSER $chan $kicker"
         return 1
      } elseif {[matchattr $hand Y]} {
         chattr $hand -Y+E
         putserv "PRIVMSG X :SUSPEND $chan $kicker 3d"
         return 1
      } else {
         chattr $hand +Y
         putserv "PRIVMSG X :SUSPEND $chan $kicker 2d"
         putlog "Suspendiendo el username $kicker y cambiando flag a $hand"
         return 1
      }
   } else {
      return 0
   }
}

putlog "Suspend and remuser"


You misplaced a curly brace, and forgot to construct your if statements in the correct conditional order. You realize, since everything is handled within the procedure (invoked by a public kick bind), using 'return' statements isn't really necessary at all, right?

Edit: try again.. works
_________________
speechles' eggdrop tcl archive


Last edited by speechles on Mon Jun 16, 2008 5:52 pm; edited 6 times in total
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Mon Jun 16, 2008 3:24 pm    Post subject: Reply with quote

ok i try.

one momet.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Mon Jun 16, 2008 3:47 pm    Post subject: Reply with quote

thanks speechles, its work...

but have a little problem... don't find the user.

i have an user at userlist of my eggdrop: XCarlos
urs nickname in IRC is: Carlos

so, the $hand don't change flag to XCarlos, it do this: chattr Carlos +Y
but Carlos is not an user in the userlist.

someting wrong?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon Jun 16, 2008 5:53 pm    Post subject: Reply with quote

try the edited code above, fixes that problem.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Tue Jun 17, 2008 9:15 am    Post subject: Reply with quote

buff i try but can't fix this Embarassed
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Jun 28, 2008 9:17 am    Post subject: Reply with quote

Code:
bind kick - * xstuff:kick

proc xstuff:kick {nick host hand chan target reason} {
   if {[matchattr [nick2hand $target $chan] b|b $chan] || [matchattr [nick2hand $target $chan] o|o $chan]} {
      set kicker [string trim [lindex [split $reason] 0] {()}]
      set hand [nick2hand $kicker]

      if {[matchattr $hand E]} {
         deluser $hand
         putserv "PRIVMSG X :REMUSER $chan $kicker"
         return 1
      } elseif {[matchattr $hand Y]} {
         chattr $hand -Y+E
         putserv "PRIVMSG X :SUSPEND $chan $kicker 3d"
         return 1
      } else {
         chattr $hand +Y
         putserv "PRIVMSG X :SUSPEND $chan $kicker 2d"
         putlog "Suspendiendo el username $kicker y cambiando flag a $hand"
         return 1
      }
   }
}
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Jun 28, 2008 10:43 am    Post subject: Reply with quote

hi metroid.

the script only recognizes the $kicker but not the $hand
yeah suspend the username, but no recognizes $hand.

what happend ;/.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Jun 28, 2008 11:11 am    Post subject: Reply with quote

Code:
variable adminlist "nick1 nick2 nick3"

bind kick - * xstuff:kick

proc xstuff:kick {nick host hand chan target reason} {
   if {[matchattr [nick2hand $target $chan] b|b $chan] || [matchattr [nick2hand $target $chan] o|o $chan]} {
      set kicker [string trim [lindex [split $reason] 0] {()}]
      set hand [nick2hand $kicker $chan]
      if {[string match -nocase "\*" [lindex [split $hand] 0]] } {
         xstuff:admin "X ha utilizado para patada $target. No puedo suspender $kicker. Este usuario no tiene asa."
         return 0
      } elseif {[lindex [split $hand] 0] == ""} {
         xstuff:admin "X ha utilizado para patada $target. No puedo suspender $kicker. No se puede encontrar este apodo en irc por más tiempo.."
         return 0
      }
      if {[matchattr $hand E]} {
         deluser $hand
         putserv "PRIVMSG X :REMUSER $chan $kicker"
         return 1
      } elseif {[matchattr $hand Y]} {
         chattr $hand -Y+E
         putserv "PRIVMSG X :SUSPEND $chan $kicker 3d"
         return 1
      } else {
         chattr $hand +Y
         putserv "PRIVMSG X :SUSPEND $chan $kicker 2d"
         putlog "Suspendiendo el username $kicker y cambiando flag a $hand"
         return 1
      }
   } else {
      return 0
   }
}

proc xstuff:admin {text} {
   foreach admin $::adminlist {
      putserv "privmsg $admin :$text"
   }
}

putlog "Suspend and remuser"

There are two instances where admins will be needed. Fill the admin list at top with a list of nicks you want alerted when the suspend script cannot: a) find the nickname on irc b) cannot find the handle record for nick

Edit: corrected missing bracket according to post below, all is well now.
_________________
speechles' eggdrop tcl archive


Last edited by speechles on Sat Jun 28, 2008 11:45 am; edited 2 times in total
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Jun 28, 2008 11:29 am    Post subject: Reply with quote

Code:
<Chasse> [15:28] #Nor7on# set errorInfo
<Chasse> Currently: missing close-bracket
<Chasse> Currently:     ("if" test expression)
<Chasse> Currently:     while compiling
<Chasse> Currently: "if {[string match -nocase "\*" [lindex [split $hand] 0] } {
<Chasse> Currently:          xstuff:admin "$kicker has used X to kick $target. I cannot suspend $kicker. This ..."
<Chasse> Currently:     ("if" then script line 4)
<Chasse> Currently:     while compiling
<Chasse> Currently: "if {[matchattr [nick2hand $target $chan] b|b $chan] || [matchattr [nick2hand $target $chan] o|o $chan]} {
<Chasse> Currently:       set kicker [string trim [lindex [split..."
<Chasse> Currently:     (compiling body of proc "xstuff:kick", line 2)
<Chasse> Currently:     invoked from within
<Chasse> Currently: "xstuff:kick $_kick1 $_kick2 $_kick3 $_kick4 $_kick5 $_kick6"
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Jun 28, 2008 11:41 am    Post subject: Reply with quote

Use the edited script above, forgot a simple bracket on the string match.. DOH! Humans being human, this is what we do, we make mistakes.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Jun 28, 2008 11:47 am    Post subject: Reply with quote

i have windrop 1.6.18 i paste this code exactly

Code:
variable adminlist "Nor7on^"

bind kick - * xstuff:kick

proc xstuff:kick {nick host hand chan target reason} {
   if {[matchattr [nick2hand $target $chan] b|b $chan] || [matchattr [nick2hand $target $chan] o|o $chan]} {
      set kicker [string trim [lindex [split $reason] 0] {()}]
      set hand [nick2hand $kicker $chan]
      if {[string match -nocase "\*" [lindex [split $hand] 0] } {
         xstuff:admin "X ha utilizado para patada $target. No puedo suspender $kicker. Este usuario no tiene asa."
         return 0
      } elseif {[lindex [split $hand] 0] == ""} {
         xstuff:admin "X ha utilizado para patada $target. No puedo suspender $kicker. No se puede encontrar este apodo en irc por más tiempo.."
         return 0
      }
      if {[matchattr $hand E]} {
         deluser $hand
         putserv "PRIVMSG X :REMUSER $chan $kicker"
         return 1
      } elseif {[matchattr $hand Y]} {
         chattr $hand -Y+E
         putserv "PRIVMSG X :SUSPEND $chan $kicker 3d"
         return 1
      } else {
         chattr $hand +Y
         putserv "PRIVMSG X :SUSPEND $chan $kicker 2d"
         putlog "Suspendiendo el username $kicker y cambiando flag a $hand"
         return 1
      }
   } else {
      return 0
   }
}

proc xstuff:admin {text} {
   foreach admin $::adminlist {
      putserv "privmsg $admin :$text"
   }
}

putlog "Suspend and remuser"


when some1 kickme get this error in partyline.

Code:
<Chasse> [15:45] Tcl error [xstuff:kick]: missing close-bracket
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Jun 28, 2008 11:49 am    Post subject: Reply with quote

Nor7on wrote:
i have windrop 1.6.18 i paste this code exactly

Code:
variable adminlist "Nor7on^"

bind kick - * xstuff:kick

proc xstuff:kick {nick host hand chan target reason} {
   if {[matchattr [nick2hand $target $chan] b|b $chan] || [matchattr [nick2hand $target $chan] o|o $chan]} {
      set kicker [string trim [lindex [split $reason] 0] {()}]
      set hand [nick2hand $kicker $chan]
      if {[string match -nocase "\*" [lindex [split $hand] 0] } {
         xstuff:admin "X ha utilizado para patada $target. No puedo suspender $kicker. Este usuario no tiene asa."
         return 0
      } elseif {[lindex [split $hand] 0] == ""} {
         xstuff:admin "X ha utilizado para patada $target. No puedo suspender $kicker. No se puede encontrar este apodo en irc por más tiempo.."
         return 0
      }
      if {[matchattr $hand E]} {
         deluser $hand
         putserv "PRIVMSG X :REMUSER $chan $kicker"
         return 1
      } elseif {[matchattr $hand Y]} {
         chattr $hand -Y+E
         putserv "PRIVMSG X :SUSPEND $chan $kicker 3d"
         return 1
      } else {
         chattr $hand +Y
         putserv "PRIVMSG X :SUSPEND $chan $kicker 2d"
         putlog "Suspendiendo el username $kicker y cambiando flag a $hand"
         return 1
      }
   } else {
      return 0
   }
}

proc xstuff:admin {text} {
   foreach admin $::adminlist {
      putserv "privmsg $admin :$text"
   }
}

putlog "Suspend and remuser"


when some1 kickme get this error in partyline.

Code:
<Chasse> [15:45] Tcl error [xstuff:kick]: missing close-bracket

I fixed it, see the code above where I originally posted it with adminlist config setting. There was indeed a missing closing bracket on the string match that has since been addressed. It will now work as intended for you, and when it doesn't will message one of your admin's why it isn't doing what is expected.
Code:
      if {[string match -nocase "\*" [lindex [split $hand] 0] } {

Code:
      if {[string match -nocase "\*" [lindex [split $hand] 0]] } {

Top is incorrect, missing bracket. Bottom is correct, brackets align. This is the error you see.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Jun 28, 2008 1:53 pm    Post subject: Reply with quote

it work, but dont change flag when an user kick to other user with different name . ex:
Code:

^Modo^ is nor7on@Colmillo.users.undernet.org
Nombre : Visita: ------------
Canales : @#chan1 @#chan2 @#chan3
Servidor : *.undernet.org - The Undernet Underworld
Modo is Logged how: Colmillo

<Nor7on^> .whois Modo
<Chasse> HANDLE    PASS NOTES FLAGS           LAST
<Chasse> Modo      no       0 bflo            17:28 (#Madrid)
<Chasse>   HOSTS: *!*@Colmillo.users.undernet.org
<Chasse>   ADDRESS: xx.xxx.xxx.x
<Chasse>      users: xxxx, bots: xxxx


when ^Modo^(Colmillo) kick via X to me, Chasse can't change flag to Colmillo or ^Modo^.'cause don't find Colmillo or ^Modo^ in userlist.

so there is some way to instert a database for:

$username = $hand

example:

Colmillo = Modo
Alask = Alaska
Ligre = Felino

if it finds "Colmillo" in the kick message, it read the database for change flag to Modo.
if it finds "Ligre" in the kick message, it read the database for change flag to Felino.
etc...

some suggestion? it's possible?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
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