mIRC Home    About    Download    Register    News    Help

Print Thread
#185678 12/09/07 02:46 PM
Joined: Aug 2007
Posts: 72
P
Babel fish
OP Offline
Babel fish
P
Joined: Aug 2007
Posts: 72
/editbox -A switch (uppercase)
Append to current text


mIRC Scripting: So easy a caveman could do it.
PhireCoder #185708 12/09/07 11:31 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
or simply /editbox -a $editbox($active) APPENDEDTEXT


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #185732 13/09/07 08:09 AM
Joined: Aug 2007
Posts: 72
P
Babel fish
OP Offline
Babel fish
P
Joined: Aug 2007
Posts: 72
Yeah.... No.
Not the same thing
That command "re-puts" the whole line every time you use it(Really Slow). AND moves cursor to end of line...

I know you can do that I'm not stupid...

Anyways...

-S(uppercase) To Enter Selected Text would be nice too... especially in combination with -A switch ...
(AND YES CAPTAIN OBVIOUS I KNOW -b and -e)
But these would make things a Whole Lot Easier and Faster (Internally)

Example:
(In-Line Auto Completer - Event)
Code:
on *:keyup:*:*: {
  if ($keychar isalnum) {
    if ($hfind(ac,$+($gettok($editbox($active),$numtok($editbox($active),32),32),*),1,w)) {
      editbox $+(-ab,$calc($len($editbox($active)) + 1),e,$calc(($len($editbox($active)) + 1) + ($len($v1) - $len($gettok($editbox($active),$numtok($editbox($active),32),32))))) $+($editbox($active),$right($v1,$calc($len($v1) - $len($gettok($editbox($active),$numtok($editbox($active),32),32)))))
    }
  }
}


vs.

Code:
on *:keyup:*:*: {
  if ($keychar isalnum) {
    if ($hfind(ac,$+($gettok($editbox($active),$numtok($editbox($active),32),32),*),1,w)) {
      editbox -aAS $right($v1,-1)
    }
  }
}


mIRC Scripting: So easy a caveman could do it.
PhireCoder #185762 13/09/07 04:53 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Faster by what? 2 ticks? Maybe Khaled should make a switch for me in /server that will join all the channels i need, acquire all the op status and nick registrations, and even start talking for me! We'll call it -woot. It will be so much faster and more efficient!

But really.. adding another switch to save a few lines of code just increases complexity unnessesarily.

Everything you suggested above can already be done is equally simple with current switches-- and I wouldn't buy "it's faster" or "more efficient" unless you've actually benchmarked the time, otherwise there's really no evidence whatsoever.

By the way, I simplified your code (and made it more efficient) by not reusing the same identifiers over and over:

Code:
on *:keyup:*:*: {
  if ($keychar isalnum) {
    var %a = $editbox($active), %la = $len(%a) + 1
    var %na = $numtok(%a, 32), %ga = $gettok(%a, %na, 32)
    var %lga = $len(%ga), %ldiff = $calc($len($v1) - %lga)
    if ($hfind(ac,$+(%ga,*),1,w)) {
      editbox $+(-ab, %la, e, $calc(%la + %ldiff) $+(%a, $right($v1, %ldiff))
    }
  }
}


Sure, you can *try* and make the comparison look ugly by making the line extremely long and not using any vars, but the truth is, your code will look more like the above, which is pretty manageable.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #185782 13/09/07 10:13 PM
Joined: Aug 2007
Posts: 72
P
Babel fish
OP Offline
Babel fish
P
Joined: Aug 2007
Posts: 72
lmfao, you've got issues bub... seek help smile


mIRC Scripting: So easy a caveman could do it.
argv0 #185790 14/09/07 12:52 AM
Joined: Jul 2006
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
~This post is now a stress free zone~

Last edited by Mentality; 14/09/07 01:28 AM.
bwuser #185792 14/09/07 01:29 AM
Joined: Aug 2007
Posts: 72
P
Babel fish
OP Offline
Babel fish
P
Joined: Aug 2007
Posts: 72
lol that's funny...
well actually, arg is somewhat right.... i just think some of his concepts of a rational feature suggestion are very misunderstood... A suggestion doesn't have to compensate for 100's of lines of scripting to be desired, and yeah his code doesn't work, was missing a )
er...
well still doesn't work after adding that but i still get the idea...
but I didn't try to make any of my examples look more complicated than the other... if you look at them i didn't use vars in either of them... The reason was that i DID test them and found that it's faster without the vars... with that particular snip of code I was trying to extract as much speed as i could... and that was the reason for the suggestion... It wouldn't just make it "2 ticks faster" on my comp that code snip is very laggy.. which makes sense because it rewrites the line entirely, it doesn't take a genius to figure out that just appending text would be WAY faster AND work exactly as desired, which currently it doesn't, but really It's not that big a deal guys I wasn't tryin to make anyone argue on here...
But anyways bw, I don't let anything get to me, I'll still make suggestions... Prolly one's even more useless than this smile

Can't we all just get along :P


mIRC Scripting: So easy a caveman could do it.
bwuser #185794 14/09/07 01:33 AM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
I was going to edit bits and bobs of your post to include valid opinions, but, partly because you chose to type it entirely in caps, I ended up deciding the entire post was a long ranting flame.

I think everyone needs to read this.

Particularly relevant I think are:

Quote:
please keep posting constructive criticism. Improve on suggestions or show the poster why his suggestion just wouldn't work or make sense ("you can script it" is not a valuable response).

Remember that people come in here looking to pitch an idea to Khaled, not for other forum members to shoot ideas down.


and

Quote:

Has my idea been brought up before?
Be sure to search the forums first! Failure to search first is rude to those of us who read the forum.
Will my idea benefit lots of users?
I rarely see features added that benefit just a handful of users. You should try to stick to suggestions that would help lots of people.
Would it be easy to write a script for my idea?
If it's something that is very easy to do with scripts, chances are it won't be built into mIRC. (This isn't always the case, but should be considered when posting your idea.)


Regards,


Mentality/Chris
Mentality #185797 14/09/07 02:20 AM
Joined: Jul 2006
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
~ Now you're just being facetious, and if you do it again, you'll lose your posting privileges smile ~

Last edited by Mentality; 14/09/07 02:27 AM.

Link Copied to Clipboard