mIRC Home    About    Download    Register    News    Help

Print Thread
#75301 15/03/04 09:55 AM
Joined: Jan 2004
Posts: 18
N
Nutter Offline OP
Pikka bird
OP Offline
Pikka bird
N
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.

Nutter
GameSurge IRC Network
www.gamesurge.net
#75302 15/03/04 05:04 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
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.

#75303 15/03/04 10:27 PM
Joined: Jan 2004
Posts: 18
N
Nutter Offline OP
Pikka bird
OP Offline
Pikka bird
N
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.


Nutter
GameSurge IRC Network
www.gamesurge.net
#75304 15/03/04 10:58 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
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))


Link Copied to Clipboard