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.

need some help (Again)

Old posts that have not been replied to for several years.
Locked
[
[MAX]Marco

need some help (Again)

Post by [MAX]Marco »

Well i started this week on a request script but since this the first script i made i dont know some command or how to put then on the right place.

I just finished yesterday v1.0 just a simple one that when you type :
!request BOTNAME #channel

the requestbot says to the chan BOTNAME join #channel
So i used Stormbot for that part.
but know i want to make the TCL a bit more difficult by making a checking voor the requested channel. Like when I type : !request BOTNAME #channel
Will my requesbot join that channel and need to check if the person who requested is on the channel and has op. So for that part I made

Code: Select all

			if {$bot != ""} {
				if {$chan1 != ""} {
 				putserv "NOTICE $nick : Je hebt aanvraag is ontvangen. De bot zal komen zodra uw kanaal is gecontroleerd door mij."
				channel add $chan1
						if {[onchan $nick $chan1] & [isop $nick $chan1]} {
							putserv "PRIVMSG $chan :Ja $nick is $chan1 en hij is geopped"
							} else {
								if {[onchan $nick $chan1] & ![isop $nick $chan1]} {
									putserv "PRIVMSG $chan :Jammer $nick is wel op $chan1 maar hij heeft geen +o"
							} else {
								putserv "PRIVMSG $chan :Jammer $nick is niet op $chan1"
							}
							}
				utimer 20 "channel remove $chan1"
				return 0 
							}
						}
then i tested the script but when i'm in the channel and opped he always say i'm not in that channel. also when i'm not in the channel or has no op he say that i'm not in the channel.

maybe some1 can help me fix this little/big bug ?
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Re: need some help (Again)

Post by arcane »

[MAX]Marco wrote:

Code: Select all

			if {[onchan $nick $chan1] & [isop $nick $chan1]} {				}
"&" has to be "&&" for an "and"
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

hmm

Post by De Kus »

i suggest you let the bot a bit time to join the channel and download the /name list. usually all messages go out after script has finished, so bot will join channel after you check if he has op.
so try after channel add to make a bind join -|- "$chan1 BOTNAME!*" procname and check there if the user has op. you would only have to save the ownership for the chan. if it causes troubles make an utimer 5 [list procname $chan1 $nick] to forward the neccessary variables.
Locked