UNIT Unit11;

INTERFACE

USES
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

TYPE
  TForm11 = Class(TForm)
    edit_address: TEdit;
    timer_check_value: TTimer;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    PROCEDURE timer_check_valueTimer(Sender: TObject);
    PROCEDURE FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  PRIVATE
  PUBLIC
  END;

VAR
  Form11: TForm11;

CONST
  address_script_var_pointer:LongWord=$10EC0;

IMPLEMENTATION

{$R *.dfm}

USES Unit1,Unit2,Unit3,Unit5,Unit6,Unit7,Unit8,Unit9,Unit10;

PROCEDURE TForm11.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  BEGIN
    Self.Visible:=False;
    CanClose:=False;
    Form1.Menu_Patch_Scriptvars.Checked:=False;
  END;

FUNCTION patch_scriptvars_loaded:Boolean;
  CONST check_for:LongWord=$0B395BE9;
    address_at:LongWord=$479470;
  BEGIN
    IF Decode_Int(ReadMem(address_at,4))=check_for THEN result:=True
    ELSE result:=False;
  END;

PROCEDURE TForm11.timer_check_valueTimer(Sender: TObject);
  BEGIN
    IF _connected AND patch_scriptvars_loaded THEN BEGIN
      edit_address.Text:=IntToHex(Decode_Int(ReadMem(address_script_var_pointer,4)),8);
    END;
  END;

END.
