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.

Caesar's tsunami.tcl shows an error in partyline.

Old posts that have not been replied to for several years.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Caesar's tsunami.tcl shows an error in partyline.

Post by Sir_Fz »

here' the error that appears in the partyline:
[07:36] Tcl error [tsunami:pub]: can't read "::linelength": no such variable
I think it appears whenever somebody says something on the channel.

so caesar can u fix this plz :) I liked the script :P
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Oups.. yes, replace from: $::linelength to $linelength and should do fine.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I did that before I posted this thread, and new errors appeard:
[14:22] Tcl error in script for 'timer6956':
[14:22] bad index "dhiva": must be integer or end?-integer?
dhiva is the nick of the person who wrote something on the pub.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

This "dhiva" is not from my script. Anyway, unload it and see if the errors are still there.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

well dhiva is a nick
like for example I, Sir-Fz wrote something
it gives the following error:

[15:42] Tcl error in script for 'timer6956':
[15:42] bad index "Sir-Fz": must be integer or end?-integer?

so how to fix it ?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

well that error doesn't appear anymore, now this error appears:
[05:49] Tcl error [tsunami:pub]: can't read "bla(#channel)": no such element in array
every time somebody says something on the main of a channel this error appears.

P.S. (in the quote above) #channel is the name of the channel where someone speaks.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

There should be something like this:

Code: Select all

foreach chan [channels] {
  set bla([strlwr $chan]) 0
}
if it dosen't exist then add it before the tsunami:pub proc.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

yes there is this code in the script
Here's the script so u can see it:

Code: Select all

# tsunami.tcl
# version 0.1 beta 2
# caesar <cezarica@prietenii.com>
# #eggdrop @ Undernet.org
# http://www.geocities.com/caesartcl/

### Description:
# Will lock and kick+ban the users that use a tsunami flood on the channel.

### Notes:
# This is still in beta testing so use it on your own risk!
# You will need eggdrop 1.6.x in order this to work.

# What channel modes do you want to be used for locking the channel?
set modes "mR"

# Number of lines in seconds keep channel locked for if they have how many characters?
# By default I've set it to 5 lines in 3 seconds to lock the channel for 60 seconds if they have more than 50 characters.
set ltl 6:3:30:13

### ANY EDITING AND/OR MODIFICATIONS MADE BEYOND THIS IS YOUR OWN RISK! ###

# binds #
bind pubm - * tsunami:pub
bind part - * tsunami:part

# stuff #
set blist ""
# setudef flag tsunami

# array fix #
foreach chan [channels] {
#  if {![channel get [strlwr $chan] tsunami]} {
#    return
#  }
  set bla([strlwr $chan]) 0
}

# tsunami #
proc tsunami:pub {nick uhost hand chan text} { 
  global bla blist
  if {[strlwr $nick] == [strlwr $::botnick] || ![botisop [strlwr $chan]]} {
# || ![channel get [strlwr $chan] tsunami]
    return
  }
  set cm [getchanmode [strlwr $chan]]   
  if {(([string match {+*[$::modes]*[::modes]*} $cm]) && ([llength [split $::modes]] == 1)) || (([string match {+*[::modes]*[::modes]* *} $cm]) && ([length [split $cm]] > 1))} { return }

  set linelength [lindex [split $::ltl ":"] 3]
  if {[string length [join [split $text] ""]] > "$linelength"} {
    lappend blist [strlwr $nick]
    set lines [lindex [split $::ltl ":"] 0]
    set insec [lindex [split $::ltl ":"] 1]
    set unlock [lindex [split $::ltl ":"] 2]
    incr bla([strlwr $chan])
    utimer $insec "reset [strlwr $chan]"
    utimer $insec "remove [strlwr $nick]"
    if {$bla([strlwr $chan]) >= $lines} {
      putquick "MODE [strlwr $chan] +$::modes"
      foreach luser $blist {
        set mask "*!*@[lindex [split [getchanhost $luser [strlwr $chan]] @] 1]"
        newchanban [strlwr $chan] $mask Tsunami "Tsunami flooder!" 5
      }
      utimer $unlock "unlock [strlwr $chan]"
    }
  }
}

# reset #
proc reset {chan} { 
  global bla
  incr bla([strlwr $chan]) -1
  return
}

# remove #
proc remove {nick} { 
  global blist
  lreplace blist [strlwr $nick] [strlwr $nick]
  return
}

# unlock #
proc unlock {chan} {
  putquick "MODE [strlwr $chan] -$::modes"
  return
}

# array remove #
proc tsunami:part {nick uhost hand chan msg} {
  global bla
  if {$nick != $::botnick} {
    return
  }
  foreach arr_part [array names bla] {
    if {[string match [strlwr [strlwr $chan]] $arr_part]} {
      array unset bla [strlwr $chan]
    }
  }
}

putlog "tsunami.tcl.. loaded"
what seems to be the problem ?
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Replace the folowing stuff:

Code: Select all

utimer $insec [list reset [strlwr $chan]]
utimer $insec [list remove [strlwr $nick]]
and:

Code: Select all

# remove #
proc remove {nick} { 
  global blist
  set index [lsearch -exact $blist [strlwr $nick]] 
  set blist [lreplace $blist $index $index]
  return
}
and should be working fine.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

[07:00] Tcl error in file 'eggdrop.conf':
[07:00] can't read "insec": no such variable
while executing
"utimer $insec [list reset [strlwr $chan]] "
(file "scripts/Tsunami.tcl" line 76)
invoked from within
"source scripts/Tsunami.tcl"
(file "eggdrop.conf" line 1359)
[07:00] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
the bot dies.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Seesh.. replace from:

Code: Select all

    utimer $insec "reset [strlwr $chan]" 
    utimer $insec "remove [strlwr $nick]" 
to:

Code: Select all

utimer $insec [list reset [strlwr $chan]] 
utimer $insec [list remove [strlwr $nick]] 
This two are in the tsunami:pub proc.. the remove is separated. Just replace the old one with the new one. Is this hard?
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

proc tsunami:pub {nick uhost hand chan text} {
global bla blist
if {[strlwr $nick] == [strlwr $::botnick] || ![botisop [strlwr $chan]]} {
# || ![channel get [strlwr $chan] tsunami]
return
}
this is the tsunami:pub proc, there are no utimers to replace :s
but here :

Code: Select all

set linelength [lindex [split $::ltl ":"] 3] 
  if {[string length [join [split $text] ""]] > "$linelength"} {
    lappend blist [strlwr $nick]
    set lines [lindex [split $::ltl ":"] 0]
    set insec [lindex [split $::ltl ":"] 1]
    set unlock [lindex [split $::ltl ":"] 2]
    incr bla([strlwr $chan])
    utimer $insec "reset [strlwr $chan]"
    utimer $insec "remove [strlwr $nick]"
should i replace these timers by yours ?
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Under the "incr bla([strlwr $chan])" in the "tsunami:pub" proc are the two utimers that I was talking about that should be changed with the new ones I've gave you.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok thanx man :) now it shows no errors.

But your njf.tcl gives similar errors as tsunami.tcl, can u fix it please

also the longline.tcl gives an error like "text after closed quote" If I remember.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I'm sorry for bugging u
but Tsunami.tcl is still giving this error
[08:33] Tcl error [tsunami:pub]: can't read "bla(#channel)": no such element in array
as I said before "#channel" is the name of a channel where the bot is oped.
Locked