mIRC Home    About    Download    Register    News    Help

Print Thread
#170132 03/02/07 06:32 PM
Joined: Jan 2007
Posts: 259
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
I think OOP would be a great feature for mIRC scripting.
It would allow people to code faster, make snippets that can be used more easily, etc, etc.
I think it could be implimented without breaking old scripts by:
Having a command that states that OOP will be used in the script, I.E:

Code:
alias somealias {
 OOP on

 var ^oopvar = new object(Hello World!)

 ^oopvar->hello
}

class object {
 private %msg = $1-

 public alias hello {
  echo $iif(%msg,$v1,Hi World!)
 }
}

^oopvar would be unset when the script finished.

Code:
alias somealias {
 OOP on

 set ^oopvar new object(Hello World!)

 ^oopvar->hello
}

class object {
 private %msg = $1-

 public alias hello {
  echo $iif(%msg,$v1,Hi World!)
 }
}

The object would remain, and would retain all variables set inside the object, then you could unset it by typing:
Code:
unset ^oopvar


Those who can, cannot. Those who cannot, can.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Heh. Object oriented programming has been suggested in the past and it seems that few want it. This is scripting rather than a full fledged programming language. That isn't to say it couldn't happen or that I would care if it happened. However, I can easily write any script without OOP that you can write with OOP.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #170155 03/02/07 09:09 PM
Joined: Jan 2007
Posts: 259
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
However, if it was to be implimented the way I described, you would have to tell mIRC that the alias would be using OOP, or it would not do anything related to OOP.

Also, OOP makes it alot simpler, i.e having all the complex stuff inside the class, and having everything else outside as simple as it needs to be.


Those who can, cannot. Those who cannot, can.
Riamus2 #170162 03/02/07 10:41 PM
Joined: Dec 2006
Posts: 80
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
I agree with Riamus2. I consider scripting a hobby, I enjoy this scripting process and like the editor just the way it is. It was challenging learning to write basic code from knowing nothing 5yrs ago. I just developed through trial and error. After years of using it this way, I consider myself as 'programmed' as the code and style that I use to write with, and don't think I would want to change it now... lol. I have alot of respect for Khaled creating this editor to remain simple enough for beginners to learn, yet complicated enough to remain an endless challenge. There is definately already a diversity of both low and high discipline thought process for certain scriptwriting.

I guess it all balances out on whatever level a person is willing to operate on.

To myself, I think OOP would be like mixing apples with oranges at this point. Alias's work well enough in my eyes an can achieve a similar goal. I think OOP would make scripting feel like something was missing.


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Scripto #170165 03/02/07 11:20 PM
Joined: Jan 2007
Posts: 259
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
Adding OOP the way I described would change nothing in the script editor. You would need to tell mIRC that it should use OOP in the events/etc you create.


Those who can, cannot. Those who cannot, can.
Joined: Dec 2006
Posts: 80
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
My point was that putting in OOP commands would be similar to replacing a good old fashioned alias...

I guess theres just some old school in me that doesn't want to see change. I feel like adding OOP is like adding something to mIRC thats already there in a sense.


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Scripto #170170 04/02/07 01:15 AM
Joined: Jan 2007
Posts: 259
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
There aren't objects, in mIRC. However, OOP is just making things more abstract. For example:

Code:
class somthing {
 alias somthing return 5
}
; could be:
alias somthing {
var %f = $1 $+ ( $+ $2- $+ )
return $somthing_ [ $+ [ %f ] ]
}
alias -l somthing_somthing return 5


alias testit {
OOP on
var ^x = new somthing
echo ^x->somthing()
echo ---
echo $somthing(somthing)
}

Still, you can't instance things this way that easily.
Theoretically, this would echo:
Quote:
5
---
5


Those who can, cannot. Those who cannot, can.

Link Copied to Clipboard