mIRC Home    About    Download    Register    News    Help

Print Thread
Remote .ini file header with space? #259767 24/01/17 12:27 PM
Joined: Jan 2017
Posts: 20
VijoPlays Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jan 2017
Posts: 20
Right now I'm trying to design a script where the bot will output the current song playing into a .ini file and people can rate the song.
However MIRC will always cut the songname/artits (basically I have my songs structured like "songname - artist") and the main issue comes in when I have a song with a lot of spaces (f.ex. "In the end - Linkin Park".

Is it possible to make it write:
[In the end - Linkin Park]
Vijoplays = 3

(3 being the rating, VijoPlays being the name of myself)?

Without it it would look like this:
[In]
the = end Linkin Park VijoPlays 3

P.S.: I'm sorry if this is supposed to be in the Script/Help thing, but since there's no need for a full script, I figured it'd fit more into this one.
Also, I am glad about any help, it's much appreciated!


Streaming games on Twitch, while guiding and helping other players!
www.twitch.tv/vijoplays
Re: Remote .ini file header with space? [Re: VijoPlays] #259768 24/01/17 12:53 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
It is not possible by design using /writeini since /writeini take the first parameter (parameters are tokenized by space in commands) as the section's name.
It would be possible to use /write to write to the ini file and to construct the ini structure yourself, but that's no so great.
Another, easier solution, consist of replacing the space in the song with a character that won't be or is unlikely to be used in the title + artist, but this breaks if that character happens to be there, a character that could be used is the non breakable space $chr(160).
A 100% working solution would be to change the data storage but there is unfortunately no good data storage available in mIRC which would allow you to use this kind of relationship, that is, associating something which can contain spaces to some others data.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Remote .ini file header with space? [Re: Wims] #259769 24/01/17 02:16 PM
Joined: Jan 2017
Posts: 20
VijoPlays Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jan 2017
Posts: 20
Hrm, I figured. Killing off the spaces of 1.5k songs would take some time, so I'll try to find a different solution (for now).
Thanks though!

I don't think you can 'connect' Excel and IRC, can you?
As in let IRC fill in and retrieve the info?


Streaming games on Twitch, while guiding and helping other players!
www.twitch.tv/vijoplays
Re: Remote .ini file header with space? [Re: VijoPlays] #259770 24/01/17 03:14 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
Quote:
Killing off the spaces of 1.5k songs would take some time
If you are talking about editing the space in a file or in a data storage in mIRC, by another characters, it can be done programmatically, it wouldn't take time at all.

Quote:
I don't think you can 'connect' Excel and IRC, can you?
As in let IRC fill in and retrieve the info?
You can use COM object to communicate with an excel application, I'm not so sure about what you can do exactly and/or if you could do what you're looking for though, never looked into it, I don't have excel.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Remote .ini file header with space? [Re: Wims] #259771 24/01/17 04:59 PM
Joined: Jan 2017
Posts: 20
VijoPlays Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jan 2017
Posts: 20
Originally Posted By: Wims
Quote:
Killing off the spaces of 1.5k songs would take some time
If you are talking about editing the space in a file or in a data storage in mIRC, by another characters, it can be done programmatically, it wouldn't take time at all.


Do you have a link to a guide for that for me? =)
Or is there a shortcut (like Ctrl+H) for it. I'd just edit all of the files then I guess and use it like that.

Originally Posted By: Wims
Quote:
I don't think you can 'connect' Excel and IRC, can you?
As in let IRC fill in and retrieve the info?
You can use COM object to communicate with an excel application, I'm not so sure about what you can do exactly and/or if you could do what you're looking for though, never looked into it, I don't have excel.


Already looked into the Com thing a bit, but I'm not sure as to how I'd do that exactly with a specific file.
A friend of mine told me that his brother does have some programming experience, though he doesn't know which languages he specifies in. I might talk to him, see if he does know a solution for that, but if the first one works, then there might not be a need for it.

Thanks so much for your help, hehe!
I just do some programming here and there and it's really great when someone can help you to find some solutions. smile

Last edited by VijoPlays; 24/01/17 05:00 PM.

Streaming games on Twitch, while guiding and helping other players!
www.twitch.tv/vijoplays
Re: Remote .ini file header with space? [Re: VijoPlays] #259773 24/01/17 06:42 PM
Joined: Apr 2010
Posts: 966
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 966
Instead of attempting to store the song in an ini as:
Code:
[songname - artist]
vijoplays=3


Why not just create a unique identifier for the song and its values, you could use something along thing lines of $md5(songname - artist), $hash, $sha1, etc which would output something akin to:
Code:
[e6076bf52fddf2fe9cf6dfa998ae3083]
song=In the end
artist=Linkin Park
Likes_vijoplays=3

Last edited by FroggieDaFrog; 24/01/17 06:45 PM.

I am SReject
My Stuff
Re: Remote .ini file header with space? [Re: FroggieDaFrog] #259774 24/01/17 06:55 PM
Joined: Apr 2004
Posts: 862
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 862
*nod* and even replacing spaces with underscores might suffice already, while keeping the item names a bit more human-readable..


Saturn, QuakeNet staff
Re: Remote .ini file header with space? [Re: Sat] #259775 25/01/17 05:46 AM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
Right, because non breakable spaces makes it unreadable and are more likely to appear than underscore!


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Remote .ini file header with space? [Re: Wims] #259780 25/01/17 08:04 PM
Joined: Jan 2017
Posts: 20
VijoPlays Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jan 2017
Posts: 20
Originally Posted By: FroggieDaFrog

Why not just create a unique identifier for the song and its values, you could use something along thing lines of $md5(songname - artist), $hash, $sha1, etc.


The titles of said files are already like that "In the end - Linkin Park" (so storing it this way would end with a lot more work :p) and I would also prefer to have them in .ini files, because it's just a lot cleaner, when it comes to storing multiple people. Will use this method if all else fails though, thanks!

Originally Posted By: Sat
*nod* and even replacing spaces with underscores might suffice already, while keeping the item names a bit more human-readable..


Was actually planning on using _s , but for that I'd need to know how I can configure the name of multiple files at once.^^
I feel like this will be the easiest method and it also brings me closest to my initial goal.


Streaming games on Twitch, while guiding and helping other players!
www.twitch.tv/vijoplays