mIRC Home    About    Download    Register    News    Help

Print Thread
#250137 04/01/15 12:40 AM
Joined: Dec 2014
Posts: 23
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2014
Posts: 23
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

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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= ...


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Dec 2014
Posts: 23
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2014
Posts: 23
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.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #250157 04/01/15 06:33 AM
Joined: Dec 2014
Posts: 23
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2014
Posts: 23
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



Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Dec 2014
Posts: 23
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2014
Posts: 23
Nillen, thank you.
Could you explain:

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

smile

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
%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.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard