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.

Need Some Coding Help.

Old posts that have not been replied to for several years.
Locked
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Need Some Coding Help.

Post by CoMMy »

Well. Here Is The TCL. Can U help me change This coding i took from xstuff.tcl? (thanks to caesar) Basically i want it Not to remuser a user when it kicks the bot. Just to Ban Him by Undernets X bot. And the i want it to work when chanset is +xprotect. Plus Something Not to ban +fmn users. Thanks u all.

Below Is The Original Source From xstuff.tcl

Code: Select all

bind kick - "*" my:kick
proc kick_xkickprotect {nick uh hand chan vict reas} { 
  if {$nick != "X" || ![channel get $chan xprotect]} { return 0 }
  set kicker [string trim [lindex [split $reas] 0] {()}] 
  if {$vict == $::botnick} {
    putquick "PRIVMSG X :remuser $chan ${kicker}"
  } 
  return
}
This Is to what i changed it.

Code: Select all

bind mode - "* kick"  kick_xkickprotect
proc kick_xkickprotect {nick uh hand chan vict reas} { 
global botnick
  if {$nick != "X" || ![channel get $chan xprotect]} {
  if {$vict == $botnick} {
    putserv "PRIVMSG X :ban $chan $nick NEVER KICK ME ASSHOLE."
  } 
  return
}
Well. Mine doesnt work. Can u help me on this one?
Thanks. :wink:
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

Hi,

The line you used is mIRC scripting code format, I don't think it works in TCL:

Code: Select all

  putserv "PRIVMSG X :ban $chan $nick NEVER KICK ME ASSHOLE." 
Although I am not sure how X works, I have never been on Undernet or any similar network.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

this is how it should be:

Code: Select all

putserv "PRIVMSG X :ban $chan ${kicker} NEVER KICK ME ASSHOLE."
to not apply on +f users, replace:

Code: Select all

if {$nick != "X" || ![channel get $chan xprotect]} { return 0 }
with:

Code: Select all

if {$nick != "X" || ![channel get $chan xprotect] || [matchattr $hand f|f $chan]} {return 0}
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

if {$nick != "X" || ![channel get $chan xprotect]} {
shouldn't this check that the kicker is not X and that the channel has +xprotect?
right now it checks to see if it's not X or it has -xprotect...
change it to

Code: Select all

if {$nick != "X" && [channel get $chan xprotect]} {
and try again
Elen sila lúmenn' omentielvo
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Thanks.

Post by CoMMy »

Gee. Thanks.

I'll check it out and i'll let you know if it works.

Thanks again.
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Thanks.

Post by CoMMy »

Gee. Thanks.

I'll check it out and i'll let you know if it works.

Thanks again. :)
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Doesnt Work After all.

Post by CoMMy »

Well It doesnt work.
this is what it became.
but again it doesnt work.

Code: Select all

bind mode - "* kick"  kick_xkickprotect
global botnick
  if {$nick != "X" && ![channel get $chan xprotect] && [matchattr $hand f|f $chan]} {return 0} {
  if {$vict == $botnick} {
    putserv "PRIVMSG X :ban $chan $nick NEVER KICK ME ASSHOLE." 
  return 1 }}}
Help pls.
I beleive the prob is with the $vict variable.
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

no, you changed some of the if-check puts forgot to change

Code: Select all

$nick != "X"
aslo you can change

Code: Select all

if {$vict == $botnick} {
to

Code: Select all

if {[string equal -nocase $vict $botnick]} {
also... you have

Code: Select all

setudef flag xprotect
in your code don't you?
Elen sila lúmenn' omentielvo
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Help

Post by CoMMy »

Yes I do Have The sutupdef flag.
When Someone Kicks The Bot Noting Happens.
And The Channel Is set to +xprotect.

This is weird.
Suggestions?
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

hmmm sorry I didn't make myself 110% clear
I said you forgot to change

Code: Select all

$nick != "X"
I kida thought you would figure out to what :)

Code: Select all

$nick == "X"
is the right one
Elen sila lúmenn' omentielvo
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Thanks

Post by CoMMy »

Oh my god i must be so blind.

Thanks man.
I'll check it out.
Hope it works.
8) :P :D :wink:
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

I found it.

Post by CoMMy »

It wasnt the coding after all.
It was the BIND.

Code: Select all

bind mode - "* kick" pub...
it should be.

Code: Select all

bind kick "*" pub....
Thanks anyway.[/code]
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

I found it.

Post by CoMMy »

It wasnt the coding after all.
It was the BIND.

Code: Select all

bind mode - "* kick" pub...
it should be.

Code: Select all

bind kick "*" pub....
Thanks anyway.
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
T
TsT
Voice
Posts: 16
Joined: Tue Mar 04, 2003 11:03 am
Location: Strasbourg, France
Contact:

Post by TsT »

Papillon wrote:you can change

Code: Select all

if {$vict == $botnick} {
to

Code: Select all

if {[string equal -nocase $vict $botnick]} {
You can also change to

Code: Select all

if {[isbotnick $vict]} {
and remove the

Code: Select all

global botnick
Locked