mIRC Home    About    Download    Register    News    Help

Print Thread
Custom IF operators. #56800 22/10/03 07:11 PM
Joined: Sep 2003
Posts: 149
S
Stealth Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Sep 2003
Posts: 149
It would be nice if there were a way to script a custom IF operator in the remotes section. Something like:

Code:
 
;This would reflect a post i just read on "isuop" and "ishop"
;using: if ($1 operator $2)

IF isuop {
  if (- isin $nick($2,$1).pnick) { return $true }
  else { return $false }
}


The IF using the custom operator will use $true and $false respectively.

Addition:
This operator would be used like:
if (nick isuop chan) { commands }

If the statement returns $true (meaning true) it would proceed with the commands, if not ($false) it will skip that command block exactly like if it were a built-in operator.

Last edited by Stealth; 22/10/03 07:15 PM.

mIRC 6.21 - Win XP Pro (SP2) - 2.4 Ghz - 1 GB Mem
irc.x-tab.org
Re: Custom IF operators. #56801 22/10/03 07:52 PM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Wouldn't this be the same as using a custom $isuop() identifier, since mIRC would have to refer to a third-part code anyway? Unless it referred to the "if" block in a different, faster way than how it refers to custom identifiers, but still, I don't see how much improvement this feature would offer as a whole..

Last edited by cold; 22/10/03 07:53 PM.

* cold edits his posts 24/7
Re: Custom IF operators. #56802 22/10/03 08:07 PM
Joined: Sep 2003
Posts: 149
S
Stealth Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Sep 2003
Posts: 149
It would make scrippting a bit faster and simpler than typing the $isup all the time, because you would need to type

if ($isuop(nick,chan) == $true)

Instead of

if (nick isuop chan)

In this example it is not much, but in some of my scripts it would save alot of space and alot of time.

For example, I have:
Code:
 
if ($1 isvo %mychan) || ($1 isop %mychan) || ($me !isop %mychan) { HALT }


repeated alot in one of my scripts. It would be a whole lot easier if i can just have if ($1 noop %mychan).
I thought alot about of using an identifier, but that would still take a bit more time to type.


mIRC 6.21 - Win XP Pro (SP2) - 2.4 Ghz - 1 GB Mem
irc.x-tab.org
Re: Custom IF operators. #56803 22/10/03 09:03 PM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
But this behaviour wouldn't be changed, since mIRC would need to know what does "isuop" mean, just like it does with identifiers, making this really just a cosmetic change.. this is what I'm talking about.


* cold edits his posts 24/7
Re: Custom IF operators. #56804 22/10/03 11:43 PM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
(I think I'm a little crazy, just thought you replied again, then replied this back. Sorry. Anyway, I think what's below clears my point..)

You don't need the " == $true" part, just ($isuop(nick,chan)).

And, as I said, mIRC would need to know what "isuop" means, since it wouldn't be built-in, so it would need to get its value and parse its script code, which is exactly what it does with identifiers already. Again, what I meant is, AFAIK, unless mIRC used a different way to store that information so it could get it faster, it would be just a cosmetic change with no speed difference.

Plus, anyway, if mIRC had the possibility to get it any faster then, why wouldn't it apply the method to identifiers either? It's the same process: parse, interpret the code and return.

Last edited by cold; 22/10/03 11:45 PM.

* cold edits his posts 24/7
Re: Custom IF operators. #56805 25/10/03 05:46 PM
Joined: Apr 2003
Posts: 414
Adrenalin Offline
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
I like this idea ..

if (a operator b)

alias operator {
;$1 = a
;$2 = b
dosmthink $1 $2
return 1
}


mIRC Chm Help 6.16.0.3 Full Anchored!
Re: Custom IF operators. #56806 25/10/03 06:33 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
if ($operator(a, b))

You already have the capability.. Like cold mentioned, it wouldn't make anything faster. All it would do is give you the abilty t say "I made my own operator"


-KingTomato