Osu Script Help
Hey guys so I have been working on this osu script for a few days, and I have a few issues. I am quite a novice when it comes to development.. as I'm sure you will see with the partial source I've included:
ZXtiming.h
main.cpp
I manually map the songs delays through the in game osu editor:
like so
The issue I'm having is timing, it appears my delays are incorrect even though I'm doing it through the in game editor... maybe my method adds too much latency?
edit:
I forgot to mention the script automates z presses
ZXtiming.h
Code:
class ZXtiming {
public:
int zPress;
int* zDownTime;
int* Sleep;
ZXtiming(int zPress, int zDownTime[], int Sleep[]);
};
Code:
INPUT key;
void zPress(int downDuration, int delay) {
key.type = INPUT_KEYBOARD;
key.ki.wScan = 0;
key.ki.time = 0;
key.ki.wVk = 0x5A;
key.ki.dwFlags = 0;
Sleep(delay);
SendInput(1, &key, sizeof(INPUT));
key.ki.dwFlags = KEYEVENTF_KEYUP;
Sleep(downDuration);
SendInput(1, &key, sizeof(INPUT));
}
void songScript(ZXtiming song, bool& control) {
int trackObject = 0;
int i = 0;
for (i = 0; i<10; i++){
if (control) {
zPress(song.zDownTime[i],song.Sleep[i]);
rPressed();
trackObject++;
std::cout << "Object Number: " << trackObject << std::endl;
}
else {
i = 0;
return;
}
}
control = false;
i = 0;
}
like so
Code:
int song1zAmount = 408;
int zUpDelay1[] = {1,1,1,1,1,1,1,1,1};
int sleepBetween[] = {405,203,203,202,203,203,203,202,203};
ZXtiming song1(song1zAmount,zUpDelay1,sleepBetween);
edit:
I forgot to mention the script automates z presses