mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2006
Posts: 46
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2006
Posts: 46
How does one only change certain parts of topics via triggers and keep all the other parts the same?

example: !TARGET: 1170 | HOLD !BREAK: 30k GS | !SR: dead | !CRUISE: 877 | !CHEM: 178 | !NM: 171

Say I want to do !target 441 and that would change just the target?
Each part of the topic is a different color also.

Thank you

Last edited by danzigrules; 12/05/08 01:25 AM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You'd have to use tokens and store the current topic for access in changing it.
Code:
if ($1 == !target) {
  set %topic !TARGET: $2 $chr(124) $gettok(%topic,2-,124)
}


Then set the topic with /topic. To use different locations, you'll want to use $gettok() to place the changed item in the right place.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I would use $reptok

Syntax /topix originalvalue newvalue

Script detects if your op before change and checks to see if original value matches in topic before.

Note: Must be on the channel in question does $active check.

Code:
alias topix {
if ($me isop $active) && ($$1 isin $chan($active).topic) {
.topic $active $reptok($chan($active).topic,$$1,$$2,32)
}
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
That would make too much sense. smile

Ok, so I forgot about $reptok. I never replace tokens in anything I do, so I forgot it existed. blush


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Happens to all of us, knowing about reptok watch me ask something down the line all it needs is reptok smile


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }

Link Copied to Clipboard