|
Joined: Jan 2017
Posts: 20
Ameglian cow
|
OP
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!
|
|
|
|
Joined: Jul 2006
Posts: 4,180
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,180 |
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.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jan 2017
Posts: 20
Ameglian cow
|
OP
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?
|
|
|
|
Joined: Jul 2006
Posts: 4,180
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,180 |
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. 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.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jan 2017
Posts: 20
Ameglian cow
|
OP
Ameglian cow
Joined: Jan 2017
Posts: 20 |
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. 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.
Last edited by VijoPlays; 24/01/17 05:00 PM.
|
|
|
|
Joined: Apr 2010
Posts: 969
Hoopy frood
|
Hoopy frood
Joined: Apr 2010
Posts: 969 |
Instead of attempting to store the song in an ini as: [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: [e6076bf52fddf2fe9cf6dfa998ae3083]
song=In the end
artist=Linkin Park
Likes_vijoplays=3
Last edited by FroggieDaFrog; 24/01/17 06:45 PM.
|
|
|
|
Joined: Apr 2004
Posts: 871
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 871 |
*nod* and even replacing spaces with underscores might suffice already, while keeping the item names a bit more human-readable..
Saturn, QuakeNet staff
|
|
|
|
Joined: Jul 2006
Posts: 4,180
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,180 |
Right, because non breakable spaces makes it unreadable and are more likely to appear than underscore!
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jan 2017
Posts: 20
Ameglian cow
|
OP
Ameglian cow
Joined: Jan 2017
Posts: 20 |
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! *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.
|
|
|
|
|