mIRC Home    About    Download    Register    News    Help

Print Thread
#216040 22/10/09 06:46 AM
Joined: Sep 2009
Posts: 10
U
unable Offline OP
Pikka bird
OP Offline
Pikka bird
U
Joined: Sep 2009
Posts: 10
There is a file - text.txt it is needed to find in him a "word" and to substitute him by a "word 1" and to save...
ps Means mIRC script
Thanks

unable #216041 22/10/09 07:17 AM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Untested.

Put this in the Script Editor, Alt+R. Type /replacetxt to start the script.
Code:
alias replacetxt {
  var %file = $qt($sfile($mircdir)), %x = 1
  while ($read(%file,w,*word*,%x)) {
    var %x = $readn
    write -l $+ %x %file $replace($v1,word,word 1)
  }
}

5618 #216042 22/10/09 06:26 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Oh, I forgot to edit it btw, but it should be:
Code:
var %x = $calc($readn +1)

5618 #216043 22/10/09 10:38 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
var %x = $readn + 1 ($calc isn't needed)


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #216045 23/10/09 05:50 AM
Joined: Sep 2009
Posts: 10
U
unable Offline OP
Pikka bird
OP Offline
Pikka bird
U
Joined: Sep 2009
Posts: 10
Thanks


Link Copied to Clipboard