mIRC Home    About    Download    Register    News    Help

Print Thread
#211494 18/04/09 05:29 PM
Joined: Jan 2008
Posts: 22
I
ix007 Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jan 2008
Posts: 22
I am trying to open mysql.dll in a script. However the dll won't open and mIRC gives me a message saying "Unable to open $dir(mysql.dll)". I dont know what the problem is because it has worked before. My computer is vista and the box I host it on is windows server 08. Any ideas? Thanks

ix007 #211498 18/04/09 06:36 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
why would you "open" a dll file? secondly, why would an error message include the $dir() identifier? Something tells me you're both trying to do the wrong thing and doing it incorrectly at the same time.

Post the line of code that includes this "opening" of mysql.dll along with the $dir(mysql.dll) snippet.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #211499 18/04/09 06:51 PM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
his command probably didnt evaluate the identifier. And you wouldn't use $dir, you want the file.

Thsi requries mysql.dll to be in the same directory as mirc.exe. Please make sure mIRC.ini is in the same directory as well.

mysql.dll requires the libmysql.dll in the same directory as well. This is what I use to start up my sql db with mIRC.


Code:
alias start_sql {
  set %label user
  set %host localhost
  set %user root
  set %pass $null
  set %database user
  mysql_connect | .timermysql_dc 0 90 /mysql_dc
}

alias mysql_connect {
  var %ln = $dll(mysql.dll,Connect,%label -hud %host %user %database)
  if ($gettok(%ln,1,32) == 0) {
   echo 4 -st MySQL Connect Error: %ln
  }
  else {
    echo 12 -st MySQL connected
    if (!$timer(mysql_dc)) mysql_dc
  }
}
alias mysql_dc {
  if (!$timer(mysql_dc)) .timermysql_dc 0 90 /mysql_dc
  if ($dll(mysql.dll,Labels,1) == 1) mysql_connect
}

DJ_Sol #211500 18/04/09 07:18 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You should not keep script files in the same directory as mirc.exe as this breaks the inherent multi user support that has been available since 6.3

use $scriptdir\mysql.dll and keep your dll with your script files.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #211501 18/04/09 07:30 PM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
That is if you keep your script files in a folder called scripts. The way I design my scripts makes every $mircdir totally independant as I have many different full scripts and require that each one work flawlessly on everyones machine.

DJ_Sol #211502 18/04/09 08:03 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Judging from your explanation you don't seem to understand what $scriptdir does, nor do you seem aware that any scripting site requires scripts to properly be self-contained within their $scriptdir's before the submissions would be accepted.

Simply put, the way you design your scripts is wrong. For them to work "flawlessly", you would not want to use $mircdir at all as this may NOT be where the user stores their script files (it may not even be a writeable location). It seems that on every post regarding $mircdir you post misinformation. Please get your facts straight.

Here's a quick example that illustrates a simple flaw in your "flawless" scripts. If you had a quotes script that read and wrote to $mircdir\quotes.txt and installed another quote script depending on the same file as "flawlessly" designed as yours, they would overwrite each others content. You would never be able to make these two scripts work together at the same time no matter how you set them up on the filesystem. On the other hand, if they used $scriptdir to access their own self-contained data you would simply need to put them in their own directories somewhere on your disk (conventionally, within a subdirectory of $mircdir). $mircdir fails, $scriptdir wins.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #211512 18/04/09 10:24 PM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
It is up to the script writer to set the path correctly, not me. I make sure my files and paths are accurate. If someone else makes their own script and names a file the same as an existing file of mine, yes it will overwrite it. It is up to them to script smartly.

However, your point doesn't apply. If I write a script that uses $mircdirquotes.txt, then it will write to the quotes.txt file in the same directory as mirc.exe.

Now if someone uses the same path $micdir it overwrites it? Of course, so use $scriptdir and the scripts folder?

If my script is in the scripts directory and it uses $scriptdirquotes.txt and another script is in the scripts directory and uses $scriptdirquotes.txt, it will overwrite the same file.

If someone is so worried about this they can make another directory or use a myriad of other solutions to secure the validity of their file.

Personally I use neither though I guess it's $mircdir by default.

The idea that there is one and only one way to do anything in mIRC is horribly inaccurate.

And lastly,

What does this have to do with mysql.dll or where I put mysql.dll? If you read the readme.txt that comes with mysql.dll it will tell you that it will only work if the dll is in the same directory as mirc.exe.

DJ_Sol #211521 19/04/09 01:49 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: DJ_Sol
It is up to the script writer to set the path correctly, not me. I make sure my files and paths are accurate. If someone else makes their own script and names a file the same as an existing file of mine, yes it will overwrite it. It is up to them to script smartly.


At the risk of pointing out the ridiculously obvious, you're the script writer in the scenario I just described. There's you and another scripter involved. To say that your paths are more valid than any other script is simply wrong. The point is that you and the other scripter should both be writing your scripts to co-exist with each other-- this means not using $mircdir and risking name collision. Why you can't understand this probably has to do with your inability to read the one line help topic regarding $mircdir in mirc.hlp. Try /help $mircdir.

Quote:
However, your point doesn't apply. If I write a script that uses $mircdirquotes.txt, then it will write to the quotes.txt file in the same directory as mirc.exe.


You really need to step back and read the docs. $mircdir does not guarantee, I repeat, NOT GUARANTEE that it will be the same dir as mirc.exe. This depends heavily on the users setup. $mircdir in a default install DOES NOT return the same path as mirc.exe. You really need to comprehend this.

Secondly, again, read the docs. Here, I'll help you by showing you the docs for you:
Originally Posted By: mirc.hlp
$scriptdir

Returns the directory of the currently executing remote script.


This means that $scriptdir returns $nofile($script), NOT $mircdir\scripts.

Quote:
If someone is so worried about this they can make another directory


This is exactly why you use $scriptdir. Because with it, you can have the following scripts co-existing peacefully:

Quote:

- myscript\
|-- myscript.ini
\-- quotes.txt
- yourscript\
|-- yourscript.ini
\-- quotes.txt


Quote:
Personally I use neither though I guess it's $mircdir by default.


This is an idiotic justification to advocate poorly written scripts.

Quote:
The idea that there is one and only one way to do anything in mIRC is horribly inaccurate.


The fact that you're wrong about FACTUAL information regarding how mIRC handles $mircdir and $scriptdir is, however, an absolute. Again, get your facts straight, because you're making a mess of this thread.

Originally Posted By: DJ_Sol

If you read the readme.txt that comes with mysql.dll it will tell you that it will only work if the dll is in the same directory as mirc.exe.


Originally Posted By: readme.txt

===============================================================================================
= Installation =
===============================================================================================
libmysql.dll must be placed in the same directory as mIRC's program. mysql.dll can be placed
anywhere.


Once again, wrong.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #211522 19/04/09 02:25 AM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
lol yer ruining this guys thread on a personal vendetta.

Your whole argument is ridiculous. Yes, that is a valid way to point to file paths. So? What the heck is your problem? There is more than one way to write scripts in mIRC.

In the future, I'd really appreciate it if you toned down your attitude in general when discussing mIRC with me. This has happened more than once.

My paths are correct. I make sure mirc.ini is in the directory with mirc.exe. I point directly to the path basing off of the root of the currently running mirc.exe. I have over 2000 users around the world on Windows machines Win2k+ and mIRC 6.21+ and they all agree. They have no issues with my chat interface.

If I am adding scripts to someone else's full script or server connection then I better not ruin any of their files, variables, aliases, etc. That's up to me as the script writer.

If I release something publicly and someone wants to add to my scripts. If their stuff overwrites my files then that's their problem. They need to adjust their code, not mine. There are a few ways they can do this of which using an independant folder and $scriptdir is one solution.

If you showed an ounce of respect or humility I would take the time to show you what I'm doing and why. You have not seen any of my scripts. How can you judge me? You are being silly. Now let this guy get some help and drop this bs of how YOU think everything should be run.

DJ_Sol #211524 19/04/09 06:07 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Quote:
My paths are correct. I make sure mirc.ini is in the directory with mirc.exe.
If I get you right, the script(s) don't work if the users doesn't place their mirc.ini in $nofile($mircexe)? If that's the case, please re-read argv0's post with an issue-related attitude (or some of the other threads about file handling by scripts, e.g. starbucks_mafia's post in this thread).
And nope, the fact that 2k users did "it" so far - because the had to - won't make it the correct approach - they shouldn't have to.


Horstl #211526 19/04/09 07:29 AM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
You get me wrong Horstl.

DJ_Sol #211529 19/04/09 09:26 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: DJ_Sol
I make sure mirc.ini is in the directory with mirc.exe.

Mine is not. Neither is any user who's installed mIRC in over a year unless they explicitly modified the configuration (most users don't). Your scripts would fail on my and many other machines with that faulty assertion. You should read about the changes to how mIRC stores data since 6.3.

You really don't seem to understand how mIRC is configured, that mirc.exe is not dependent on being in the directory with mirc.ini anymore, even though that's how YOU might have it setup. Forcing a specific configuration on people is not a solution.

Storing files in the root mIRC directory doesn't make them "yours". You seem to be implying that if you used the generic name "quotes.txt" in the root mIRC directory it would be the other scripter's fault for using that filename too.. You are being silly... ignorant, too.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #211540 20/04/09 08:59 PM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I understand the changes that were made which is why I do it the way I do it.

Originally Posted By: "Versions.txt"

16/08/2007 - mIRC v6.3

Changes:

20.For Vista compatibility, new installations of mIRC now save all
settings in the User's "Application Data\mIRC" folder by default.

However, if the installer or mIRC find mirc.ini in the same folder
as mirc.exe they will use the mirc.exe folder for all settings.
Users installing over an old version of mIRC should therefore see
no change in behaviour.


Now go find something else to bitch about.

DJ_Sol #211543 20/04/09 09:57 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Humour me and explain what the paragraph you quoted means to you...


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #211546 21/04/09 06:41 AM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
You dont deserve it. Give this kid his thread back.

DJ_Sol #211549 21/04/09 09:20 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Actually I've been patiently waiting on the OP to give more details on the problem for a few days now. There's plenty of room in the thread for you to answer my question while we're waiting, though. It might be helpful to the OP, too.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #212049 09/05/09 03:50 AM
Joined: Jan 2008
Posts: 22
I
ix007 Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jan 2008
Posts: 22
Thanks for all the help... Didn't mean to start a flame war but I found the problem. All I needed was libmysql.dll, my other problem is now that mySQL(Server Side) has updated to v5.0.5 and the mysql.dll is only for version 4.0.4-beta. Anyone know what to do as far as that goes?

ix007 #212055 09/05/09 05:14 PM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
You cannot connect remotely to mysql version 5+. The only issue is the auth process. Using a local db works just fine for me.

It's supposedly possible to edit the dll, I wasn't able to do it successfully.

ix007 #212056 09/05/09 07:04 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You should be able to find an older version of libmysql.dll for 4.x if you look around


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
DJ_Sol #212572 26/05/09 10:07 PM
Joined: Jul 2006
Posts: 11
R
Pikka bird
Offline
Pikka bird
R
Joined: Jul 2006
Posts: 11
You can also use this DLL:
http://reko.tiira.net/mmysql

It supports the latest MySQL 5.1 GA release, and works without libmysql DLL in the folder.


Link Copied to Clipboard