mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
This is a post about the general bits which i'm not acutally sure if it IS feasable, but it sounds like it. Anyone who can do this, msg me or email me, please.

VBscript,Jscript,PERLscript,etc for mIRC exists.

Let me ramble a little, I'll get to my point later. First off, mIRC script is, and always will be, a bastard child with crippled fingers. It is a loosely typed, messy little scripting language - and I love it to bits. Type conversion? Conversion, smeh! If you are anything like me you created your first popup and thought "d00d, you are so l33t. See what else you can do".
So the obsession starts. Not just with mIRC, you might dabble in other things. Other scripting langauges. Programming langauges. Assembly even, if you get too hardcore. You then look back at mIRC, which you still use to chat, and decide to do something with it, really really flashy and cool.
Thats when it hits you. You can't use pointers or arrays, or a lot of other nifty things. So you script around them. You end up with a lot of unmodular spaghetti code. You feel sick. You throw it away and start over, trying new tricks. In the end you probably read the bit in the help file about DLLs.
Ooh. Ahh. Nifty. I don't havce a microshaft product, so I'll find another langauge to work in. No one has tutorials for DLLs written entirely in assembly, expressly for mIRC. In a haze of desparation you find MSDN and start reading about windoze.
Eventually you come across COM objects - I took the long way.

What are they? How can they be used? Where's the damn documentation?
You whip out the wokring model of visual basic 6 (yes, its free), you find certain registry entries and OOPS you've defrauded good ole bill out of a few ivory backscratchers, but on the plus side you can make (now) ActiveX DLLs, and you can step into the world of COM.
Not everyone can find teh working model
Not everyone likes visual basic - but they can't be stuffed learning C++

*cough*
mid rant breather break.... inhale... exhale
*/cough*

Windows Scripting Host, ver 5.6 documentation

Quote 1:
"WSH provides the ability to create COM components. "
-Introducing Windows Script Components, Windows Script Components

Quote 2:
"Generally, you write scripts in either Microsoft JScript or VBScript, the two script engines that ship with Microsoft Windows 98, 2000 and Millennium Editions. You can use other script engines, such as Perl, REXX, and Python, with Windows Script Host.
Note: For more information, see Microsoft Developer Network (MSDN) (http://msdn.microsoft.com/workshop/languages/clinic/vbsvjs.asp)."
-Available Script Engines, Hosting Environments and Script Engines
Quote 3:
"Windows Script engines can be developed for any language or run-time environment, including:
Microsoft Visual Basic Scripting Edition (VBScript)
Perl
Lisp"

Quote 4:
"me0w"
-CloCkWeRX

If you read those you might guess where I'm heading. Not only do I me0w, I'm crazy too. So crazy that I thought, hang on, if I can make a COM object in Jscript (Microsoft Flunky JavaScript), AND register it, and I can do the same with ANY language that has libraries written for WSH (Windoze Sleepy Host), I can do what ever I please and get away with it. FREE! *throws out exspensive C++ editors for a moment*

So it all comes down to this: You know HTML, you probably can pick up xHTML (eXtensible HTML). You can do that, you have the idea behind XML. XML + Jscript|VBscript|*script + WSH = COM Objects. COM Objects + mIRC = all good.

When you read the help file I pick up a feeling that everyone's fav client author didn't realise this existed so easily in the form of windoze scriptng host. Be excited.

In conclusion, I say this:
mIRCscript is limited
*script is not. Shut up and use it smile don't post "I think we should have PERLscript" for mIRC. You do. Already. I think. me0w.

What is need for this to all work:
-Better documented help file in regards to COM. Its bulky, and obscure, and not very much like the rest of mIRC's easy to understand examples.
-Developers to write tutorials for developing in *script.

Final Quote:
"mIRC allows you to call COM objects via scripts. You must have experience with COM objects in order to use this feature." You better believe it.

Joined: Dec 2002
Posts: 54
L
laz Offline
Babel fish
Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
I didn't read your whole post, I was in a hurry and its kinda long smile

Anyway, if you want a IRC client that supports other languages, use Klient (www.klient.com). It supports everything ActiveX does (which is Perl, TCL, Python and others).

Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
I agree. mIRC is mIRC. mIRC is unique. Lets not poison mIRC with those other languages or differing language structures.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
What you and laz seem to be misunderstanding is that he's saying that mIRC already supports other languages via COM objects, and that the people who want to use other languages can do so.

However, personally I don't like the insinuation that such languages are far superior to mIRC scripting because quite frankly they're not. mIRC scripting is a hell of a lot more focused and able as far as being an IRC scripting language. I can't help but feel that the things people create by using Perl, Python et al. will have little or nothing to do with IRC at all and could just as well be standalone applications.

Also I'm pretty sure CloCkWeRX made a reference to cracking Visual Basic in there somewhere, which of course I don't support.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
cracking ? who what? pointing out that you can pay a helluva lotta money for the difference between someting with 1k of registry data is what i'm saying.

mIRCscript isn't very well organised at all; if you've ever sampled java, c++, or any real programming language you'll know the other end of the scale. Javascript, *script, etc have sacraficed a lot of features to become a scripting langauge, rather than a programming language, but at least you can work with arrays, objects, etc in them. For these reasons i purport that they are better _scripting_ languages

The complete lack of OOP type features in mIRC script is kinda sad, because we've ended up with butchery between low-level functions and high level functions (/quote & /me respectively), event driven & procedural code... Its a hodgepodge of functions which don't conform too well... AT least it is backwards compatable, in most part.

well i'll rant back later.

Joined: Dec 2002
Posts: 20
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 20
i totally agree with mIRC being just about the messiest language exisitng... but what can you say... it's mIRC! smile it's what got me in to this game smile And even tho it's messy, that makes it easy for small scale projects (and face it, irc scripts, as bloated as they can be, are still but small scaled projects - they're JUST a tool to help you CHATTING, not like they do anything dead useful or anything).

imma make an ecma client one day... some day...


you guys are so not L334
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
You say mIRC scripting is better? Well if better is defined:

slow, having awkward, unpredictable results, etc, etc

then I fully agree. Compare something written in mIRC scripting to something written in php, perl, python, tcl, etc (that does the same function) and you will see that mIRC script is FAR slower. Also the other languages don't have insane syntax. Like the dreaded [ ], or $+, or $chr or the "multiple space" bugs that mIRC is plagued with.

To me those things aren't good points of mIRC scripting, they are bad, I'd much rather have a scripting engine that parses fast and has a nice easy syntax that doesn't require you to do all sorts of insane stuff like mIRC requires.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I meant better as in much simpler to learn and to write, more focused on the relevant subject, and the language's syntax changes very little over time.

As far as having unpredictable results goes all I can say is that every language does the unexpected, whether it's a bug or just behavioural. For instance I've spent several days trying to figure out a fix for why a PHP function won't work in the documented way, but will work in a similar (undocumented) way which makes it totally unuseable to me - maybe it's a bug, maybe not, the point is that no language is infallible.

Since we are (or at least I am) talking about 'better' as far as being an IRC scripting language then speed is of little importance. Can it do things a lot faster than I could manually? Hell yeah. It's fast enough then, at least as far as I'm concerned. It really doesn't matter how many hundred or thousand times faster Python or PHP is if all the script is doing is looping through a couple of dozen nicknames or channels and performing some simple command each iteration.

Simplicity is mIRC scripting's real strength though. It takes a few days of learning to be able to produce useful and meaningful results, the things which people point out as weaknesses (no OO, no data types etc.) are what allow that to happen. If you came to mIRC from a programming background then that simplicity may not help you, it may even make things worse, but the fact is that most people aren't coders - at least not when they first learn mIRC scripting.

Documentation is another plus-point in mIRC's favour. Other languages might have more content relating to them on the web, but it's widely distributed and much of it is deprecated or poorly written. mIRC scripting is one of the few languages where documentation is instantly available in one single file on your computer from the get-go. And obviously since anyone using mIRC will be on IRC, I think it's fair to say that mIRC scripting has the edge on IRC help channels aswell.

Of course for some jobs speed really is important, quoted strings, arrays, objects etc. are very useful, and as CloCkWeRX has pointed out all those things are accessible if and when they're required. My gripe is the apparent attitude that a few people have in regards to mIRC that mIRC scripting is just a hurdle to be jumped over in order to get to 'the good languages' via DLLs and COM objects. If Khaled went to the trouble of making a language don't you think it's worth a little bit of the user's time to see if that can do the required job more easily before looking to other languages?

Anyway, I'm not trying to get into a computer language pissing contest, I'm just saying that the the most important choice when coding is to pick the right language for the job, and when it comes to IRC mIRC scripting is often the right one.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2002
Posts: 54
L
laz Offline
Babel fish
Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
Quote:

What you and laz seem to be misunderstanding is that he's saying that mIRC already supports other languages via COM objects, and that the people who want to use other languages can do so.


Quote:

I didn't read your whole post, I was in a hurry and its kinda long


Just thought I'd make that part clear smile
Anyway, I think mIRC has a good enough scripting engine. And seeing how its all made by mIRC's author (except for RegEx I think), its very good.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Quote:
Simplicity is mIRC scripting's real strength though. It takes a few days of learning to be able to produce useful and meaningful results, the things which people point out as weaknesses (no OO, no data types etc.) are what allow that to happen. If you came to mIRC from a programming background then that simplicity may not help you, it may even make things worse, but the fact is that most people aren't coders - at least not when they first learn mIRC scripting.


What you call simplicity I call complexity. Please tell me how:

set %string_var %string_var $+ $chr(32) $+ some other text

is cleaner than:

$string_var .= " some other text"; (perl/php)
[append string_var " some other text"] (tcl)
string_var += " some other text" (python)
string_var << " some other text" (ruby)

How can you possibly tell me the mIRC syntax is clean and simple?

Quote:
Documentation is another plus-point in mIRC's favour. Other languages might have more content relating to them on the web, but it's widely distributed and much of it is deprecated or poorly written. mIRC scripting is one of the few languages where documentation is instantly available in one single file on your computer from the get-go.


For perl help:
The perldoc program included with Perl provides extensive documentation on all aspects of the language.

Single file php help: http://www.php.net/distributions/manual/php_manual_en.chm It documents ALL aspects of the php language, and unlike mIRC's helpfile, it tells you when a particular function was added to php so you know exactly what your target version must be.

Tcl help: http://prdownloads.sourceforge.net/tcl/tcl8.4.2-html.tar.gz

Python help: http://www.python.org/ftp/python/doc/2.2.2/html-2.2.2.zip

Ruby help: ftp://ftp.ruby-lang.org/pub/ruby/doc/ruby-man-1.4.6.tar.gz

I'm very familiar with the php helpfile and the tcl helpfile. I'm not really a python or ruby programmer so I can't comment on that too much. But the php and tcl helpfiles have answered any question I ever had. But in any case, there is something you neglected, books. Several php, perl, ruby, tcl, etc books have been published. There are no books on mIRC scripting. Books often help in ways online tutorials and documentation can't, but in the case of mIRC scripting this resource is unavailable; in the other languages, you have several dozens of books to choose from.

Joined: Apr 2003
Posts: 10
J
Pikka bird
Offline
Pikka bird
J
Joined: Apr 2003
Posts: 10
"set %string_var %string_var $+ $chr(32) $+ some other text"

that would really be:
set %string_var %string_var some other text

$chr(32) is space, so adding in $+ $chr(32) $+ is completely redundant. to be fair though, it is still shorter than the other scripts you cited.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well I hope you saw my point at least, mIRC has an odd syntax and often unpredictable results.

If you didn't like my first example, here is another.

%array. [ $+ [ %i ] ]

in php that'd be $array[$i];

Again, the mIRC syntax is easier?

To me, the mIRC syntax is hard to follow. I'm sure a new user would wonder why the $+ is necessary and why the evaluation brackets are needed. Where as in the php example, it's pretty clear (since it uses the same format as 99% of array supporting languages).

Then of course there are the 'bugs'. The multiple space bug, to which there is no way to get around. In every other language I've ever seen, there is nothing even close to this problem. $calc() problems. Plug a number containing 'e' into a $calc() and it doesn't work. But note that $calc() is quite able to return numbers containing 'e', it just can't process them. Makes it very hard to deal with certain functions, factorials come to mind. If you specify a number that is too large you get an invalid result because mIRC can't handle the large number. Then there is $serverip returning an ip that is reversed, $ord not handling decimals correctly, do you say the "one tenst" because $ord(.1) = .1st, $rand not working correctly with negative numbers, $rand not handling numbers with decimals correctly, try $rand(1.1,3.9) about 20 times or so, note how 4 is returned. $isupper(*) and $islower(*) both return $true, last I checked, * is neither upper or lowercase. Then $disk, I run $disk(d:) (d is my cdrom) it returns $false, but $disk(d:).type returns cdrom, so it doesn't exist yet it is a cdrom? Then $base, the helpfile says $base(1.5,10,16) returns 1.8, well for me it returns 1. Then of course there are always the undocumented features, where is $pi mentioned in the docs? And for that matter, why does mIRC return a value for pi that is too large for it to even understand? $pi returns 3.14159265358979323846, but if you $calc($pi) you get 3.141593. Now I assume anyone using pi doesn't want to print it to a channel, so that means it will probably be used in a math formula. So what is the point of returning more digits than mIRC can handle? Just to make using $pi slower since mIRC has to trim it? Or is that perhaps the reason it is undocumented?

My point is just, you people seem to just want to say "mIRC scripting is better than everything else. The documentation for other languages is bad, they are too complex, etc, etc" But when it comes right down to it, mIRC scripting suffers from all of the problems you describe and more.

And just as a note, I'm not trying to bad mouth mIRC or Khaled in any way, I just simply feel that mIRC scripting is not very well written. Without implying any offense, the major scripting languages are coded by many coders all with the goal of creating a great scripting language. mIRC is coded by one man whose primary goal is to create a great IRC client. It seems logical that when you have numerous people working exclusively on a scripting language you will get better results than from one man who does it as a side project.

Lastly, yes, if mIRC scripting is your first language you won't have problems learning it. But if you are switching from another language, you'll go crazy, I know I did.

Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
However, personally I don't like the insinuation that such languages are far superior to mIRC scripting because quite frankly they're not. mIRC scripting is a hell of a lot more focused...

Exactly the point I raised. I just did it more eloquently but perhaps more open-endedly.

I never mentioned whether or not COM objects were already supported, I merely made reference to mIRC itself via it's scripting editor getting the possibility of supporting other languages. I can see why some people want it but I think it would spoil an already good thing, mIRC's uniqueness in the respect that it has it's own scripting language which most of it's users enjoy playing with.

My personal view, unrelated to any comments is this: No language is superior to any other. It is a case of whatever works in a given situation and even the humble mIRC script has it's rightful place in the wide world of c0de.

Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Compare something written in mIRC scripting to something written in php, perl, python, tcl, etc (that does the same function) and you will see that mIRC script is FAR slower.

Who gives a monkeys?

mIRC scripting is a language designed to support one application - mIRC. It's not like people are trying to convert mIRC into an operating system or whatever. Why is it that you must over-rate everything on the issue of speed. mIRC scripting works fast enough (bloody fast) for what it was designed for. C++ or Java or VB.NET or Perl or whatever else there is is not going to do the job any better in any practical sense. Whilst it might be possible to have a whack over a benchmark that contradicts this, your eyes won't see it any different.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well thats because you don't use mIRC scripting to do things I've done. Ever used $findfile? Well I used it to list mp3s into a listbox. It freezes mIRC for about 10 seconds while it does this process. In perl, the entire operation took less than a second. And saying people don't want it to be an OS... are you new here? As a matter of fact, I've seen a few people say mIRC should be an OS! And just look at what people use mIRC scripting for. A guy recently asked for help making an mIRC httpd. Another guy making an mIRC ircd, another with an ftpd. mIRC scripting may have been designed just for mIRC and just for IRC based scripting, but it has evolved far passed that.

Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
I've seen a few people say mIRC should be an OS! And just look at what people use mIRC scripting for. A guy recently asked for help making an mIRC httpd. Another guy making an mIRC ircd, another with an ftpd.

So have I, I've been a member of this forum for a while, but you don't seriously suggest that mIRC should be required to perform those tasks do you? I often knock those who say mIRC is just for text-based IRC but trying to run it as a web or IRC server is completely removing it from it's intended role rather than using it for IRC with some enhancements which it could well quite handle with it's current scripting support.

As for $findfile, well I reckon your statement on that must mean you have more MP3 files than you could ever possibly get to hear because my listbox comes up almost straight away. I've never had any complaints from the people that use my script re: the speed of $findfile either. I can only assume that you either use a 486 or have tens of thousands of files.

I still think that the original suggestion is like putting a 5 litre V8 engine in a Daihatsu Charade. While the power to weight ratio would be useful, it's just not necessary.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
I'm using a 1.4Ghz Athlon Thunderbird with about 500 files. The files are contained in a directory structure of:
D:\music\mp3\<artist>\<album>\filename

And I told it to findfile *.* on D:\music\mp3 It loads very slowly. Especially since it doesn't just display the name, it reads the ID3 information (not using mIRC's built in ID3 functions) and outputs that to the list as well. The list is an MDX header based listview. It takes anywhere from 10-15 seconds to load.

Joined: Mar 2003
Posts: 20
E
Ameglian cow
Offline
Ameglian cow
E
Joined: Mar 2003
Posts: 20
i think, CloCkWeRX don't meant mirc script is bad for everything
just bad for complex project

every script engine have it's own job
mirc script is simple to do simple job
but not simple to do complex job
mirc script is a confused language cos it just exten from a very very simple script language, (even not be caledl a language)

it have little logical on the language itself.
how can us write a logical script(program) by it?

and i totally agree with codemastr

but i wonder if Khaled will support for other language
while he worked hard to make such simple mirc scripting language and own such wonderful and complex library(those $** functions in /help)
perhaps only 1% chances he will decide to do so

maybe codemastr can write a dll to load another scripting language for mirc
and use a script to pass events to dll

Last edited by enenen; 27/04/03 05:04 AM.
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
The list is an MDX header based listview. It takes anywhere from 10-15 seconds to load.

I think that is likely to be your lag problem.

I use:
Code:
if ($devent == init) {
  var %sdik $findfile(%ws.sounds,*.*,0,did -a sp 2 $1-)
}


... and %ws.sounds = D:\Music\

It loads about 370 files in about a 10th of a second.

I use a 1300MHz AMD Thunderbird with 512MB Ram and XP Home/2000 Pro on my two desktops and the laptop is an 1800MHz AMD Athlon Mobile with 256MB Ramand XP Home. All machines produce the same performance loading the files.

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
omg. .
Thank you Watchdog.. I though about that, but it never clicked. I just loaded my playlist fo over 500 songs in a second. Very nice. grin


-KingTomato
Page 1 of 2 1 2

Link Copied to Clipboard