mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2012
Posts: 3
K
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Aug 2012
Posts: 3
Greetings,

I'm running into a slightly annoying issue with regards to registration. I have a bot script that I keep under git source control, and which is publicly available on Github (https://github.com/Karunamon/Reibot).

Since I often add/remove scripts, it is desirable for me to keep the mirc.ini file under control as well, that way when someone new comes along and clones the repo, they can use the file as is.

You can probably see where I'm going with this. I (and probably Khaled ^^) don't want my registration details in the ini file for the world to see. I'm now writing a script which will fetch the latest changes from the repo and restart mIRC automatically - the problem is that such a change would pull in a clean mirc.ini, one without my registration info, meaning that mIRC will stop on the registration nag screen and not come up without manual intervention.

Short of writing a batch file to inject this information into the file, is there a way to save my registration outside of mirc.ini?

Thanks in advance!

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Registration isn't saved in the ini file by default anyway. It's stored in the registry. Reg info is only put in the ini file if you use the -portable or -noreg commandline switches to tell mIRC not to use the registry, so you shouldn't even be having this problem.

FWIW, I would advise against forcing users to use your mirc.ini. Loading scripts is easy, just have a single file that loads all the important files and have the user /load -rs that file in the instructions. Telling a user to install your settings file is far more complicated than doing the above, especially because you're telling users to put the mirc.ini file in the same directory as mirc.exe, which will break any Win Vista+ installation inside of Program Files\


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Aug 2012
Posts: 3
K
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Aug 2012
Posts: 3
Except I'm not using any switches. You're welcome to try it out yourself.. do a fresh install of mIRC, clone the repo, and move the files in. The settings from the .ini file will be used.

As far as usage, this is kind of meant to be used as a standalone app, not an addon that you drop into a working install. It's meant (and assumed to be) segregated into its own folder that it has control of.. hence the INI shenanigans, which gives me a lot more control over the operation of the program.

For instance, how do I ensure that mIRC doesn't prompt for confirmation on a /exit without setting that option ahead of time in the INI? The only alternative there would be having the user import a .REG file, which is ick for a few reasons.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: Karunamon
Except I'm not using any switches. You're welcome to try it out yourself.. do a fresh install of mIRC, clone the repo, and move the files in. The settings from the .ini file will be used.


You have portable=yes in your [about] section of the ini, which is an undocumented way of setting portable mode (or perhaps done via the installer you ran to create the ini file originally). Removing this fixes the problem on my end.

Originally Posted By: Karunamon
For instance, how do I ensure that mIRC doesn't prompt for confirmation on a /exit without setting that option ahead of time in the INI?


The answer to that is: you shouldn't care. You might see this as a "standalone app", but mIRC is not your application. At the end of the day, it is just a script that somebody chooses to add to an installation of mIRC. They are running mIRC, not your app. It's the user's choice whether they want mIRC to confirm on exit-- for instance, I might want it on. I might also want to run other scripts in tandem, to run spell checking, use some media player plugin, blowfish encryption, TLS support, or some other utility functions that I need to make use of IRC. And I have the right to make these changes. Your script (yes, it's a script) needs to respect your users' choices.

This isn't just some kind of ethical point, by the way-- it has practical implications: with your git setup, I can't stay in sync with your repository if I make changes to settings while using your script. That's a big deal, since making ANY kind of customization to the client will cause a problem. And I mean anything, like moving the mIRC window a couple of pixels to the right, enabling a proxy connection (/firewall on) that might be required for me to connect to IRC, changing my ident / adding my own main and altnick info, or even just upgrading mIRC (see below). There is a 100% chance that this file will be out of sync for users who clone the repo. This is the diff I get just by starting mIRC and moving the window around to where I like having it:

Code:
diff --git a/mirc.ini b/mirc.ini
index 2562055..fedd766 100644
--- a/mirc.ini
+++ b/mirc.ini
@@ -5,7 +5,7 @@ check=0
 
 [about]
 portable=yes
-version=7.22
+version=7.25
 show=no
 
 [dirs]
@@ -42,13 +42,13 @@ n1=scripts\rbalias1.ini
 
 [options]
 n0=1,1,0,1,0,0,300,0,0,0,1,1,0,0,0,0,1,0,0,0,4096,0,1,0,1,1,1,1,0,50,1,0,1,1,0
-n1=5,100,1,1,79,38,44,2,9,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,5,0,0,0,0,0,1,1,0,0,0,10
+n1=5,100,1,1,79,38,54,2,9,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,5,0,0,0,0,0,1,1,0,0,0,10
 n2=0,0,0,1,1,1,1,1,1,60,120,0,0,1,0,0,0,0,1,120,20,10,0,1,0,1,1,1,1,1,1,1,0,0,1,0
-n3=5000,1,0,0,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,1,0,0,0,0,1,0,0,25,0,0,1,3,180,0,1,1,0
+n3=5000,1,0,0,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,1,0,0,0,0,1,0,0,25,0,0,1,3,180,0,1,1,0
 n4=1,1,1,0,0,3,9999,0,0,0,1,1,1024,1,1,99,60,0,0,0,2,0,0,0,0,5000,1,5,0,0,3,0,0,1,0,0,0
 n5=1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,300,100,10,0,1,29,0,1,0,8192,0,0,0,100,0,1,1,1
-n6=0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,0,1,0,100,0,1,0,1,1,1,1,4,1,1,0,0,0
-n7=0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,70,0,3,0,1,0,0,0,0,0,0,1,1,1,1,0,1,1,0,1
+n6=0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,0,1,0,100,0,1,0,1,1,1,1,4,1,1,0,0,0
+n7=0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,70,0,3,0,1,0,0,0,0,0,0,1,1,1,1,0,1,1,0,1
 n8=1,2,0,130,1,1,0,2,0,1,0,0,0,0,0,1,1,0,0,0,0,0,168,1,0,1,1,1,0,0,0,1,1,0,3,0,0
 
 [pfiles]
@@ -67,11 +67,11 @@ n4=Kte-Dyn.mrc
 n5=reibotmain.mrc
 n6=reibotprofiles.mrc
 n7=reiboticelimport.mrc
-n8=reibotpublic.mrc
-n9=reibotupdate.mrc
+n8=reibotupdate.mrc
 
 [user]
 lastrun=lkVQ3umRcjpuBcIc
+about=l1pV
 
 [ports]
 dcc=1
@@ -85,7 +85,7 @@ uip=on
 uidentd=on
 udcc=on
 userver=off
-ustate=on
+ustate=off
 
 [ssl]
 show=1
@@ -101,8 +101,8 @@ system=UNIX
 port=113
 
 [socks]
-enabled=no
-hostname=
+enabled=yes
+hostname=localhost
 port=1080
 userid=
 pw=
@@ -208,7 +208,7 @@ user=Ayanami
 email=Ayanami@tkware.info
 nick=[Rei]
 anick=[Rei]2
-host=FrogboxSERVER:frogbox.es:6667GROUP:Frogbox
+host=FrogboxSERVER:frogbox.es:6667GROUP:Frogbox
 
 [files]
 servers=servers.ini
@@ -224,7 +224,7 @@ size=2
 buttons=0
 
 [local]
-local=host-174-45-190-46.chy-wy.client.bresnan.net
+local=HOSTMASK_REMOVED
 localip=174.45.190.46
 
 [fonts]
@@ -241,12 +241,13 @@ fmessage=Tahoma,410,1
 
 [windows]
 scripts=-1371,883,325,522,0,0,0
-main=-1399,1141,140,851,0,1,0
-wstatus=-1,773,-1,514,1,1,0
+main=422,1141,186,851,0,1,0
+wstatus=-1,773,-1,515,1,1,0
 wstatus-LSN=-1,773,-1,514,1,1,0
 wchannel=-1,773,-1,514,1,1,0
 wchannel-LSN=-1,773,-1,514,1,1,0
 chanctrl=-1212,427,255,426,0,0,0
+wstatus-Frogbox=-1,773,-1,515,1,1,0
 
 [background]
 @mdi=media\wallpaper-139398.jpg,2


I should point out that even your hostmask is encoded in the ini file, which not only means that everybody on the internet knows your last used IP address, but it also means that every single execution of mIRC will cause the ini file to be modified and cause pull conflicts, since hosts change all the time, even on your own machine.

So in short: you need to be mindful of the fact that you are NOT in control of the client, you are merely writing a script that adds functionality to the program. You have to respect the boundaries as a script author and treat your users as script users, not users of your standalone app-- mIRC is not that kind of program. If you want to control the whole program, write your own IRC client. Until then, let the users use the client as they want and gracefully add your own functionality/settings on top without affecting theirs.

I should also add, simply from a repository management perspective, the typical rule of thumb for maintaining code on repos is: don't commit files that change per build or execution. The ini file is one of those files. Put it in your .gitignore.

If you really want users to have a set of defaults, make an mirc.ini.sample file and explain how to move that file into place in the instructions, if they want your settings. But you should also provide a way to /load -rs the script into place for users who do not want to use the sample file.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Aug 2012
Posts: 3
K
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Aug 2012
Posts: 3
So this is an ancient topic, and mostly pointless now since I ended up rewriting the bot in ruby anyways due to stability issues... but I wanted to reply to this since I came across it again and it annnoyed me enough to respond to.

Quote:
The answer to that is: you shouldn't care. You might see this as a "standalone app", but mIRC is not your application.


In this case, mIRC is intended as the IRC back end for the script, which in my case is the main program. I don't think ethics even enter into it, unless there's some odd clause in the license that prevents having multiple installs on the same computer. Are you seriously saying it's unethical to use a purchased program in a way the author didn't intend?

Quote:
I can't stay in sync with your repository if I make changes to settings while using your script.


The whole installation method is that you do a portable install, and then clone my repo in on top of it.

Secondly, I am *well* aware of the the fact that touching the client in any way would modify the INI file. That's why I ended up sourcing a third party tool to make changes to the file just to get around this particular issue. (In short, use the tool to stash away any reasonable customizations, do a pull+merge, then reload or restart if necessary).

Quote:
you need to be mindful of the fact that you are NOT in control of the client, you are merely writing a script that adds functionality to the program.


You need to be mindful of the fact that this is not a user script to add functionality. This is a set of scripts which represent a bot that happens to run on top of mIRC, not a script used by a client for enhancing their chat experience. In this particular instance, it's launched, the GUI is minimized and then ideally never touched again.

In any case, this is all irrelevant now. But I just wanted to clarify what my goal was here since this thread still comes up on google.

Thanks anyways smile


Link Copied to Clipboard