mIRC Homepage
Posted By: SBDOnslaught TXT and INI files. - 04/01/15 12:40 AM
Hey guys!
I'm trying to have things listed out in an .ini or .txt file.
I want, Ex:
Quote:

[#.$nick]
Time= ...
Points= ...

or even
Quote:

$nick Time= ... Points= ...


Something like that, but i can't get it to write on the same line.

Side note: Script isn't for points and Time. That was just an example.


Thank you guys! laugh
Posted By: Nillen Re: TXT and INI files. - 04/01/15 12:50 AM
As you can see in the above example, you're using a . to bind them together, why not use the same idea?

$nick.Time= ... $nick.Points= ...
Posted By: SBDOnslaught Re: TXT and INI files. - 04/01/15 01:46 AM
So you're saying, have them all on different lines, but just have them bind together everywhere?

It's just cause I have a points script I copied from somewhere else, and it lists the points like the first example. I can't figure out how the script actually works, and honestly, i thought it would be simpler that way.
Posted By: Wims Re: TXT and INI files. - 04/01/15 02:27 AM
I don't even see a question in your first post, could you clarify what's the problem you are having or what you are trying to accomplish?
Posted By: SBDOnslaught Re: TXT and INI files. - 04/01/15 06:33 AM
Wims, I don't think it was that complicated. Just trying to have things listed out through a command.
Random Ex: Someone says "!colour Red blue" and it would write it out in an .ini file like this
Quote:
[#.$nick]
1st= red
2nd= blue


Posted By: Nillen Re: TXT and INI files. - 04/01/15 12:35 PM
Code:
on *:text:!colour *:#: { 
  var %l $0, %o 2, %s 1, %file file.ini, %t $+(#,.,$nick)
  while (%o <= %l) {
    var %i $($+($,%o),2)
    writeini %file %t %s %i
    inc %o
    inc %s
  }
}
Replace "file.ini" with your actual file.
Posted By: SBDOnslaught Re: TXT and INI files. - 06/01/15 03:15 AM
Nillen, thank you.
Could you explain:

var %i $($+($,%o),2)

smile
Posted By: Nillen Re: TXT and INI files. - 06/01/15 11:18 AM
%o is the number that increases, which means it will be either 1,2,3 etc depending on which run it is. $(X,2) will evaluate the content 2 times. $+(X,X) appends X to X so it looks like XX
So in overall, $($+($,%o),2) will append a $ to a number, to make it either $1,$2,$3 and evaluate this number into mSL code.
© mIRC Discussion Forums