GPC Developer Guides
Functions
Internal Functions
within this section of the guide, you will find the functions and commands the virtual machine uses to handle data in gpc scripts bit functions function description set bit sets one bit clear bit clears one bit test bit tests a bit set bits stores a value into a bit index get bits gets a value from the bit index internal functions for bit functions can be found here bit functions docid\ h1dky5zmfxzablnlu22ps combo functions function description combo run runs a combo combo running checks if a combo is running combo stop stops a running combo combo restart restarts a running combo combo suspend suspends (pauses) a combo combo suspended checks if a combo is in the suspended state combo current step keywords returning the current step combo step time left the time left of the currently executed step combo stop all stops all combos combo suspend all suspends (pauses) all combos combo resume resumes the suspended combo or the already running combo combo resume all resumes all suspended combos internal functions for combo functions can be found here combo functions docid m1ibxqjadriv0mvlfext math functions function description abs returns an absolute value of a number inv returns the inverse value of a number pow raise and value to the specified power isqrt calculates an integer square root random generates a random value between the specified range clamp the clamp() function clamps a value between an upper and lower bound clamp() enables selecting a middle value within a range of values between a defined minimum and maximum it takes three parameters a minimum value, a preferred value, and a maximum allowed value min gets the minimum of two values max gets the maximum of two values internal functions for math functions can be found here math functions docid 7b7tavhfm58pgrkpq40xy device functions function description get rtime returns the elapsed time between main iterations in milliseconds get slot returns the active slot number load slot loads a specified slot get ctrlbutton returns the identifier of the controller button vm tctrl sets the vm timeout for the next iteration set polar sets the stick output at a given angle and radius with a high resolution value get polar retrieves the current angle or radius of either the left or right analog stick get ipolar retrieves the current unmodified angle or radius of either the left or right analog stick set rgb sets the led on the zen to the supplied rgb color set hsb sets the led on the zen to the supplied hsb color get info detects the state of the mk profile in use internal functions for device functions can be found here device functions docid\ mnbybjvua 70etuwsb j8 led display functions function description pixel oled draws a pixel on the oled display line oled draws a line on the oled display rect oled draws a rectangle on the oled display circle oled draws a circle on the oled display putc oled puts a character into the string buffer for puts oled puts oled draws the characters supplied using putc oled on the oled display cls oled sets the entire oled display to a single color print draws a string on the oled display internal functions for oled display functions can be found here oled display functions docid\ kefhsosodthzts87op sz