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 

Request Bot. Doesnt work correctly

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
stoo
Voice


Joined: 30 Jan 2004
Posts: 14

PostPosted: Wed May 12, 2004 4:56 am    Post subject: Request Bot. Doesnt work correctly Reply with quote

This script i am writing needs to join the channel specified with this

!request #chan

Then the bot join that channel, checks if that user who requested is an op, checks for Q or L in the channel and if there is over 40 users.

However, when the bot joins the channel it says there is no Q or L and there is only 1 user.

Code:
bind pub o|o !request request:request

proc request:request {nick host handle chan text} {
global req_nick req_chan
set req_chan $text
set req_nick $nick
putquick "PRIVMSG #merc-finder :\002( #merc-finder )-(\002 Request service Inactive for 40 seconds while checking $req_chan \002)\002"

channel add $req_chan

bind join -|- "$req_chan $::botnick*" checks:checks
}

proc checks:checks {nick host handle chan} {
global req_nick req_chan
if {[isop $req_nick $req_chan]} { set isop 1 } { set isop 0 }


putquick "PRIVMSG $req_chan : Checking for \002Q\002 or \002L\002 bot..."

if {[onchan L $req_chan] || [onchan Q $req_chan]} {
set QLcheck 1
putquick "PRIVMSG $req_chan :\002Q or L\002 Found ! Requirement Met !"
} { set QLcheck 0
putquick "PRIVMSG $req_chan :No \002Q or L\002 Found ! Requirement \002NOT\002 Met !"
}

putquick "PRIVMSG $req_chan : Checking for\002 40 \002or More users ..."
set chan_amount [llength [chanlist $req_chan]]
if {$chan_amount >= 40} {
set chan_amount_check 1
putquick "PRIVMSG $req_chan :\002$chan_amount\002 users found ! Requirement Met !"
} {set chan_amount_check 0
putquick "PRIVMSG $req_chan :\002$chan_amount users found !\002 Requirement \002NOT\002 Met!"
}


set score [expr $isop+$chan_amount_check+$QLcheck]

if {[string match 3 $score]} {
putquick "PRIVMSG $req_chan :#merc-finder Requiremnets met! Bringing in a relay."
channel remove $req_chan
putquick "PART $req_chan :\002( #merc-finder )-( \002Requirements met for $req_chan \002)\002!"
putquick "PRIVMSG #merc-finder.staff :!addrelay $req_chan"
} {
putquick "PRIVMSG $req_chan :#merc-finder Requiremnets NOT met!"
channel remove $req_chan
putquick "PART $req_chan : #merc-finder Requirements NOT met!"
putquick "PRIVMSG #merc-finder :Requirements not met for $req_chan"
}

}


i tested and made the bot join #magik^ and got this in my partyline aswell
Code:
[mercfinder] [09:45] Tcl error [hnd:join]: illegal channel: #magik^
[09:45] -L (TheLBot@lightweight.quakenet.org)- [#MaGiK^]
 [09:45] Oops. Someone made me join #magik^... leaving...


Could anyone help me out here.

Much appriciated Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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