mIRC Homepage
Posted By: AaronL $replace - 20/02/06 03:34 PM
hello all.
I've searched for $replace first, but did'nt found a answer for my question, so here goes.

in a textline i have this: wow, there goes kname
before sending this line to the channel it must replace kname with $knick
i have this sofar.

Code:
on 1:kick:#: {
  if (%kickrea == ON) { 
    set %nikaction $read($mircdirtxtfiles\kickreacties.txt)
    $replace(%nikaction, kname, $knick)
    $replace(%nikaction, sname, $nick) 
    /msg $chan 12 %nikaction
  }
}


however this shows kname instead of $knick

what do i wrong confused
Aaron
Posted By: h4z4rd Re: $replace - 20/02/06 03:43 PM
on 1:kick:#: {
if (%kickrea == ON) {
set %nikaction $read($mircdirtxtfiles\kickreacties.txt)
set %nikaction $replace(%nikaction,kname,$knick,sname,$nick)
/msg $chan 12 %nikaction
}
}

You didn't saved the $replace in any variable like %nikaction in order to msg it in the channel.
Posted By: AaronL Re: $replace - 20/02/06 04:29 PM
eh.... keej, i'm feeling very dumb now blush

thank you h4z4rd for telling me

Greetz
Aaron
Posted By: Doqnach Re: $replace - 20/02/06 06:41 PM
you could also just put the identifiers in the txt so you don't have to replace them ;-]
Posted By: AaronL Re: $replace - 21/02/06 06:24 AM
Very true, but bottomline is that users of that addon can add and/or remove reactions by themselves by typing it to a editbox and press the ADD button
To keep it simple they just have to make a line like:

Wow... thats great SNAME how you throwed KNAME out of the window.

Greetz
Aaron
© mIRC Discussion Forums