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 

[Solved] Need some help again :\
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Dec 12, 2006 12:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Red_Rooste5
Voice


Joined: 21 Oct 2006
Posts: 37

PostPosted: Tue Dec 12, 2006 12:06 pm    Post subject: Reply with quote

Well... Another error Razz
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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Dec 12, 2006 12:35 pm    Post subject: Reply with quote

Balance your braces.
_________________
Follow me on GitHub

- Opposing

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Dec 12, 2006 2:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
Red_Rooste5
Voice


Joined: 21 Oct 2006
Posts: 37

PostPosted: Tue Dec 12, 2006 2:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Dec 12, 2006 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
Red_Rooste5
Voice


Joined: 21 Oct 2006
Posts: 37

PostPosted: Tue Dec 12, 2006 3:03 pm    Post subject: Reply with quote

Yeah, that worked, thank you Wink
But it still doesn't part when the channel has 4 people in it :\
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Dec 12, 2006 3:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Red_Rooste5
Voice


Joined: 21 Oct 2006
Posts: 37

PostPosted: Tue Dec 12, 2006 3:15 pm    Post subject: Reply with quote

If the bot is on 30 channels :\
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Dec 12, 2006 3:18 pm    Post subject: Reply with quote

Yes.
Under which conditions would your bot join a channel when being invited to one?
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Red_Rooste5
Voice


Joined: 21 Oct 2006
Posts: 37

PostPosted: Tue Dec 12, 2006 3:20 pm    Post subject: Reply with quote

If the bot is on less than 30 channels...?
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Dec 12, 2006 3:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Red_Rooste5
Voice


Joined: 21 Oct 2006
Posts: 37

PostPosted: Tue Dec 12, 2006 4:17 pm    Post subject: Reply with quote

I actually have no idea :\
But I didn't know what else to do :\
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Dec 12, 2006 4:27 pm    Post subject: Reply with quote

You're saying you don't know what your own code should do?
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Red_Rooste5
Voice


Joined: 21 Oct 2006
Posts: 37

PostPosted: Tue Dec 12, 2006 4:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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