mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2004
Posts: 21
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2004
Posts: 21
Just few questions for (advanced ?!) coders to know what are better ways to optimize some kind of codes ..
-----
1=] First, in events, is it better to group all same kind of events or not ?
Code:
; Must we prefer 500 lines in one ?:
; (with all codes of punish, flood protection, even seen system..)
On *:Text:*:*:{
  if ($chan) {
    if ($chan == #mychan1) {
      if ($nick == SomeOne) ..
      elseif ($1 == !blah) ...
    }
    elseif ($chan == #mychan2) {
      ...
    }
  }
  elseif ($nick) {
    ...anti mp, flood detection ...
  }
}
;
;
; Or it's better to make more events ?:
On $*:Text:\..\:#:..
On @*:Text:*:#testing:..
On 1:Text:$(* $+ $me $+ *):#:..


For dialog events too, is it more faster for mIRC to process one On Dialog with a lot of condition ($dname == blah, $devent == sclick, $did== N..)
or it's better to use lots of On Dialog:dname:devent:N: ?

-----

2=] Is it possible there is a mDx.dll saturation because of a lot of mDx control use in a script ? (on the interface especially)

-----

3=] What usefulness ?
Code:
; Some of you use a ! in front of commands (often silent cmd) - Why ? 
!.msg $chan blabla or !.echo -a test
; Why use RAW in some code ?! 
raw WHOIS <nick> or raw JOIN <channel>

-----

4=] Search DLL
Someone'd know a dll which allows to dock as rebar.dll or one which pretends to be faster findfile (with subdirectories) as one of mIRC plz ?
-----

5=] Little issue
I use 'ContextHelp' (mDx.dll - from a button) who add an "?" icon next to the one to close. And when i click on it, all boxes on my form (dialog) disappear temporairy, i have to give the focus to another application & come back on mIRC, so that boxes re-appear. An idea ?!


Thx u for answer, & sorry for my english.. wink

Last edited by CoolWave; 24/03/04 03:07 PM.

-Be cool with my English-
irc.EpiKnet.org:#scripts
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
1. I prefer several events over one, especially when some of them can be filtered out based on userlevel, my channel status, matchtext or channel names. This is a classic example...
  • Code:
    On @*:text:!*:#:{ parse command }
    On @*:text:*:#:{ check text }
...which I'd definitely use instead of:
  • Code:
    On @*:text:*:#:{
      if !* iswm $1 {
        parse command
        return
      }
      check text
    }
When it comes to dialogs I usually filter my events at the $dname level to avoid it being triggered on mouse movement. I wouldn't make a separate event for each $did because it doesn't look good (imo). Example:
  • Code:
    On *:dialog:name:init:*:{ do stuff }
    On *:dialog:name:sclick:*:{
      var %did = $did
      goto %did
      :1 | do stuff | return
      :2 | do stuff | return
      :15 | do stuff | return
      :%did
    }
3.

[*] a: The ! prefix tells mIRC to bypass possible aliases. It's a good habit to prefix your commands with an ! whenever there's a chance they will be caught by a custom alias which will likely corrupt your script, as in the example of !.echo -q $input(hello) when we intend to hide the identifier's output.

[*] b: They say /raw is faster than other IRC commands like /msg, /kick and such because mIRC doesn't try to process the parameters being passed to it. If you use /raw to send a PRIVMSG instead of using /msg, mIRC will not echo your text to the corresponding channel/query window.

I use /raw if I want two commands to be sent in one packet for faster response from the server. For example, this will produce a superfast kick: //raw mode # +b $wildsite $+ $lf $+ kick # $nick :cya

4. listfiles.dll, findfiles.dll. I haven't tested them myself but you can get some impression from the comments.

5. I have no idea about MDX but you can try /showmirc (see the help file for available switches)

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
so how do you find the /raw commands? Is there a source for them?


Those who fail history are doomed to repeat it
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Yeah, RFC 1459 wink or if you're short in time, type /debug @debug and watch the client <-> server communication.

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
kewl thanks smile Ill have to read up on it later smile


Those who fail history are doomed to repeat it
Joined: Mar 2004
Posts: 21
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2004
Posts: 21
Thx for these answers Online,
& for mDx, i haven't solved the issue, but it seems to come from my computer.
Cya wink


-Be cool with my English-
irc.EpiKnet.org:#scripts

Link Copied to Clipboard