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 

My request script. [wont validate.]
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Sep 05, 2007 11:08 am    Post subject: Reply with quote

This would be the correct code I beleive:

Code:

proc request:endofwho {from raw arg} {
 global requestchannel requestnick
 if {[string equal -nocase [lindex [split $arg] 1] $requestchannel]} {
  request:join_chan $requestchannel $requestnick
  return 1
  }
}


Tosser's code was correct. You added an extra bracket which would generate an error in the proc and will not make it execute.

Technique: In a statement, all opening brackets "[" should be equal to all "]" closing brackets. Only then the statement would be balanced. This goes for all type of brackets. (round brackets and also curly braces)

If there was an error because of a missing-bracket, it must be in some other proc, this one is correct. Besides I see in one of your procs (in a putserv statement) you have not escaped the [, ] brackets and left them as they are.
Hint: Read user's post.

Remember to escape all tcl special characters ([, ], {, }, \, $, & etc) with a "\" infront of them. Your script is choking on brackets from what I see, so fix it.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Sep 05, 2007 12:33 pm    Post subject: Reply with quote

A few comments on the last few posts:


  • Returning 1 when triggered by a raw binding will prevent any further processing. In this case, depending on order, this would completely disable eggdrop's ability of maintaining the internal channel-memers list.

  • Using raw-bindings with the output of NAMES has the disadvantage that you would have to manually process any and all RPL_NAMREPLY replies along with the RPL_ENDOFNAMES, as this will not update the internal channel-members list, whereas, using the output of WHO allows you to use chanlist without any manual processing. Care should however be taken to make sure this is done after eggdrop has processed this message itself.

  • The is still an issue with unescaped [ in tosser's last post, see user's post erlier in the thread... as stated by awyeah, there should not be an additional ] within request:endofwho.

  • pub:request is flawed as it uses list commands (lindex) on a string. It also splits $nick for some unknown reason. Lastly, the check against the blocked channels list does not properly care for case.

  • The list of blocked channels could easily be broken, if not careful with characters affecting list structures.

_________________
NML_375, idling at #eggdrop@IrcNET
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
Page 2 of 2

 
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