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.

very weird error

Old posts that have not been replied to for several years.
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

very weird error

Post by DarkJFMan »

Code: Select all

# `DeVoice <nick>
bind pub - `dev pub:dvnick
proc pub:dvnick {nick uhost hand chan text} {
global owner
if {[$nick != $owner]} { putserv "NOTICE $nick :You don't have access" }
else { putserv "MODE $chan -v $text" 
	putserv "PRIVMSG $chan :$nick is now -V" }
}
[12:28:19am] <DarkJFGirl> [03:26] Tcl error [pub:dvnick]: invalid command name "DarkJFMan"
What's wrong with it?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

if {[$nick != $owner]}
drop the []
Elen sila lúmenn' omentielvo
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

Code: Select all

bind pub - `kb pub:bkick
proc pub:bkick {nick uhost hand chan arg} {
  global owner botnick
  set bnick [join [lindex $arg 0]]
  if {$nick != $owner} {
    putserv "NOTICE $nick :You don't have access"
  } else {
    putserv "MODE $chan +b *!*@[join [lindex [split [getchanhost $bnick] "@"] 1]]"
    putkick "$chan $bnick Kicked on request of $nick"
    utimer [lindex $arg 1] putserv "MODE $chan -b *!*@[join [lindex [split [getchanhost $bnick] "@"] 1]]"
    putserv "PRIVMSG $chan :$bnick has been banned for [duration [lindex $arg 1]]
  }
}
whenever i try to load it, my bot crash any help plz
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

it helps if you tell us what the error returned is ;)
Elen sila lúmenn' omentielvo
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

[05:03:09am] <DarkJFGirl> [08:01] Tcl error [pub:bkick]: wrong # args: should be "putkick channel nick?s? ?comment?"
[05:03:10am] <DarkJFGirl> [08:01] #hooters: mode change '+b *!*@CS-Open`Bot.user.gamesurge' by DarkJFGirl!~lamest@DarkJFGirl.user.gamesurge
Last line in the script I put i forgot " but i fixed that. So any ideas?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

read the errormsg carefully and you'll be told what's wrong.. :)

Code: Select all

#when enclosed in "'s the arguments is read as ONE argument
putkick "$chan $bnick Kicked on request of $nick"
#this is the correct way
putkick $chan $bnick "Kicked on request of $nick"
Elen sila lúmenn' omentielvo
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

[07:07:29am] <DarkJFGirl> [10:05] Tcl error in script for 'timer3':
[07:07:30am] <DarkJFGirl> [10:05] wrong # args: should be "putserv text ?options?"
# `Bankick <nick>
bind pub - `kb pub:bkick
proc pub:bkick {nick uhost hand chan arg} {
global owner botnick
set bnick [join [lindex $arg 0]]
if {$nick != $owner} {
putserv "NOTICE $nick :You don't have access"
} else {
putserv "MODE $chan +b *!*@[join [lindex [split [getchanhost $bnick] "@"] 1]]"
putkick $chan $bnick "Kicked on request of $nick"
utimer [lindex $arg 1] "putserv MODE $chan -b *!*@[join [lindex [split [getchanhost $bnick] "@"] 1]]"
putserv "PRIVMSG $chan :$bnick has been banned for [duration [lindex $arg 1]]"
}
}
is it the utimer? because my bot is banning/kicking correctly it's just not unbanning.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Code: Select all

utimer [lindex $arg 1] [putserv "MODE $chan -b *!*@[join [lindex [split [getchanhost $bnick] "@"] 1]]"]
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

gb wrote:

Code: Select all

utimer [lindex $arg 1] [putserv "MODE $chan -b *!*@[join [lindex [split [getchanhost $bnick] "@"] 1]]"]
What's the point of using a utimer, if you are just going to have the command executed right away anyways? (Ie. the []'s invoking the command substitution) ...

Think you might have meant [list putserv , but left out the 'list' ...

Code: Select all

utimer [lindex $arg 1] [list putserv "MODE $chan -b *!*@[join [lindex [split [getchanhost $bnick] "@"] 1]]"]
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

hehe, oops, guess i was a bit fast there, i actually ment to use braces, not brackets
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

the utimer is for when i type `kb <nick> <ban time> it will unban them after that many seconds

But thanks anyway :D :D
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

More questions... for a kick script now

Code: Select all

bind pub - `k pub:kick
proc pub:kick {nick uhost hand chan arg } {
global owner
if {$nick != $owner} {
putserv "NOTICE $nick :You don't have access"
} else {
putkick $chan $arg "Kicked on request of $nick" 
}
}
what i'm trying to do
} else {
set fs [open reasons.txt r]
putkick $chan $arg "gets fs $line"
}
}

does that make it read a random line from reasons.txt
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

Code: Select all

bind pub - `k pub:kick
proc pub:kick {nick uhost hand chan arg } {
global owner
set fname "reasons.txt"
set fp [open $fname "r"]
set data [read -nonewline $fp]
close $fp
set lines [split $data "\n"] 
set numlines [llength $lines]
set num [rand $numlines]
set randline [lindex $lines $num]
if {$nick != $owner} {
putserv "NOTICE $nick :You don't have access"
} else {
putkick $chan $arg "$randline" 
}
}
I put code in the scripts directory and in text directory but i get this message from bot
[11:35:11pm] <DarkJFGirl> [02:33] Tcl error [pub:kick]: couldn't open "reasons.txt": no such file or directory
where exactly i'm supposed to put it
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

DarkJFMan wrote:

Code: Select all

bind pub - `k pub:kick
proc pub:kick {nick uhost hand chan arg } {
global owner
set fname "reasons.txt"
set fp [open $fname "r"]
set data [read -nonewline $fp]
close $fp
set lines [split $data "\n"] 
set numlines [llength $lines]
set num [rand $numlines]
set randline [lindex $lines $num]
if {$nick != $owner} {
putserv "NOTICE $nick :You don't have access"
} else {
putkick $chan $arg "$randline" 
}
}
I put code in the scripts directory and in text directory but i get this message from bot
[11:35:11pm] <DarkJFGirl> [02:33] Tcl error [pub:kick]: couldn't open "reasons.txt": no such file or directory
where exactly i'm supposed to put it
Likely in the directory where the bot is started from.
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

eggdrop is fun i just did 8ball all on my own... anyway i'm trying to edit my previous scripts

Code: Select all

bind pub - `join pub:addchan
proc pub:addchan {nick uhost hand chan text} {
global owner
set joined [lindex $text 0]
if {$nick != $owner} {
putserv "NOTICE $nick :You don't have access" 
} else { 
channel add $text 
putserv "PRIVMSG $joined :$joined joined." 
}
}
it works fine, the problem is that it's msging $joined twice any ideas why?
Locked