| View previous topic :: View next topic |
| Author |
Message |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Dec 12, 2006 12:01 pm Post subject: |
|
|
Yes... so why do you then force your bot to leave if there's more than 5 members? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Red_Rooste5 Voice
Joined: 21 Oct 2006 Posts: 37
|
Posted: Tue Dec 12, 2006 12:06 pm Post subject: |
|
|
Well... Another error
| Code: |
[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: | 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
}
}
}
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Dec 12, 2006 2:18 pm Post subject: |
|
|
In addition to what Sir_Fz said, this line is faulty:
| Code: | | } 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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Red_Rooste5 Voice
Joined: 21 Oct 2006 Posts: 37
|
Posted: Tue Dec 12, 2006 2:47 pm Post subject: |
|
|
Got the bot on...
| Code: |
[19:46] Tcl error [invites:join]: wrong # args: no expression after "if" argument
|
When I try to invite it. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Dec 12, 2006 2:53 pm Post subject: |
|
|
Assuming you hav'nt altered invites:join since last posting it, I'd say the error is here:
| Code: | | } if {$chans < 30} { |
This should really be either one of these:
| Code: | | } elseif {$chans < 30} { |
| Code: | }
if {$chans < 30} { |
Looking up the manual-page for if might be a good idea _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Red_Rooste5 Voice
Joined: 21 Oct 2006 Posts: 37
|
Posted: Tue Dec 12, 2006 3:03 pm Post subject: |
|
|
Yeah, that worked, thank you
But it still doesn't part when the channel has 4 people in it :\ |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Dec 12, 2006 3:13 pm Post subject: |
|
|
Yet another logic-error..
Considder this piece of your code:
| Code: | 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... _________________ NML_375, idling at #eggdrop@IrcNET
Last edited by nml375 on Tue Dec 12, 2006 3:15 pm; edited 1 time in total |
|
| Back to top |
|
 |
Red_Rooste5 Voice
Joined: 21 Oct 2006 Posts: 37
|
Posted: Tue Dec 12, 2006 3:15 pm Post subject: |
|
|
| If the bot is on 30 channels :\ |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Dec 12, 2006 3:18 pm Post subject: |
|
|
Yes.
Under which conditions would your bot join a channel when being invited to one? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Red_Rooste5 Voice
Joined: 21 Oct 2006 Posts: 37
|
Posted: Tue Dec 12, 2006 3:20 pm Post subject: |
|
|
| If the bot is on less than 30 channels...? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Dec 12, 2006 3:25 pm Post subject: |
|
|
Yes.
What is the sole purpose of calling invites:joinmsg?
And when would it actually be useful to call invites:joinmsg? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Red_Rooste5 Voice
Joined: 21 Oct 2006 Posts: 37
|
Posted: Tue Dec 12, 2006 4:17 pm Post subject: |
|
|
I actually have no idea :\
But I didn't know what else to do :\ |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Dec 12, 2006 4:27 pm Post subject: |
|
|
You're saying you don't know what your own code should do? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Red_Rooste5 Voice
Joined: 21 Oct 2006 Posts: 37
|
Posted: Tue Dec 12, 2006 4:52 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|