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 

Auto Voice after Certain lines in Certain Time

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


Joined: 01 Nov 2005
Posts: 12

PostPosted: Mon Nov 21, 2005 2:37 pm    Post subject: Auto Voice after Certain lines in Certain Time Reply with quote

I have modified the auto voice after talking some lines. And added udef flag for matching channels and unset the variable after voicing them but i am getting error... The script is as follows:

Code:

# Set Number of lines for the bot to voice
set vline 4
# Set in max number of seconds here.
set vsec 25

setudef flag voice

bind pubm - * voice:user
proc voice:user {nick uhost hand chan arg} {
global actvoice vline vsec
  if {([isop $nick $chan]) || ([isvoice $nick $chan])} {return 0}
  if {[lsearch -exact [channel info $chan] +voice] == -1} {return 0}
  if {![info exists actvoice([string tolower $nick])]} { set actvoice([string tolower $nick]) 0 }
  incr actvoice([string tolower $nick])
  utimer $vsec [list incr actvoice([string tolower $nick]) -1]
  if {$actvoice([string tolower $nick]) >= $vline} {
    putserv "MODE $chan +v $nick"
    unset actvoice([string tolower $nick])
 }
}


the error i am getting from the bot in party line after voicing is as follows:
Quote:

[12:29] #THRRaaga: mode change '+v Romeyo' by THRraaga!rakesh@stand.up.for.the.mast3r.com
[12:29] Tcl error in script for 'timer366':
[12:29] can't read "actvoice(romeyo)": no such element in array
[12:29] Tcl error in script for 'timer367':
[12:29] can't read "actvoice(romeyo)": no such element in array
[12:29] Tcl error in script for 'timer368':
[12:29] can't read "actvoice(romeyo)": no such element in array
[12:30] Tcl error in script for 'timer369':
[12:30] can't read "actvoice(romeyo)": no such element in array


Help me...
Thanks... Smile
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Nov 22, 2005 12:01 am    Post subject: Reply with quote

you unset the array element which you later try to decrement in [utimer]

some tips:

  • don't use [lsearch] on [channel info], use [channel get]
  • don't use [putserv], use [pushmode]; it will automatically pack several modes on single line as necessary
  • your script logic is flawed; get rid of [utimer] and vline, you don't use those correctly anyway


in general, your script (even properly implemented) is useless; voicing someone who can speak already is pointless
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
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