Controllable Rapid Speeds?

Posts 1–10 of 10 · Page 1 of 1
Controllable Rapid Speeds?
Hey, I was just wondering how to make rapid fire "more controllable" so instead it being set at max you can set it to a certain speed. Here's the code for rapid fire, so basically what I'm saying is if there is a way to slow rapid fire down by changing the bytes? Oh and ignore the blabla stuff, it's just to help reduce lag.

Code:
if(GetAsyncKeyState(VK_LBUTTON)<0 && IRapidfire && Status) 
	{
		if( !blabla[0] )
		{
			WriteOpCode((PBYTE)RapidFire, (PBYTE)"\x90\x90", 2);
			blabla[0] = true;
		}
	} else {
		if( blabla[0] )		
		{
			WriteOpCode((PBYTE)RapidFire, (PBYTE)"\x74\x3E", 2);
			blabla[0] = false;
		}
	}
Nothing to do with changing the bytes.

Here's a hint, add a clock timer to the rapidfire.
Quote Originally Posted by Xipher View Post
Nothing to do with changing the bytes.

Here's a hint, add a clock timer to the rapidfire.
Ok, so what's an ideal clock time?
I believe i'm using 90 milliseconds for mine.
clock_t timer;

if (clock() < timer)
{
deactivate();
}else{
timer = clock () + 0.08 * CLOCKS_PER_SEC ;
activate();
}
^ Yeah what mat posted.
Quote Originally Posted by Xipher View Post
^ Yeah what mat posted.
It won't stop firing -__-

Code:
clock_t timer;
	if(GetAsyncKeyState(VK_LBUTTON)<0 && IRapidFire && Status) 
	{
		if(clock() < timer)
                        {
                                WriteOpCode( (PBYTE)RapidFire1, (PBYTE)"\x74\x09", 2);
                                WriteOpCode( (PBYTE)RapidFire2, (PBYTE)"\x80\xBE\xE0\x00\x00\x00\x00", 7);
                                WriteOpCode( (PBYTE)RapidFire3, (PBYTE)"\x7E\x15", 2);
                                WriteOpCode( (PBYTE)RapidFire4, (PBYTE)"\x74\x3E", 2);
				WriteOpCode( (PBYTE)RapidFire5, (PBYTE)"\x8B\x86\xEC\x00\x00\x00", 6);
                        }
                        else
                        {
                                timer = clock() + 0.09 * CLOCKS_PER_SEC;
                                WriteOpCode((PBYTE)RapidFire1, (PBYTE)"\x90\x90", 2);
				WriteOpCode((PBYTE)RapidFire2, (PBYTE)"\x90\x90\x90\x90\x90\x90\x90", 7);
				WriteOpCode((PBYTE)RapidFire3, (PBYTE)"\x90\x90", 2);
				WriteOpCode((PBYTE)RapidFire4, (PBYTE)"\x90\x90", 2);
			        WriteOpCode((PBYTE)RapidFire5, (PBYTE)"\x90\x90\x90\x90\x90\x90", 6);
                        }
	}
Quote Originally Posted by arun823 View Post
Hey, I was just wondering how to make rapid fire "more controllable" so instead it being set at max you can set it to a certain speed. Here's the code for rapid fire, so basically what I'm saying is if there is a way to slow rapid fire down by changing the bytes? Oh and ignore the blabla stuff, it's just to help reduce lag.

Code:
if(GetAsyncKeyState(VK_LBUTTON)<0 && IRapidfire && Status) 
	{
		if( !blabla[0] )
		{
			WriteOpCode((PBYTE)RapidFire, (PBYTE)"\x90\x90", 2);
			blabla[0] = true;
		}
	} else {
		if( blabla[0] )		
		{
			WriteOpCode((PBYTE)RapidFire, (PBYTE)"\x74\x3E", 2);
			blabla[0] = false;
		}
	}
Here's a Working Rapidfire
http://www.mpgh.net/forum/207-combat...addresses.html

Credits to Atomic,
This also includes a Clock Timer just as @Xipher Stated.
The most easiest way to create a timer is make a new thread when rapidfire is enabled and dispose of thread when disabled, anyway in the thread you can use the sleep function to set a boolean for rapidfire...

example...
Code:
while (True) do
 begin
  asm
   pushad;
  end;
  
  RapidFireWrite:= Not RapidFireWrite;
  Sleep(90);

  asm
   popad;
  end;
end;
then in your main hack thread you would check the condition of RapidFireWrite..

While RapidFireWrite = True do
writebytes(rapidfireON);

writebyte(rapidfireOFF);


anyway you get the idea, the extra thread for the "timer" is used to stop lag and make it more readable and easier to implement.
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us