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 for those learning Tcl or writing their own scripts.
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Dec 12, 2006 12:01 pm
Yes... so why do you then force your bot to leave if there's more than 5 members?
NML_375
Red_Rooste5
Voice
Posts: 37 Joined: Sat Oct 21, 2006 7:43 am
Post
by Red_Rooste5 » Tue Dec 12, 2006 12:06 pm
Well... Another error
Code: Select all
[17:04] Tcl error in file 'eggdrop.conf':
[17:04] wrong # args: should be "proc name args body"
while executing
"proc invites:joinmsg {nick uhost hand chan} {
global requirement
set nickonchan [llength [chanlist $chan]]
if {$nickonchan < $requirement} {
p..."
(file "scripts/invite1.tcl" line 20)
invoked from within
"source scripts/invite1.tcl"
(file "eggdrop.conf" line 1353)
[17:04] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Red_Rooste5 @ bluebird.tx-shells.com ~/eggdrop $
Code:
Code: Select all
bind raw - INVITE invites:join
proc invites:join {from key arg} {
set chan [string range [lindex [split $arg] 1] 1 end]
set chans [llength [split [channels]]]
set nick [lindex [split $from !] 0]
if {$chans == 30} {
putquick "NOTICE $nick :This bot is currently full, searching for other bots."
putquick "PRIVMSG #boombot :join $chan"
utimer 10 [list invites:joinmsg $chan $nick]
return
} if {$chans < 30} {
channel add $chan
putquick "PRIVMSG $chan :\00302BoomBot version 1.9 by \00307Red_Rooste5"
return
}
}
set requirement 5
proc invites:joinmsg {nick uhost hand chan} {
global requirement
set nickonchan [llength [chanlist $chan]]
if {$nickonchan < $requirement} {
putquick "PART $chan :You need atleast 5 users to have this bot in your chan$
channel remove $chan
} elseif {[onchan \[De\]BoomBot $chan]} {
putlog "OMG \[De\]BoomBot is on $chan"
putquick "PART $chan You already have a BoomBot in your chan."
channel remove $chan
return
} elseif {$nickonchan =< $requirement} && [string equal -nocase $::botnick $nick]} {
putquick "PRIVMSG $chan :\00302BoomBot v1.9 by \00307Red_Rooste5"
return
}
}
}
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Dec 12, 2006 12:35 pm
Balance your braces.
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Dec 12, 2006 2:18 pm
In addition to what Sir_Fz said, this line is faulty:
Code: Select all
} elseif {$nickonchan =< $requirement} && [string equal -nocase $::botnick $nick]} {
Simply put, there's one } too many in there, remove it. Which one should be obvious.
NML_375
Red_Rooste5
Voice
Posts: 37 Joined: Sat Oct 21, 2006 7:43 am
Post
by Red_Rooste5 » Tue Dec 12, 2006 2:47 pm
Got the bot on...
Code: Select all
[19:46] Tcl error [invites:join]: wrong # args: no expression after "if" argument
When I try to invite it.
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Dec 12, 2006 2:53 pm
Assuming you hav'nt altered invites:join since last posting it, I'd say the error is here:
This should really be either one of these:
Looking up the manual-page for
if might be a good idea
NML_375
Red_Rooste5
Voice
Posts: 37 Joined: Sat Oct 21, 2006 7:43 am
Post
by Red_Rooste5 » Tue Dec 12, 2006 3:03 pm
Yeah, that worked, thank you
But it still doesn't part when the channel has 4 people in it :\
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Dec 12, 2006 3:13 pm
Yet another logic-error..
Considder this piece of your code:
Code: Select all
if {$chans == 30} {
putquick "NOTICE $nick :This bot is currently full, searching for other bots."
putquick "PRIVMSG #boombot :join $chan"
utimer 10 [list invites:joinmsg $chan $nick]
return
} elseif {$chans < 30} {
channel add $chan
putquick "PRIVMSG $chan :\00302BoomBot version 1.9 by \00307Red_Rooste5"
return
}
Now, under which conditions would invites:joinmsg be called?
Edit: Tiny fix to actually produce runnable code, as suggested in my previous post...
Last edited by
nml375 on Tue Dec 12, 2006 3:15 pm, edited 1 time in total.
NML_375
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Dec 12, 2006 3:18 pm
Yes.
Under which conditions would your bot join a channel when being invited to one?
NML_375
Red_Rooste5
Voice
Posts: 37 Joined: Sat Oct 21, 2006 7:43 am
Post
by Red_Rooste5 » Tue Dec 12, 2006 3:20 pm
If the bot is on less than 30 channels...?
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Dec 12, 2006 3:25 pm
Yes.
What is the sole purpose of calling invites:joinmsg?
And when would it actually be useful to call invites:joinmsg?
NML_375
Red_Rooste5
Voice
Posts: 37 Joined: Sat Oct 21, 2006 7:43 am
Post
by Red_Rooste5 » Tue Dec 12, 2006 4:17 pm
I actually have no idea :\
But I didn't know what else to do :\
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Dec 12, 2006 4:27 pm
You're saying you don't know what your own code should do?
NML_375
Red_Rooste5
Voice
Posts: 37 Joined: Sat Oct 21, 2006 7:43 am
Post
by Red_Rooste5 » Tue Dec 12, 2006 4:52 pm
What I'm saying is that I dunno why I am hopin to invite:joinmsg
I think it's got with something on the first script I made.