Cursor problem

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Meatball
orc pawn
orc pawn
Posts: 14
Joined: Sun Feb 22, 2004 8:39 am

Cursor problem

Post by Meatball » Thu Apr 22, 2004 8:49 am

I'm trying to check if there's an item on my cursor. If nothing's there, the Cursor object is NULL and /if doesn't seem to trigger NULL as false in this case. What am I doing wrong?

Code: Select all

/if (${Cursor.ID}) {
   /echo Cursor is empty.
}

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Apr 22, 2004 8:50 am

Your logic is reversed, your example really should be saying:

Code: Select all

/if (${Cursor.ID}) { 
   /echo Something is on my cursor.
} 

Meatball
orc pawn
orc pawn
Posts: 14
Joined: Sun Feb 22, 2004 8:39 am

Post by Meatball » Thu Apr 22, 2004 8:56 am

It's too early in the morning. :D

Should this code work then?

Code: Select all

/if (!${Cursor.ID}) {
   /echo Cursor is empty.
}

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Apr 22, 2004 8:59 am

Yep