The Dink Network

Reply to Re: Script help (Checking to see if an enemy is on the screen)

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 22nd 2007, 06:56 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Well, you can check whether there are any sprites with either brain 9 or 10 on the screen. Those are usually the enemy brains, so I would recommend something like this:

int &present = get_sprite_with_this_brain(10,1);
if (&present != 0)
goto present;
&present = get_sprite_with_this_brain(9,1);
if (&present != 0)
goto present;
say_stop("No monsters on this screen...",1);
return;
present:
//execute spell here.

(Maybe this isn't the cleanest way... But it's 0:56 here, so that might just impale my ability to think clearly.)