Help with mouse randomiser
3 posts
• Page 1 of 1
Help with mouse randomiser
Hi all! Haven't posted here in a while, I hope you're all doing well. I'm a bit dusty with all of this, I'm trying to make it so my mouse randomly just moves around on a loop. What am I doing wrong?
- Code: Select all
#include <mouse.gph>
// INPUT INITIALIZATION
//
// ----------------------------------------------------------------------------------------------------------------
#define mousex MOUSE_X
#define mousey MOUSE_Y
// INIT
//
// ----------------------------------------------------------------------------------------------------------------
init {
// AUTO OUTPUT PROTOCOL
//
// ----------------------------------------------------------------------------------------------------------------
port_connect(PORT_USB_C, PROTOCOL_HID);
keymapping();
mousemapping();
}
// THE MAIN SCRIPT
//
// ----------------------------------------------------------------------------------------------------------------
main {
// HID PASSTHROUGH
//
// ----------------------------------------------------------------------------------------------------------------
key_passthru();
mouse_passthru();
combo_run(move);
}
// COMBOS
//
// ----------------------------------------------------------------------------------------------------------------
combo move {
mouse_set(mousex, irand(5));
mouse_set(mousey, irand(-5));
wait(100);
}
// FUNCTIONS
//
// ----------------------------------------------------------------------------------------------------------------
int irand(int scramble) {
fix32 fraction = (fix32) scramble * 0.01;
int vmin = scramble - (int) fraction;
int vmax = scramble + (int) fraction;
return(((int)(rand() * (fix32)(vmax + 1 - vmin))) + vmin);
}
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: Help with mouse randomiser
Perhaps caused by this: https://github.com/J2Kbr/TitanTwo/issue ... -530047189
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Help with mouse randomiser
Ok thanks for the info
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
3 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: oohmoi and 167 guests