mIRC Home    About    Download    Register    News    Help

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


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: on *:dialog:name:mouse:*: #100502 13/10/04 02:44 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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.


New username: hixxy
Re: on *:dialog:name:mouse:*: #100503 13/10/04 06:28 PM
Joined: Aug 2004
Posts: 101
D
dr_Eamer Offline
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)


Maybe I wake up one day to notice that all my life was just a dream!
Re: on *:dialog:name:mouse:*: #100504 14/10/04 04:16 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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.

New username: hixxy