Skip to content

fc2.js

overview

fc2.js is a HTTP module wrapper by typedef. Link to forum thread here (click me).


install

Copy the following to your web document.

HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script src="https://fantasy.cat/fc2.js"></script>

methods

run

Description

This function does a GET request to /lua and automatically encodes a Lua script.

Parameters

  • string script_name
  • string code

run

Description

This function does a GET request to /lua and automatically encodes a Lua script. This will automatically use fc2.lua to execute its code instead of a specific Lua script.

Parameters

  • string code

api

Description

Wrapped for the Web API.

Parameters

  • string solution
  • string method
  • string params

api

Description

Wrapped for the Web API.

Parameters

  • string method

api

Description

Wrapped for the Web API.

Parameters

  • string method
  • string params

get_sessions

Description

Returns session class in JSON object.

Returns

  • object json

get_configuration

Description

Returns your configuration as a JSON object.

Returns

  • object json

set_configuration

Description

Sets your configuration.

Parameters

  • string json

get_engine

Description

Gets all information from the engine module. If you pass include=all, the return data will include entity information as well.

Parameters

  • string include

Result (Example)

JSON
{
  "game": {
    "bones": [
      7,
      4,
      10
    ],
    "closest_entity": {
      "address": 140283042717712,
      "angle": {
        "x": 0.18557004630565643,
        "y": -89.98119354248047,
        "z": 0
      },
      "bone": {
        "x": -0.5885011553764343,
        "y": -1149.326171875,
        "z": 60.086734771728516
      },
      "bone_id": 7,
      "direction": 1,
      "distance": 1237.2091064453125,
      "true_fov": 3.6606764793395996
    },
    "entity_list": {
      "enemies": {
        "140283042635792": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 576,
            "y": -384,
            "z": -0.4687509536743164
          },
          "team": 3
        },
        "140283042717712": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 0,
            "y": -1152,
            "z": -0.4687480926513672
          },
          "team": 3
        },
        "140283047411728": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 1152,
            "y": -256,
            "z": -0.4687514305114746
          },
          "team": 3
        },
        "140283047493648": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -576,
            "y": -384,
            "z": -0.4687514305114746
          },
          "team": 3
        },
        "140283047575568": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -576,
            "y": 384,
            "z": -0.4687509536743164
          },
          "team": 3
        },
        "140283047657488": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 0,
            "y": 1152,
            "z": -0.4687509536743164
          },
          "team": 3
        },
        "140283047739408": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 1152,
            "y": 512,
            "z": -0.4687497615814209
          },
          "team": 3
        },
        "140283047821328": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -768,
            "y": 0,
            "z": -0.4687514305114746
          },
          "team": 3
        },
        "140283076075536": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -832,
            "y": -1152,
            "z": -0.4687497615814209
          },
          "team": 3
        },
        "140283077001232": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -448,
            "y": 128,
            "z": -0.46875
          },
          "team": 3
        },
        "140283077083152": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 1152,
            "y": -512,
            "z": -0.4687480926513672
          },
          "team": 3
        },
        "140283081670672": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 448,
            "y": 128,
            "z": -0.4687509536743164
          },
          "team": 3
        }
      },
      "players": {
        "140283042635792": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 576,
            "y": -384,
            "z": -0.4687509536743164
          },
          "team": 3
        },
        "140283042717712": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 0,
            "y": -1152,
            "z": -0.4687480926513672
          },
          "team": 3
        },
        "140283047411728": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 1152,
            "y": -256,
            "z": -0.4687514305114746
          },
          "team": 3
        },
        "140283047493648": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -576,
            "y": -384,
            "z": -0.4687514305114746
          },
          "team": 3
        },
        "140283047575568": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -576,
            "y": 384,
            "z": -0.4687509536743164
          },
          "team": 3
        },
        "140283047657488": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 0,
            "y": 1152,
            "z": -0.4687509536743164
          },
          "team": 3
        },
        "140283047739408": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 1152,
            "y": 512,
            "z": -0.4687497615814209
          },
          "team": 3
        },
        "140283047821328": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -768,
            "y": 0,
            "z": -0.4687514305114746
          },
          "team": 3
        },
        "140283076075536": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -832,
            "y": -1152,
            "z": -0.4687497615814209
          },
          "team": 3
        },
        "140283077001232": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -448,
            "y": 128,
            "z": -0.46875
          },
          "team": 3
        },
        "140283077083152": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 1152,
            "y": -512,
            "z": -0.4687480926513672
          },
          "team": 3
        },
        "140283081670672": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": 448,
            "y": 128,
            "z": -0.4687509536743164
          },
          "team": 3
        },
        "140283158814736": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -0.9946517944335938,
            "y": 87.87648010253906,
            "z": 0.03125
          },
          "team": 2
        }
      },
      "teammates": {
        "140283158814736": {
          "is_alive": true,
          "is_dormant": false,
          "origin": {
            "x": -0.9946517944335938,
            "y": 87.87648010253906,
            "z": 0.03125
          },
          "team": 2
        }
      }
    },
    "fov": 16,
    "friendly_fire": false,
    "localplayer": 140283158814736,
    "localweapon": 378773520,
    "viewangles": {
      "x": -0.6160005331039429,
      "y": -93.55313110351562,
      "z": 0
    }
  },
  "process": {
    "base": 0,
    "id": 862970,
    "is_blacklisted": false,
    "is_x64": true,
    "modules": {
      "client": {
        "base": 140285153640448,
        "is_x64": true,
        "size": 32022528
      },
      "engine": {
        "base": 140285566779392,
        "is_x64": true,
        "size": 11935744
      }
    }
  }
}

reset

Description

This will reload all Lua scripts and restart the FC2 solution.


directory

Description

This will list all files in a directory.

Parameters

  • string path (optional)

get_processes

Description

This will get a list of all running processes.