PDA

View Full Version : Need Adaptoid Script Help



Olaf
May 10th, 2002, 23:34
I tried to use the Adaptoid script language to program autofire for a game that needs the fire button released before shooting again.

Can someone help me in this?

I try to do something like this:

action_Autofire(p)
{
if (p)
{
// loop as long as button 0 is pressed
while (button_pressed(0))
{
_key('a',1); // 'a' fires the weapon
_sleep(50);
_key('a',0); // release 'a'
_sleep(50);
}
}
}

Only problem is, I can't find a function that tells me the state of a controller button (pressed / unpressed). Is there any function for this?

Can someone tell me where I can find a list and possibly a documentation of the script commands? The Adaptoid SDK only contains DirectX programming samples.

Olaf

Olaf
May 12th, 2002, 13:58
I just got an answer from David Stam (Wish Technologies) regarding this question:

***********
You're on the right track. The "p" parameter is 1 on press and 0 on
release. The action_Autofire function will be called again when you release
the button, even if you are still spinning in a loop (it is reentrant).

So you want to do something like this:

action_Autofire(p)
{
static int button_pressed = 0;

if (p)
{
button_pressed = 1;

// loop as long as button is pressed
while (button_pressed)
{
_key('a',1);
_sleep(50);
_key('a',0);
_sleep(50);
}
}
else
{
button_pressed = 0;
}
}
***********

I tried it and it works.
The Adaptoid script language is really great, you can realise any kind of action with any adaptiod control that you want. Even complex macros for special moves are no problem at all!