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.

My request script. [wont validate.]

Help for those learning Tcl or writing their own scripts.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

This would be the correct code I beleive:

Code: Select all

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.
==================================
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
Post Reply