mIRC Home    About    Download    Register    News    Help

Print Thread
User specific filenames, what am i doing wrong? #258369 27/06/16 10:53 PM
Joined: Jun 2016
Posts: 2
P
ProphetCable Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
P
Joined: Jun 2016
Posts: 2
Hello i'm still new to mIRC scripting, i'm having a problem and was hoping to get a little help. I am creating a small chat game for my twitch channel and each of my veiwers will have thier own inventory text file. When the chat command is used it will play or read the file saved for that user, like read(c:/prophetcable_inventory.txt), but i need it to pick each users ID instead of just mine like read($nick_inventory.txt) unfortunealy i cannot get this line to work and know that there is a way seeing as i also use ankhbot, which is a twitch bot built on irc (ithink) and when i do $user_inventory.txt in ankhbot it works. Any ideas or do i just need to get better at coding? :P thanks

Re: User specific filenames, what am i doing wrong? [Re: ProphetCable] #258370 28/06/16 12:00 AM
Joined: Nov 2009
Posts: 295
P
pball Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
A better way to do this would probably be to use an ini file. You can use a single ini for everyone and it should be easier to read and edit than a normal text file.

Look up /writeini and $readini in the help file.


http://scripting.pball.win
My personal site with some scripts I've released.
Re: User specific filenames, what am i doing wrong? [Re: pball] #258371 28/06/16 04:19 AM
Joined: Jun 2016
Posts: 2
P
ProphetCable Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
P
Joined: Jun 2016
Posts: 2
Thanks i will definitely check that out, still a lot of learning to do. BTW i did figure out who to do what i asked finally just by gaining more experience with the scripting language i should have used c:/ $+ $nick $+ _inventory.txt for anyone out there that may be curious, i will probably however use an INI instead since i do like the structure of it. As long as i can figure out how to add things to sections as opposed to just overwriting them