|
Joined: Jan 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Jan 2004
Posts: 18 |
I have the following in a hash table:
Welcome to [channel] [nick]. (Approximate wait time: [waittime])
and the following command which processes that data:
.timerMsgChan 1 1 /msg %req-channel $replace($hget(Channel, priv_hi1),[nick],$!eval($hget(Temp,users)),[channel],%channel,[waittime],$!eval($hget(Temp,waittime)),[me],$me,[you],$!eval($hget(Temp,users-you)))
and it returns this:
Welcome to #channel nickname. (Approximate wait time: 1 second
missing the last )
anyone see where the problem lies (or why that happens, and how to get around it)?
Note: I cant use [waittime] $+ ), which does fix the problem. I need a better solution than that. (the first line can't be edited, only the code that processes it can be modified)
Last edited by Nutter; 15/03/04 10:00 AM.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
I can't see why you need those $!evals() around the $hget's. If you omit them it will work just fine.
|
|
|
|
Joined: Jan 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Jan 2004
Posts: 18 |
I need the $!eval()'s - I'll try and explain
I have an alias which kicks it all off. The alias messages a bot, and the bot notices me 5 times with various bits of information.
The timer there is part of an on notice event - triggered by the 2nd notice from the bot. It is on a timer, because I'm likely to use the alias three times in a row, thus getting 15 notices (triggering the on notice event three times) - each time the on notice event is triggered, it (re)starts the timer, so I only output the text once.
The [waittime] comes in the 4th notice from the bot. Given that the timer starts on the 2nd notice (before I get the [waittime] notice), I need to use $!eval() so it (re)evaluates [waittime] when the timer ends.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
The reason ) and . didn't show in the messages is that mIRC omits anything you append to the closing bracket of an identifier. In this case, your expressions were evaluated in the first time to $hget(Temp,users). and $hget(Temp,waittime)) therefore the red chars were lost in the next evaluation. Two solutions... either change your timer to this: - .timerMsgChan 1 1 /msg %req-channel $replace($hget(Channel, priv_hi1),[nick],$!hget(Temp,users) $!+ $chr(32),[channel],%channel,[waittime],$!hget(Temp,waittime) $!+ $chr(32),[me],$me,[you],$!hget(Temp,users-you) $!+ $chr(32)))
...or go in the clean way and have it call an alias: - .timerMsgChan 1 1 my_alias
alias my_alias msg %req-channel $replace($hget(Channel, priv_hi1),[nick],$hget(Temp,users),[channel],%channel,[waittime],$hget(Temp,waittime),[me],$me,[you],$hget(Temp,users-you))
|
|
|
|
|