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.

Help me with editing this (Part 2 :))

Old posts that have not been replied to for several years.
Locked
I
Insectora
Voice
Posts: 16
Joined: Thu Feb 20, 2003 2:51 am
Location: Germany

Help me with editing this (Part 2 :))

Post by Insectora »

hehe thank you a lot in editing the previous script :))
Now this is my second problem with scripts :))
This is a chalenge for you :)))

In this scripts When i write .masskick in DCC to kick all chaters in my Chanel, the bot kicks also and Me:( I don't want to kick me with the others chaters :)) Help !! to editing the script !!!

Here is the script :

proc dcc_masskick {nick idx arg} {
global botnick
if {$arg== ""} {
putdcc $idx " masskick <#channel> - To MassKick Users"
return 1
}
set members [chanlist $arg]
foreach who $members {
if {![onchansplit $who $arg] && $who != $botnick && $who != $nick} {
putserv "KICK $arg $who :Mass Kick"
}}
}


The second Scripts that make anger :)
When i write .massdeop in DCC to deop all chaters in my Chanel, the bot deops also and Me:( I don't want to deop me with the others chaters :)) Help !! to editing the script !!! Thank you in advance :)) I know You are the best programers :))))

Here is the second script .

proc dcc_massdeop {nick idx arg} {
global botnick mass
if {$arg== ""} {
putdcc $idx "TaKeOvEr 1.0 by SaVeR"
putdcc $idx " massdeop <#channel> - To MassDEOP Users"
return 1
}
if {$mass==1} {
set deopnicks ""
set massdeopz 0
set members [chanlist $arg]
foreach who $members {
if {[isop $who $arg] && ![onchansplit $who $arg] && $who != $botnick && $who != $nick} {
if {$massdeopz < 4} {
append deopnicks " $who"
set massdeopz [expr $massdeopz + 1]
}
if {$massdeopz == 4} {
set massdeopz 0
putdcc $idx "*** Mode $arg -oooo $deopnicks"
putserv "MODE $arg -oooo $deopnicks"
set deopnicks ""
append deopnicks " $who"
set massdeopz 1
}
}
}
putserv "MODE $arg -oooo $deopnicks"
putdcc $idx "*** Mode $arg -oooo $deopnicks (Last Few)"
putlog "#$nick# massdeop"
}
}

Please after edit the scripts, post them here in the forum the new script, so i copy and paste them in my tcl :)))) Thank yo a lot :))))
I dont understand to edit and to make tcl, but am learning at the moment :)))
Stealth
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

First thing first, read the things that we discussed in your prevoius post about that code and do the necesarly changes to this one..

Also:

1. Don't use $arg, use $text.
2. A fix for the foreach thing:

Code: Select all

set chan [string tolower [lindex $text 0]]

foreach who $members { 
  if {[validuser [nick2hand $who $chan]]} { continue }
  .. rest of the code ..
}
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 »

I've took the liberty to modify a bit your second code and here is the result:

Code: Select all

proc dcc_masskick {nick idx text} { 
  global botnick 
  if {![llength $text] > 0} {
    putdcc $idx "Usage: .masskick <#channel> - To MassKick Users" 
    return 1
  } 
  set chan [tolower [lindex $text 0]]
  if {![botisop $chan]} {
    putdcc $idx "Sorry, but I'm not oped in $chan channel.." 
    return 1
  }
  set members [chanlist $chan] 
  foreach who $members { 
    if {$who == [tolower $botnick] || [validuser [nick2hand $who $chan]]} { continue }
    putkick $chan $who "Mass Kick" 
  } 
}

proc dcc_massdeop {nick idx text} { 
  global botnick
  if {![llength $text] > 0} {
    putdcc $idx "TaKeOvEr 1.0 by SaVeR" 
    putdcc $idx "Usage: .masskick <#channel> - To MassKick Users" 
    return 1
  } 
  set chan [tolower [lindex $text 0]]
  if {![botisop $chan]} {
    putdcc $idx "Sorry, but I'm not oped in $chan channel.." 
    return 1
  }
  set members [chanlist $chan] 
  foreach who $members { 
    if {$who == [tolower $botnick] || ![isop $who $chan] || [validuser [nick2hand $who $chan]]} { continue }
    pushmode $chan -o $who
    putlog "#$nick# massdeop" 
  } 
}
Hope I haven't forgot something.. :P
Once the game is over, the king and the pawn go back in the same box.
I
Insectora
Voice
Posts: 16
Joined: Thu Feb 20, 2003 2:51 am
Location: Germany

Post by Insectora »

Yes you forgot something :)))
The script you posted is not working:)))
You should fix the script:)))
I copy and paste your script but... here is what the bot console wrote :
TCL error [dcc_massdeop]: invalid command name "tolower"
Stealth
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

should be [string tolower .....
Elen sila lúmenn' omentielvo
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

only because i am curious

Post by De Kus »

but why the hell do you need a takeover script, like you called it yourself?
Insectora wrote:putdcc $idx "TaKeOvEr 1.0 by SaVeR"
I
Insectora
Voice
Posts: 16
Joined: Thu Feb 20, 2003 2:51 am
Location: Germany

Post by Insectora »

Mmm yes the mistake was the "string"
But after i run the new script , it doesnt work well :(((
Any other suggestions ?? Any other new scripts??
Stealth
I
Insectora
Voice
Posts: 16
Joined: Thu Feb 20, 2003 2:51 am
Location: Germany

Post by Insectora »

De kus
Sorry but this is not a takeover script. I am not going to TO chanels with this bot. I only want kick all users in my channel if there are takeovers and inviters. my chanel is very small , and the other chaters are not going to be angry , because the are my friends:))) thats all
And I only asked for a help to work good this script:))
ok??:))))))
Stealth
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Oups.. :oops: .. seems that I've forgot a word :)

replace:

Code: Select all

  set chan [tolower [lindex $text 0]] 
with:

Code: Select all

  set chan [string tolower [lindex $text 0]]
My appologies..
Once the game is over, the king and the pawn go back in the same box.
I
Insectora
Voice
Posts: 16
Joined: Thu Feb 20, 2003 2:51 am
Location: Germany

Post by Insectora »

Caesar
sorry but your scripts is not good:(
After i raplace the new code, and i wrote .masskick,
the bot first kick itself:((
So please fix the script again:)))))))))))))))))
Stealth
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

hihi

Post by De Kus »

he seems to be in love with tolower, just dont tolower the botnick, not neccerary in this case again and making only troubles :).
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

It seems that I'm placing it where is no need of it :)

replace

Code: Select all

if {$who == [tolower $botnick] || ![isop $who $chan] || [validuser [nick2hand $who $chan]]} { continue } 
with

Code: Select all

if {$who == $botnick || ![isop $who $chan] || [validuser [nick2hand $who $chan]]} { continue } 
And should work fine. Damn 'tolower' :)
Once the game is over, the king and the pawn go back in the same box.
I
Insectora
Voice
Posts: 16
Joined: Thu Feb 20, 2003 2:51 am
Location: Germany

Post by Insectora »

Thank you a lot caesar !!! Thank you all guys:))
The script now is really good :)) You are the best :))
you know everything about scripts.And it is good for helping people . I hope Someday i will help people, when i learn the TCl :))))
For now i am only training with the scripts:)))
Stealth
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Your welcome. If there is something else you want help on, just ask.. :)
Once the game is over, the king and the pawn go back in the same box.
Locked