mIRC Home    About    Download    Register    News    Help

Print Thread
Check location in event line #76850 27/03/04 01:29 PM
Joined: Mar 2004
Posts: 21
CoolWave Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2004
Posts: 21
Hello, some questions..

1) Although it is possible to use $regex in match text & location in event as On *:Text:match:location: is it feasible not to take in account a location ?:
Code:
On *:Text:*:!#channel,!#blabla:
; to listen on any channels without them


2) Other issue: i've tried to check location thanks to an alias:

Code:
; With this alias:
alias check {echo -a $1- | return $1- }
;
On *:Text:*:$($check(#mychan)):
; This works! $1- = #mychan & return it, channel is listened on.
;
On *:Text:*:$($check(#)):
; ..but with an alias like this, $1- is $null, it doesn't echoes the listened location.


Is it logical ?! I think yes, but does a means exist to get the same use ? (get the channel name which is tried to be listend on..)

3) Last question: Should we prefer to use temporary variables (set -uN) or timers ? (for a flood detection for exemple.. /set -u10 %flood.nick $true or set the variable & use /timer 1 10 unset %flood.nick)

Thx for answers wink
(i hope my english is comprehensible..)


-Be cool with my English-
irc.EpiKnet.org:#scripts
Re: Check location in event line #76851 27/03/04 08:26 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
1) Try this:

On *:text:*:#channel,blabla:! [see /help prefixes]
On *:text:*:#:{ do stuff }

2) There appear to be no meaningful identifier you can pass to $check() when it's called from the target (location) field.

3) It's faster & cleaner to use the internal -uN

Re: Check location in event line #76852 29/03/04 03:44 PM
Joined: Mar 2004
Posts: 21
CoolWave Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2004
Posts: 21
I haven't thought about ! prefix smirk
Thx a lot..

Else (about 2nd question), is it possible to get the channel where something has just been happening, before Events (On Text,etc) work & listen on ?!
(maybe from the line <- :nick!identd@host PRIVMSG #channel :message - to get #channel -)


-Be cool with my English-
irc.EpiKnet.org:#scripts
Re: Check location in event line #76853 29/03/04 04:13 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Yes. You can use the -i switch of /debug to make it call an alias where you can parse $1 (the raw line). See /help /debug for more. An example:
  • alias myAlias {
    tokenize 32 $1
    if $3 == PRIVMSG { echo -s Target: $4 }
    }
(type /debug -i nul myAlias to begin)

Re: Check location in event line #76854 29/03/04 05:12 PM
Joined: Mar 2004
Posts: 21
CoolWave Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2004
Posts: 21
Perfect, it's what i'm searching to can use my script:
Code:
;..
if $3 == PRIVMSG { %last = $4 }
;..
On *:Text:*:$($check(%last)):
alias check if ($1 == #blah) return $1


It works as i want, thx Online wink


-Be cool with my English-
irc.EpiKnet.org:#scripts
Re: Check location in event line #76855 29/03/04 05:18 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
You're welcome laugh