> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Scripts

> استعلامات البرنامج النصي والرمز الثانوي والبيئة.

<div className="real-category-page">
  استعلامات البرنامج النصي والرمز الثانوي والبيئة.

  ## الدوال المتاحة

  <CardGroup cols={2}>
    <Card title="decompile" href="./decompile">
      يفك decompile لسكربت Roblox ويرجع source text الناتج عندما يكون bytecode متاحا. يجب أن يكون argument عبارة عن script Instance مدعوم. إذا لم يتوفر bytecode قابل للاستخدام، ترجع function nil.
    </Card>

    <Card title="dumpstring" href="./dumpstring">
      يرجع decompressed bytecode string من Roblox script object. يتم تسجيل dumpstring على نفس C++ function مثل getscriptbytecode، لذلك يكون السلوك مطابقا. يجب أن يكون argument هو object. يقبل bytecode reader المشترك قيم ClassName: ModuleScript و LocalScript و CoreScript و Script. بالنسبة إلى Script، يجب أن يكون RunContext هو Client. إذا كان ClassName مفقودا، تطلق function "Invalid Instance". إذا لم يكن ClassName من script classes المدعومة، تطلق "Script expected". إذا كانت القيمة Script مع RunContext آخر، تطلق "Expected a Script with RunContext set to Client". إذا كان embedded bytecode reference غير صالح أو كان طول stored bytecode هو 8 bytes أو أقل، ترجع function nil. خلاف ذلك تفك ضغط stored bytecode باستخدام DecompressBytecode وترجع resulting bytes كـ Luau string. Hash mismatch أو too-short compressed data أو ZSTD decompression errors يتم إرجاعها كـ error text bytes بواسطة DecompressBytecode بدلا من إطلاقها هنا.
    </Card>

    <Card title="getcallingscript" href="./getcallingscript">
      يرجع script المخزن على current Luau thread object. لا تقبل function أي arguments. تقرأ the current thread script، وهي stored reference. إذا لم يكن هذا stored reference expired، تدفع function قيمة script Instance باستخدام Instance cache وترجعها. إذا كان stored reference expired، ترجع function nil. لا تفحص function الـ Lua call stack، ولا تبحث في ancestor scripts، ولا تتحقق من script ClassName.
    </Card>

    <Card title="getinstancesbyclass" href="./getinstancesbyclass">
      ترجع instances من Instance cache table التي يطابق ClassName field لها string المطلوب بالضبط. تتم قراءة الوسيط الأول باستخدام string type checking. Empty string يطلق "ClassName required". تنشئ function array table جديدة، وتكرر cache المخزنة تحت Instance cache، وتبقي فقط values التي يكون Lua type لها object، وتقرأ ClassName field لكل object value، وتقارنه باستخدام strcmp مع className المطلوب. تتم إضافة matches بشكل sequential بدءا من index 1. المطابقة exact و case-sensitive. لا تستخدم function دالة IsA، ولا تشمل subclasses، ولا تقوم بـ walk descendants، ولا تقوم بتصفية Parent، ولا ترتب النتيجة. getinstancesofclass هو alias لنفس function.
    </Card>

    <Card title="getloadedmodules" href="./getloadedmodules">
      Returns a new array table containing live entries from loaded module list. The optional excludeCore argument is read with optional boolean handling and defaults to true when omitted or nil. If excludeCore is true, entries whose instance is a descendant of core packages or CoreGui are skipped. Expired weak entries and locked stored references without a value are skipped. The function pushes each remaining entry with Instance cache at sequential array indexes starting at 1. The function does not check ClassName, does not sort the result, and does not walk the DataModel.
    </Card>

    <Card title="getmenv" href="./getmenv">
      Returns the environment table associated with a ModuleScript. The argument must be a ModuleScript object. Invalid objects raise "Invalid Instance", non-ModuleScript objects raise "ModuleScript expected", and ModuleScripts without an available thread raise "invalid thread". The function does not accept Script or LocalScript; use getsenv for those cases.
    </Card>

    <Card title="getreferencedby" href="./getreferencedby">
      Returns cached Instance values whose supported reference properties point to the provided Instance. The argument must be an Instance.
    </Card>

    <Card title="getrunningscripts" href="./getrunningscripts">
      يرجع array table جديدة من unique script Instances مأخوذة من live Lua threads. لا تأخذ function أي arguments. تمشي عبر the live Luau thread list، وتقرأ كل thread node، وتتخطى entries التي لا تحتوي على thread node أو weak thread ref أو LiveLuaRef أو Lua state أو object أو التي تحتوي على expired Script stored reference. لكل thread متبق، تقفل scriptThread->object->Script()، وتزيل التكرار حسب script reference، وتدفع Instance باستخدام Instance cache، وتدرجه في array indexes متتالية تبدأ من 1. لا تفحص function الـ DataModel، ولا تتحقق من ClassName، ولا ترتب result.
    </Card>

    <Card title="getscriptbytecode" href="./getscriptbytecode">
      يرجع decompressed bytecode string من Roblox script object. يتم تسجيل getscriptbytecode على نفس C++ function مثل dumpstring، لذلك يكون السلوك مطابقا. يجب أن يكون argument هو object. يقبل bytecode reader المشترك قيم ClassName: ModuleScript و LocalScript و CoreScript و Script. بالنسبة إلى Script، يجب أن يكون RunContext هو Client. إذا كان ClassName مفقودا، تطلق function "Invalid Instance". إذا لم يكن ClassName من script classes المدعومة، تطلق "Script expected". إذا كانت القيمة Script مع RunContext آخر، تطلق "Expected a Script with RunContext set to Client". إذا كان embedded bytecode reference غير صالح أو كان طول stored bytecode هو 8 bytes أو أقل، ترجع function nil. خلاف ذلك تفك ضغط stored bytecode باستخدام DecompressBytecode وترجع resulting bytes كـ Luau string. Hash mismatch أو too-short compressed data أو ZSTD decompression errors يتم إرجاعها كـ error text bytes بواسطة DecompressBytecode بدلا من إطلاقها هنا.
    </Card>

    <Card title="getscriptclosure" href="./getscriptclosure">
      Loads the stored bytecode for a supported Roblox script Instance and returns it as a Lua closure. Returns nil when usable bytecode is not available.
    </Card>

    <Card title="getscripthash" href="./getscripthash">
      يعيد uppercase SHA384 hex digest لسلسلة bytecode المخزنة في Roblox script object. يجب أن يكون argument من نوع object. يقبل Helper المشترك GetBytecode قيم ClassName وهي ModuleScript و LocalScript و CoreScript و Script. بالنسبة إلى Script يجب أن يكون RunContext هو Client. إذا كانت ClassName مفقودة، ترمي function الخطأ "Invalid Instance". إذا لم تكن ClassName إحدى فئات script المدعومة، ترمي الخطأ "Script expected". إذا كانت القيمة Script مع RunContext آخر، ترمي الخطأ "Expected a Script with RunContext set to Client". إذا كان embedded bytecode reference غير صالح أو كان طول stored bytecode يساوي 8 bytes أو أقل، تعيد function nil. وإلا فهي تحسب SHA384 للـ stored bytecode bytes نفسها وتعيد uppercase hex string. لا تستدعي function دالة DecompressBytecode ولا تحسب hash للـ decompressed bytecode.
    </Card>

    <Card title="getscripts" href="./getscripts">
      يعيد قيم script object الموجودة حاليا في Instance cache. لا تأخذ function أي arguments. تمر عبر cache المخزنة تحت مفتاح Instance cache lightobject وتفحص فقط entries التي تكون قيمتها object. تقرأ حقل ClassName لكل قيمة باستخدام optional string handling. يتم تضمين LocalScript و ModuleScript. يتم تضمين Script فقط عندما تكون قيمة RunContext offset مساوية لـ CLIENT أو PLUGIN. يتم تخطي قيم ClassName الأخرى، و entries بدون string ClassName، و CoreScript. النتيجة هي Luau table متسلسلة. لا تجتاز function الـ DataModel ولا تضمن sorted order.
    </Card>

    <Card title="getscriptthread" href="./getscriptthread">
      يعيد Lua thread المرتبط بـ script object عندما تستطيع Real العثور عليه. يجب أن يكون argument من نوع object. تقرأ function حقل ClassName في القيمة وترفع "not a valid Instance" إذا لم يكن هذا الحقل string. قيم ClassName المقبولة هي Script و LocalScript و ModuleScript؛ أي قيمة أخرى ترفع "Script expected". تتحقق أولا من ScriptThreadCache في Real باستخدام script reference. عند cache hit، تعيد Luau thread المخزن كـ thread. عند cache miss، يجب أن تكون قيم Script ذات RunContext Client وإلا ترفع function "Expected a Script with RunContext set to Client". بعد ذلك تمشي عبر the live Luau thread list، وتتبع first weak thread reference لكل thread node إلى LiveLuaRef، وتتخطى missing thread data أو expired Script stored references، وتقارن كل script reference مع script المطلوب. إذا وجدت match، تعيد Luau thread ذلك كـ thread. إذا لم تجد match، تعيد nil.
    </Card>

    <Card title="getsenv" href="./getsenv">
      Returns the environment table associated with a LocalScript, Script, or ModuleScript. Unsupported script objects or scripts without an available thread raise the same errors as the underlying script lookup.
    </Card>

    <Card title="loadstring" href="./loadstring">
      Compiles a Luau source string and returns the loaded function. If loading fails, it returns nil and an error message. The returned function is not executed automatically.
    </Card>
  </CardGroup>
</div>
