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 

Caesar's tsunami.tcl shows an error in partyline.
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Jun 07, 2003 10:35 am    Post subject: Caesar's tsunami.tcl shows an error in partyline. Reply with quote

here' the error that appears in the partyline:
Quote:
[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 Smile I liked the script Razz
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Sat Jun 07, 2003 11:32 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Jun 07, 2003 5:21 pm    Post subject: Reply with quote

I did that before I posted this thread, and new errors appeard:
Quote:
[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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Sun Jun 08, 2003 1:57 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jun 10, 2003 8:41 am    Post subject: Reply with quote

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 ?
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jun 10, 2003 8:49 am    Post subject: Reply with quote

well that error doesn't appear anymore, now this error appears:
Quote:
[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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Tue Jun 10, 2003 8:59 am    Post subject: Reply with quote

There should be something like this:
Code:

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.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jun 10, 2003 9:19 am    Post subject: Reply with quote

yes there is this code in the script
Here's the script so u can see it:
Code:
# 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 ?
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Tue Jun 10, 2003 9:34 am    Post subject: Reply with quote

Replace the folowing stuff:
Code:

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


and:
Code:

# 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.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jun 10, 2003 10:02 am    Post subject: Reply with quote

Quote:
[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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Tue Jun 10, 2003 10:16 am    Post subject: Reply with quote

Seesh.. replace from:
Code:

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

to:
Code:

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.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jun 10, 2003 10:25 am    Post subject: Reply with quote

Quote:
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:
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 ?
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Tue Jun 10, 2003 10:35 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jun 10, 2003 11:31 am    Post subject: Reply with quote

ok thanx man Smile 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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jun 10, 2003 11:34 am    Post subject: Reply with quote

I'm sorry for bugging u
but Tsunami.tcl is still giving this error
Quote:
[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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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