mIRC Homepage

on *:dialog:name:mouse:*:

Posted By: sparta

on *:dialog:name:mouse:*: - 13/10/04 02:12 AM

Code:
if ($devent == mouse) {
 if ($did == ID) { do this }

will react on when mouse is moved over the ID, but how can i get it to react when mouse is moved out from ID ?
Posted By: tidy_trax

Re: on *:dialog:name:mouse:*: - 13/10/04 02:44 AM

Code:
if ($devent == mouse) { 
  if ($did == ID) { 
    if ($hget(ldid,ldid) isnum 1-) && ($hget(ldid,ldid) != $did) && ($did isnum 1-) {
      ;Commands for when you move into a did from a did.
    }  
    elseif ($hget(ldid,ldid) == 0) && ($did isnum 1-) {
      ;Commands for moving into a did from the dialog.
    }
    elseif ($hget(ldid,ldid) isnum 1-) && ($did == 0) { 
      ;Commands for moving out of a did onto the main dialog.
    }
    elseif ($hget(ldid,ldid) isnum 1-) && ($did isnum 1-) {
      ;Commands for moving out of a did and into another did.
    }
  }
  hadd -m ldid ldid $did
}


$hget(ldid,ldid) is the last did that the mouse was over.
Posted By: dr_Eamer

Re: on *:dialog:name:mouse:*: - 13/10/04 06:28 PM

If you don't mind me asking, why would you use a hash-table for something like that instead of a single %variable?
Also, isn't $whatever isnum 1- the same as $whatever > 1 ? (only makes it harder to read the code imho except if I'm missing something)
Posted By: tidy_trax

Re: on *:dialog:name:mouse:*: - 14/10/04 04:16 PM

I use hash tables for everything even if it is only a single value because I hate global variables.
I use isnum because it's just the way I script, I prefer it to >, >=, etc.

Edit, also, $whatever isnum 1- is the same as $whatever >= 1
© 2019 mIRC Discussion Forums