Help with utimers and slash (\) subsitutions.

Old posts that have not been replied to for several years.
Locked
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Help with utimers and slash (\) subsitutions.

Post by awyeah »

Hello,

I have a script scanning user hosts, in a channel
and marking them as clones. Thing is I want it a bit
delayed, it is a bit complicated so I can't call it in another
procedure with a utimer, as transferring variables will be
alot messy.

Here is the fuction I want to set a
utimer on:

Code: Select all

if {[string match -nocase $mask "${nick}![getchanhost $user $chan]"]} { lappend list $user }"
Here is one I came up with, its not working, if
anyone can correct the slash (\) subsitutions
maybe, I would have an idea on this, as im not
sure. Also do I need to add [list... in the getchanhost
segement as well, like I have done? is it correct?

Code: Select all

utimer 5 "if \{\[[list string match -nocase $mask \"$\{nick\}!\[[list getchanhost $user $chan]\]\"]\} \{[list lappend list $user]\}"
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

The easiest solution is to write a proc to call from the utimer, that way you don't need to worry about escaping characters, trying to avoid having commands executed right away, etc...

ie.

Code: Select all

proc mycheck {mask nick user chan} {
  global list
  if {[string match -nocase $mask "${nick}![getchanhost $user $chan]"]} { lappend list $user }
}

utimer 5 [list mycheck $mask $nick $user $chan]
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Umm... this was not my intention in the first place.
But anyway I'll give it a try.

Most good coders I asked recommended me this method
rather than sticking to the one I suggested.

Thanks!
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked