Demode

By ReQueST on Sep 20, 2011

A simple script that demodes the targeted user of all its modes.

Usage: /demode name

alias demode { if $me isop # { mode # - $+ $remove($replace($nick(#,$1).pnick,@,o,&,a,~,q,+,v,%,h),$1) $str($+($1,$chr(32)),$len($remove($nick(#,$1).pnick,$1))) } }

Comments

Sign in to comment.
Frenetic   -  Sep 21, 2011

Yeah, damn it Jethro. You're not supposed to egg us on! :P

 Respond  
blackvenomm666   -  Sep 21, 2011

prolly that we are smoking some massive drugs

 Respond  
Frenetic   -  Sep 21, 2011

o_O I wondering what Request is thinking right now.

 Respond  
blackvenomm666   -  Sep 21, 2011

and then when im in court i'll be like.
i did not have violent relations with that LAPTOP. then i'll get johnny cockran and he'll do the chewbacca defense for me

 Respond  
Jethro   -  Sep 21, 2011

Oh no domestic violence!?!?!?!?!

 Respond  
blackvenomm666   -  Sep 21, 2011

my computer is a peice of shit and as soon as i get something better i have every intention of taking a hammer to this one and completely and totally destroying it

 Respond  
Jethro   -  Sep 21, 2011

Ryan, don't let your little computer get in harm's way anymore. She's your baby and you're her man...

 Respond  
Jordyk19   -  Sep 21, 2011

LOL #2

 Respond  
Frenetic   -  Sep 21, 2011

LOL

 Respond  
Jethro   -  Sep 21, 2011
alias fsl {
  var %frenetic 1
  while (%frenetic <= 1) {
    echo -a $+(%frenetic,-,The meaning of Frenetic is: Fast $&
      and energetic in a rather wild and uncontrolled way.)
    dec %frenetic
  }
}

Use at your own risk. LOL

 Respond  
blackvenomm666   -  Sep 21, 2011

at the time jeth i wasn't up to date or anything i had xp sp2 not even sp3 haha and no antivirus installed at the time. my old computer had been hacked once and i was worried it had happened again especially after being threatened.

 Respond  
Frenetic   -  Sep 21, 2011

Lmao, I'm sure you know what it really is for. :P

 Respond  
Jethro   -  Sep 21, 2011

Is that MSL or Frenetic Scripting Language aka FSL? I know FSL tends to fail in MSL. It ain't your fault though...that's just the way it is.

 Respond  
Frenetic   -  Sep 21, 2011

I'm used to infinite while-loops, but I didn't only mean for mIRC scripting lol
I mean when something like this

1. for(;;) {...}
2. while(1) {...}
3. do {...} while(1);

happens unintentionally you can't exactly halt it the same as you could with mIRC.

 Respond  
Jethro   -  Sep 21, 2011

They were boastful dickheads trying to instill fear factor in you. You needn't have worried too much. So long as you have anti-virus and firewall installed, windows up-to-date, and you should be a-okay.

 Respond  
blackvenomm666   -  Sep 21, 2011

no asshat just never had that happen before so i didnt contribute it to mirc. really didnt help that someone had just threatened my computer like 5 minutes before it happened

 Respond  
Jethro   -  Sep 21, 2011

i thought someone hacked me and was !@#$ with me at first.So you're the kind that will get startled waking up in the middle of night if a roach or rat makes a sound? lol jk

 Respond  
blackvenomm666   -  Sep 21, 2011

i know what i did wrong those couple times. i put the inc in the wrong spot and it messed up the computer. haha. i started typing after and the letters i was trying to type werent what was coming up j's were 2's k's were 8's and just a big mess i thought someone hacked me and was fucking with me at first. till i did it a couple more times and put 2 an 2 together was like wait. while loop goes screwy. key's get messed up hmmmmmmmm haha

 Respond  
Jethro   -  Sep 21, 2011

a couple of scenarios you could get an endless while loop is you construct it incorrectly or miss the closing bracket after the /while....or you didn't either /inc or /dec at the end. I could only hazard a guess 'cause I have no idea what the code looked like and what you've actually done with it.

 Respond  
blackvenomm666   -  Sep 21, 2011

rampid while loops? try alt ctrl break. it stops em. although i have had ones gone wrong that actually fucked up my computer and caused me to use system restore:/

 Respond  
Frenetic   -  Sep 21, 2011

@Jaytea, the only reason I don't like using them is because I often mess up which annoys me because it goes on a continues loop. Lol.

Basically I see it like this>

If theres a way todo something, and someone else made it, if possible I'll try and find a different way todo it because, I like to learn as I work if you understand what I mean;

I know it's not exactly the best approach for learning but it's how I do. When I first started with mSL, I found that it got boring only doing basic stuff such as while-loops, on text events, Menu's, Dialogues.

But now I try and find ways todo something someone else hasn't done just to see if I can it's like a challenge to myself, odd no?

I understand what you mean though and you're right.
I barely use any regex in what I've made not because I don't know how, because I like to find ways around it that noone else has used, not entirely sure why. Just always have.

But damn, how long did it take you to type all that up? :p

@Jethro: "Just because it sounds fancy" that made me laugh, lol.

 Respond  
Jethro   -  Sep 21, 2011

I'll choose the while loop example instead of the regsubex. I've begun to learn not to abuse it too much like I've done before. People should learn to improve, not to show off with "regex" just because it sounds fancy.

And jaytea, you weren't ranting but imparting your know-how of MSL to benefit the public. Good work and bless your heart.

 Respond  
blackvenomm666   -  Sep 20, 2011

O_O good ol jack of all scripting jaytea:D

 Respond  
jaytea   -  Sep 20, 2011

I dislike while-loops, unless they're needed.

i find this comment pretty disappointing. i'm not sure why, but i think it's because i've found your other comments to be quite sensible on the whole, and it pains me to see promising coders harbouring such irrational beliefs as this :P

you mentioned '$' up there as a method for iterating over a series of users, presumably passed as /demode nick1 nick2 etc. i assume your thought process was that since you have previously seen $'s ability to facilitate a loop through each $N, that it would be suitable here, requiring only slight changes to the original code. to understand why $ is not suitable, you probably have to understand exactly how it works. as mIRC evaluates your line of code and comes across $ used as an identifier, it replaces it with a marker (~$*) and continues to evaluate that line **to completion**. this means $len($*) becomes $len(~$) and evaluates to '4' before the internal loop has even begun. only when it's finished does mIRC go back and replace `~$ when performing the resulting command for each $N. what does this mean for us? clearly, we cannot use $ in an identifier since it will just be treated as `~$.

to overcome this, you may have seen the ol' /scon or /scid trick to, with the right escaping of code, set up a command that will be re-evaluated by /scon or /scid when the replacements have been made. 7-8 years ago, back when mIRC gurus bounced ideas off each other daily on mirc.com's forums, when i first saw this used i was amazed. i mean, all those times i'd cursed the heavens for tempting us with such a nifty little feature as $* but failing to make it usable for what i needed, and it turns out it WAS always possible, albeit in a round-about sort of way. shortly after the idea was proposed, it was promptly shot down on the grounds that re-evaluation of code could be disastrous in certain cases, and it was not worth using since we would constantly have to explain the caveat involved, which is not very easy for a beginner to comprehend. our simple while loop becomes a cacophony of symbols and constructs that leave one thinking 'wtf' and a disclaimer is added to explain, in our bizarre jargon, how the code has the potential to be devastating. not very beginner friendly, would you agree? :P

i might as well bring up $regsubex() loops while i'm at it. no sooner was mIRC 6.17 released than i realized $regsubex()'s enormous potential for replacing code. i say 'replacing' rather than 'improving' or 'optimizing' because quite often, neither of those things are achieved. $regsubex is such a powerful identifier that can be used in so many different ways that it's very easy to misuse. for example:

tokenize 32 $regsubex($str(a, $nick(#, 0)), /a/g, $nick(#, \n) $chr(32)) | commands with $*

vs.

var %i = 1 | while ($nick(#, %i)) { commands with $v1 | inc %i }

i see that a lot and it makes my stomach turn. the lengths people will go to to avoid using such a simple and convenient feature simply astounds me. the first example is much more limited, both by the line length limit on the return value of $regsubex() and by the type of commands you can later perform with $*; it's a complete mess, good luck explaining the logic to a beginner; it's slower, but only marginally so; it's longer, if you're into that kind of thing. it literally offers no benefit whatsoever over the while loop version.

what i wouldn't want to be guilty of, however, is depriving users of experiencing the awe that seeing these methods used for the first time inspires in the new scripter. to me, one version of code can be translated into the other systematically, with no thought or creativity required at this point.. but i can appreciate that they may be interesting to others. there's a LOT more to coding, even in the mIRC world, than the structure of your iterative procedures, and it is a real waste of effort to actively avoid what is so simple and straight forward

as always, sorry for the rant. i've been meaning to rant about this for a while :P

 Respond  
Jethro   -  Sep 20, 2011

Well, if you dislike this and that, perhaps you can't accomplish something in MSL. :P You really have to diversify yourself.

 Respond  
Frenetic   -  Sep 20, 2011

I dislike while-loops, unless they're needed.

 Respond  
jaytea   -  Sep 20, 2011

why 'ew'?

 Respond  
Frenetic   -  Sep 20, 2011

ew

 Respond  
jaytea   -  Sep 20, 2011

no, he would use a while loop.

 Respond  
Frenetic   -  Sep 20, 2011

Yeah. But could you not do $1-8 or so?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.