|
Joined: Apr 2015
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2015
Posts: 42 |
Hello, I was just wondering.. Is there some Identifier which makes you able to target an viewer with a command I've added? Like if someone asks for resolution in a stream, I can type !res <nick>, and then the bot says @"nick" 1920x1080. I've done this so far, but I can't find the right Identifier for taget, or if there even is one.
on 1:text:*!res*:#artiiz:{
msg $chan @ $+ $+ 1920x1080. $+
}
|
|
|
|
Joined: Oct 2014
Posts: 35
Ameglian cow
|
Ameglian cow
Joined: Oct 2014
Posts: 35 |
You can use $2
/help $1 for more info
Matti
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
In an on text event, the second word you type will be the $2 identifier.
Using @ $+ $2 will in in this case turn to @nillen assuming $2 == nillen.
Nillens @ irc.twitch.tv Nillen @ irc.rizon.net
|
|
|
|
Joined: Apr 2015
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2015
Posts: 42 |
Thanks alot Also, is there a way of making the commmand not being able to trigger in a message? I've tried doing like this:
on 1:text:*!res*:#artiiz:{
msg $chan @ $+ $2 1920x1080. $+
} But that doesn't seem to work, I need to put *!res* for it to work, but the problem is that then the command will trigger if you have !res in a text message, and will be fucked up.
|
|
|
|
Joined: Jul 2006
Posts: 4,153
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,153 |
There is no difference in the trigger you used and in your first post, probably a typo. Although it's probably obvious you want it to start with it, you only stated you didn't want it to appear anywhere in the text. The matchtext !res* would trigger for any message starting with !res, while this is better than anywhere in the message, it still would match on !responsabilities for example, where $2 doesn't even exist. To make sure it only trigger with the first word = !res and that you want a second word, use "!res &". The & indicate a full word
Last edited by Wims; 12/09/15 09:45 PM.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Apr 2015
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2015
Posts: 42 |
There is no difference in the trigger you used and in your first post, probably a typo. Although it's probably obvious you want it to start with it, you only stated you didn't want it to appear anywhere in the text. The matchtext !res* would trigger for any message starting with !res, while this is better than anywhere in the message, it still would match on !responsabilities for example, where $2 doesn't even exist. To make sure it only trigger with the first word = !res and that you want a second word, use "!res &". The & indicate a full word Thanks, that made it work Just one more question before this thread can be locked.
alias todate {
var %month = 09
var %day = 14
var %year = 2015
var %todate = $calc($ctime($+(%day,-,%month,-,%year) 14:0:0) - $ctime)
if (%todate < 0) {
inc %year
%todate = $calc($ctime($+(%day,-,%month,-,%year) 14:0:0) - $ctime)
}
return %todate
}
on 1:TEXT:!test:#artiiz:{
msg $chan @ $+ $nick live in about $duration($todate($2,$3),2)) $+
}
On this picture below, Is there a way in the script (in the Code above), to make it show 16h 53m instead of "hrs" and "mins"?
Last edited by Artiiz; 13/09/15 07:09 PM.
|
|
|
|
Joined: Jul 2006
Posts: 4,153
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,153 |
Of course! $duration($todate($2,$3),2)) is returning that result, since $duration() will only ever return a duration, we can safely replace "hrs" by "h" and "mins" by "m", with $replace: $replace($duration($todate($2,$3),2)),hrs,h,mins,h)
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Apr 2015
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2015
Posts: 42 |
|
|
|
|
|