StartHack

The SD.StartHack function initiates a hacking minigame based on the specified type and arguments. This function dynamically calls the appropriate minigame function based on the provided type, ensuring that the function name matches the minigame's corresponding export name.

Overview

Purpose: Starts a specified hacking minigame by dynamically calling the relevant function from the registered minigame exports.

Resource List

  • ps-ui

  • memorygame

  • ran-minigames

  • hacking

  • howdy-hackminigame

  • SN-Hacking

  • rm_minigames

Parameters

  • type (string): The type of hacking minigame to start (e.g., 'ps-circle', 'ps-maze', 'mhacking-start', etc.).

  • callback (function): The callback function to handle success or failure (optional).

  • ... (any): Additional arguments to pass to the minigame function.

(arguments have to line up with what the minigame being called is e.g. if it's ps-maze, and ps-maze requires 3 arguments (time, show, fail for ex.) then you have to add three args for SD.StartHack)

Usage Example

SD.StartHack('ps-circle', function(success)
    if success then
        print("Hacking successful!")
    else
        print("Hacking failed!")
    end
end, 2, 20) -- Number of circles, Time in milliseconds

SD.StartHack('ps-maze', function(success)
    if success then
        print("Maze hacking successful!")
    else
        print("Maze hacking failed!")
    end
end, 20) -- Time in seconds

SD.StartHack('memorygame-thermite', function(success)
    if success then
        print("Thermite hacking successful!")
    else
        print("Thermite hacking failed!")
    end
end, 10, 3, 3, 10) -- Correct blocks, Incorrect blocks, Show time in seconds, Lose time in s

Arguments

  • ps-circle: {2, 20} - Number of circles, Time in milliseconds

  • ps-maze: {20} - Time in seconds

  • ps-varhack: {2, 3} - Number of blocks, Time in seconds

  • ps-thermite: {10, 5, 3} - Time in seconds, Grid size, Incorrect blocks

  • ps-scrambler: {numeric, 30, 0} - Type, Time in seconds, Mirrored option

  • memorygame-thermite: {10, 3, 3, 10} - Correct blocks, Incorrect blocks, Show time in seconds, Lose time in seconds

  • ran-memorycard: {120} - Time in seconds

  • ran-openterminal: {} - No additional arguments

  • hacking-opengame: {15, 4, 1} - Time in seconds, Number of blocks, Number of repeats

  • howdy-begin: {3, 5000} - Number of icons, Time in milliseconds

  • sn-memorygame: {3, 2, 10000} - Keys needed, Number of rounds, Time in milliseconds

  • sn-skillcheck: {50, 5000, {'w', 'a', 's', 'w'}, 2, 20, 3} - Speed in milliseconds, Time in milliseconds, Keys, Number of rounds, Number of bars, Number of safe bars

  • sn-thermite: {7, 5, 10000, 2, 2, 3000} - Number of boxes, Number of correct boxes, Time in milliseconds, Number of lives, Number of rounds, Show time in milliseconds

  • sn-keypad: {999, 3000} - Code number, Time in milliseconds

  • sn-colorpicker: {3, 7000, 3000} - Number of icons, Type time in milliseconds, View time in milliseconds

  • rm-typinggame: {easy, 20} - Difficulty, Duration in seconds

  • rm-timedlockpick: {200} - Speed value

  • rm-timedaction: {3} - Number of locks

  • rm-quicktimeevent: {easy} - Difficulty

  • rm-combinationlock: {easy} - Difficulty

  • rm-buttonmashing: {5, 10} - Decay rate, Increment rate

  • rm-angledlockpick: {easy} - Difficulty

  • rm-fingerprint: {200, 5} - Time in seconds, Number of lives

  • rm-hotwirehack: {10} - Time in seconds

  • rm-hackerminigame: {5, 3} - Length, Number of lives

  • rm-safecrack: {easy} - Difficulty

Last updated