mIRC Home    About    Download    Register    News    Help

Print Thread
#100501 13/10/04 02:12 AM
Joined: Feb 2003
Posts: 3,412
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
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 ?

Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
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.

Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
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)

Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
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

Last edited by tidy_trax; 14/10/04 04:19 PM.

Link Copied to Clipboard