Page 1 of 2 12 LastLast
Results 1 to 25 of 30

Thread: FormGUI (Form on Smart) Works.. buggy though

  1. #1
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default FormGUI (Form on Smart) Works.. buggy though

    Kk so if anyone remembers, a while back I was asking if its possible to attach forms to Smart inorder to have "Gui's and Bot setup" On smart itself...
    I was told I can't do that because there is no way to get the Handle to the two windows to do SetParent(Child, Parent).. because that's windows API or it would have to be built in.. something like that..

    Well below I have code that indeed does grab the handle to smart and set child windows to it using Simba and no extra programs. Its an extension.

    Anyway I need help.. I need to know how to get user input and convert the string they enter into a PCHAR... Next I need to know how to get rid of the Form TitleBar and how to Position the form where I want it or where the user wants it.. I don't know Pascal at all really.. well just a bit but not enough to do this buy myself..
    So I need help from anyone who can figure out what I want to do..

    Question: Why is there no support for writing extensions in c++ or other languages? Unless its not really possible I guess..


    I FIGURED IT OUT!!


    After all these years, I figured it out. You can now have GUI's On Smart! You cannot change Constant your GUI to change values then it must be Variables!

    Check out the below:

    Screenshots of it in action (OLD):
    Attachment 11469
    Attachment 11475

    Simba Script!!! Yes the form works.. But I get these stupid access violation errors :c
    Attachment 11476

    NEW:


    That's the LRC mining. Changing while the script is running works! I can enable and disable options without stopping the script.

    Here's Another Two:






    Now of course I didn't implement it into Mine/Asha's LRC but this is a real GUI that I spent an hr coding!



    ToDo:
    Figure out how to move the Form. Impossible while On Smart..
    Figure out how to remove Form Titlebar. Impossible while On Smart..
    Figure out how to make this work only when the debug button on smart is pressed. (HARDER than I thought :c) Needs Multi-Threading.

    FormGui.Sex (Extension):
    PHP Code:
    program WindowHandles;

    type
    TCharArray 
    = Array of Char;

    var
    SimbaMenuFormGUITMenuItem;
    ExtensionsString;
    FormTitleBarNamePChar;



    function 
    FindWindow(ClassNameWindowNamePChar): HWNDexternal 'FindWindowA@User32.dll stdcall';

    function 
    SetParent(ChildParentHWND): HWNDexternal 'SetParent@User32.dll stdcall';

    function 
    SetWindowPos(HandleHandleAfterHWNDXYCXCYIntegerFlagsWord) : Booleanexternal 'SetWindowPos@User32.dll stdcall';

    function 
    FindSmartHWND;
    var
    SmartHWND;
    begin
      Smart
    := FindWindow('SunAwtFrame''Public SMARTv6.9 - SMART Minimizing Autoing Resource Thing - By BenLand100');
      
    result:= Smart;
    end;

    Procedure SetParentSmart(SenderTObject);
    var
      
    FormHandleHWND;
      
    LinePCHAR;
    begin
      
    //inputQuery('FormGUI', 'FormTitleBarName', Line);       Someone help... iunno how to do this part.. GET USER INPUT!!

      
    FormTitleBarName:= 'FormGUI';             //INPUT WOULD GO HERE..
      
    FormHandle:=  FindWindow(''FormTitleBarName);
      
    SetParent(FormHandleFindSmart);

      
    //NEED TO REMOVE THE TITLEBAR FROM THE FORM!!

      
    SetWindowPos(FormHandle0143445051281);
    end;

    procedure Init;
    var
      
    LineTCharArray;
    begin
      SimbaMenu 
    := TMenuItem.Create(Simba_MainMenu);
      
    SimbaMenu.Caption := 'FormGUI';
      
    Simba_MainMenu.Items.Add(SimbaMenu);
      
    FormGUI := TMenuItem.Create(SimbaMenu);
      
    FormGUI.Caption := 'FormGUI';
      
    FormGUI.ShortCut := 123;
      
    FormGUI.OnClick := @SetParentSmart;
      
    SimbaMenu.Add(FormGUI);

    end;

    function 
    GetName string;
    begin;
      
    result := 'FormGUI';
    end;

    function 
    GetVersion string;
    begin;
      
    result := '1.0';
    end;

    procedure Free;
    begin

    end
    ;

    procedure Attach;
    begin
         writeln
    ('       FormGUI By Ggzz/Brandon       ');
         
    Writeln('#  FormGUI Simba Extension  #');
    end;

    Procedure Detach;
    begin
        writeln
    ('FormGUI: GoodBye!');
    end;

    begin
    end

    Test Script:
    Attachment 16540


    Actual Form by itself:
    PHP Code:
    {$I SRL/SRL.Simba}

    var
      
    GoldOptionCoalOptionBoolean;

    type
      TFormGUI 
    record
        XFormGUI
    TForm;
        
    pControlsTGroupBox;
        
    pAttachTCheckBox;
        
    pGoldTCheckBox;
        
    pStartTButton;
        
    pPauseTButton;
        
    pStopTButton;
        
    pCoalTCheckBox;
        
    pSFSTCheckBox;
        
    pJICTCheckBox;
        
    pDMPTCheckBox;
        
    pCloseTButton;
      
    end;

    var
      
    FormGUITFormGUI;

    Procedure Control_Click(SenderTObject);
    begin
      
    Case Sender Of
        FormGUI
    .pClose:   FormGUI.XFormGUI.CLOSE;
        
    FormGUI.pCoal:    CoalOption:= (Not CoalOption);
        
    FormGUI.pGold:    GoldOption:= (Not GoldOption);
        
      
    end;
    end;

    procedure Form_OnControlMouseDown(SenderTObjectButtonTMouseButtonShiftTShiftStateXYInteger);
    var
      
    mXmYfXfYsXsY Integer;
    begin
      fX 
    := FormGUI.XFormGUI.Left;
      
    fY := FormGUI.XFormGUI.Top;
      
    GetMousePos(sXsY);
      
    IsMouseButtonDown(Mouse_Left);
      case 
    Sender of
        FormGUI
    .XFormGUI:
          while 
    IsMouseButtonDown(Mouse_Left) do
          
    begin
            GetMousePos
    (mXmY);
            
    FormGUI.XFormGUI.Left := fX - (sX mX);
            
    FormGUI.XFormGUI.Top := fY - (sY mY);
            
    FormGUI.XFormGUI.Refresh;
            
    Wait(1);
          
    end;
      
    end;
    end;


    procedure FormGUI_Init;
    begin
      with FormGUI 
    do
      
    begin
        XFormGUI 
    := CreateForm;
        
    pControls := TGroupBox.Create(XFormGUI);
        
    pAttach := TCheckBox.Create(pControls);
        
    pGold := TCheckBox.Create(pControls);
        
    pStart := TButton.Create(pControls);
        
    pPause := TButton.Create(pControls);
        
    pStop := TButton.Create(pControls);
        
    pCoal := TCheckBox.Create(pControls);
        
    pSFS := TCheckBox.Create(pControls);
        
    pJIC := TCheckBox.Create(pControls);
        
    pDMP := TCheckBox.Create(pControls);
        
    pClose := TButton.Create(XFormGUI);
        
    with XFormGUI do
        
    begin
          Left 
    := 376;
          
    Top := 175;
          
    BorderStyle := bsNone;
          
    Caption := 'FormGUI';
          
    ClientHeight := 128;
          
    ClientWidth := 505;
          
    Color := clBtnFace;
          
    Font.Color := clWindowText;
          
    Font.Height := -11;
          
    Font.Name := 'Tahoma';
          
    Font.Style := [];
          
    PixelsPerInch := 96;
          
    //OnMouseDown := @Form_OnControlMouseDown;
        
    end;
        
    with pControls do
        
    begin
          Parent 
    := XFormGUI;
          
    Left := 8;
          
    Top := 5;
          
    Width := 489;
          
    Height := 117;
          
    Caption := 'Control Panel';
          
    TabOrder := 1;
        
    end;
        
    with pAttach do
        
    begin
          Parent 
    := pControls;
          
    Left := 15;
          
    Top := 5;
          
    Width := 105;
          
    Height := 17;
          
    Caption := 'Attach GUI Smart';
          
    TabOrder := 0;
          
    OnClick := @Control_Click;
        
    end;
        
    with pGold do
        
    begin
          Parent 
    := pControls;
          
    Left := 219;
          
    Top := 5;
          
    Width := 97;
          
    Height := 17;
          
    Caption := 'Mine Gold';
          
    TabOrder := 1;
          
    OnClick := @Control_Click;
        
    end;
        
    with pStart do
        
    begin
          Parent 
    := pControls;
          
    Left := 15;
          
    Top := 65;
          
    Width := 75;
          
    Height := 25;
          
    Caption := 'Start';
          
    TabOrder := 2;
          
    OnClick := @Control_Click;
        
    end;
        
    with pPause do
        
    begin
          Parent 
    := pControls;
          
    Left := 219;
          
    Top := 65;
          
    Width := 75;
          
    Height := 25;
          
    Caption := 'Pause';
          
    TabOrder := 3;
          
    OnClick := @Control_Click;
        
    end;
        
    with pStop do
        
    begin
          Parent 
    := pControls;
          
    Left := 403;
          
    Top := 65;
          
    Width := 75;
          
    Height := 25;
          
    Caption := 'Stop';
          
    TabOrder := 4;
          
    OnClick := @Control_Click;
        
    end;
        
    with pCoal do
        
    begin
          Parent 
    := pControls;
          
    Left := 403;
          
    Top := 5;
          
    Width := 97;
          
    Height := 17;
          
    Caption := 'Mine Coal';
          
    TabOrder := 5;
          
    OnClick := @Control_Click;
        
    end;
        
    with pSFS do
        
    begin
          Parent 
    := pControls;
          
    Left := 219;
          
    Top := 35;
          
    Width := 97;
          
    Height := 17;
          
    Caption := 'Use Fire Staff';
          
    TabOrder := 6;
          
    OnClick := @Control_Click;
        
    end;
        
    with pJIC do
        
    begin
          Parent 
    := pControls;
          
    Left := 403;
          
    Top := 35;
          
    Width := 97;
          
    Height := 17;
          
    Caption := 'Just In Case';
          
    TabOrder := 7;
          
    OnClick := @Control_Click;
        
    end;
        
    with pDMP do
        
    begin
          Parent 
    := pControls;
          
    Left := 15;
          
    Top := 35;
          
    Width := 121;
          
    Height := 17;
          
    Caption := 'Download SPS Maps';
          
    TabOrder := 8;
          
    OnClick := @Control_Click;
        
    end;
        
    with pClose do
        
    begin
          Parent 
    := XFormGUI;
          
    Left := 483;
          
    Top := 0;
          
    Width := 19;
          
    Height := 21;
          
    Caption := 'X';
          
    TabOrder := 0;
          
    ONCLICK := @Control_Click;
        
    end;
      
    end;
    end;

    procedure FormGUI_SafeInit;
    var
      
    vTVariantArray;
    begin
      SetLength
    (v0);
      
    ThreadSafeCall('FormGUI_Init'v);
    end;

    function 
    FormGUI_ShowModalBoolean;
    begin
      
    //Result := FormGUI.XFormGUI.ShowModal = mrOk;
      
    FormGUI.XFormGUI.SHOW;
      
    Result:= FormGUI.XFormGUI.Showing;
    end;

    function 
    FormGUI_SafeShowModalBoolean;
    var
      
    vTVariantArray;
    begin
      SetLength
    (v0);
      
    Result := ThreadSafeCall('FormGUI_ShowModal'v);
      
    WriteINI('Changed''Changed''True'IncludePath 'FormGUI.INI');
      
    WriteINI('SMART''SMART''y'IncludePath 'FormGUI.INI');
    end;

    Procedure FreeFormGUI;
    begin
      FreeForm
    (FormGUI.XFormGUI);
    end;

    begin
      SetupSRL
    ;

      
    FormGUI_SafeInit;
      
    FormGUI_SafeShowModal;
      
    AddOnTerminate('FreeFormGUI');

      
    Repeat
        writeln
    ('Gold: ' ToStr(GoldOption));
        
    writeln('Coal: ' ToStr(CoalOption));
        
    Wait(1000);
      
    Until(False);
    end
    Last edited by Brandon; 06-24-2012 at 09:15 AM.
    I am Ggzz..
    Hackintosher

  2. #2
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    I was thinking of creating something like this too
    But it kinda died :P

    ~Home

  3. #3
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    U see the problem in the screenshot right?? I can't move the form because there is no titlebar now which I figured out how to remove
    Is it cuz I made the form with Scar form editor?

    But I need to find a way to move the form :c Maybe at runtime a user can choose where to put it.. in the parent window aka smart.. But i still have a problem of getting user input..

    Another thing is to hide the form when the debug button is pressed.. I was thinking and its not as easy as I thought :c
    I am Ggzz..
    Hackintosher

  4. #4
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Completely offtopic: @ggzz The link in your signature is either wrong, or some joke that went over my head.

  5. #5
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by MylesMadness View Post
    Completely offtopic: @ggzz The link in your signature is either wrong, or some joke that went over my head.
    It's wrong Not a joke.


    ~Home

  6. #6
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by MylesMadness View Post
    Completely offtopic: @ggzz The link in your signature is either wrong, or some joke that went over my head.
    Opps.. it wasn't supposed to be a link.. its just everytime I put a signature.. it won't somehow turns into a link :S.. its just supposed to be plain text.. but its on powerbot and timer said it himself.
    I am Ggzz..
    Hackintosher

  7. #7
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    This would be awesome if you can get it completely working. You can make plugins in any language you want as an alternative to extensions. If a plugin could be made that exports a function like "ShowSMARTForm(form: TForm);" that would be epic. As for moving the form without a title bar, you can use this (just take the procedures that are used for moving, not the safeCall stuff):
    Simba Code:
    var
      Form : TForm;

    procedure Form_OnMouseDown(Sender : TObject; Button : TMouseButton; Shift : TShiftState; X, Y : Integer);
    var
      mX, mY, fX, fY, sX, sY : Integer;
    begin
      fX := Form.Left;
      fY := Form.Top;
      GetMousePos(sX, sY);
      IsMouseButtonDown(Mouse_Left); // Free the buffer
      case Sender of
        Form:
          while IsMouseButtonDown(Mouse_Left) do
          begin
            GetMousePos(mX, mY);
            Form.Left := fX - (sX - mX);
            Form.Top := fY - (sY - mY);
            Wait(1);
          end;
      end;
    end;

    procedure InitForm;
    begin
      Form := TForm.Create(nil);
      with Form do
      begin
        SetBounds(100, 100, 100, 100);
        BorderStyle := bsNone;
        OnMouseDown := @Form_OnMouseDown;
      end;
    end;

    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      SetArrayLength(v, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      Form.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      SetArrayLength(v, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    begin
      try
        SafeInitForm;
        SafeShowFormModal;
      except

      finally
        Form.Free;
      end;
    end.
    Zyt3x posted that on another thread.
    Last edited by Coh3n; 01-18-2013 at 09:56 PM.

  8. #8
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Also, I'm pretty sure X has these functions as well, thus it could be abstracted into Linux too!
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  9. #9
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    pretty cool

    Simba Code:
    program new;

    function SetParent(Child, Parent: HWND): HWND; external 'SetParent@User32.dll stdcall';

    function GetSimba(): TSysProc;
    var
      Arr: TSysProcArr;
      I, H: LongInt;
    begin
      Arr := GetProcesses();
      H := High(Arr);
      for I := 0 to H do
        if (Pos('Simba', Arr[I].Title) > 0) then
        begin
          Result := Arr[I];
          Exit;
        end;
    end;

    var
      Form: TForm;

    procedure _InitForm();
    begin
      Form := TForm.Create(nil);
      with Form do
      begin
        SetParent(Handle, GetSimba().Handle);
        Position := poOwnerFormCenter;
        Caption := 'test';
      end;
    end;
    procedure InitForm(); var V: TVariantArray; begin ThreadSafeCall('_InitForm', V); end;

    procedure _ShowForm();
    begin
      Form.Show;
    end;
    procedure ShowForm(); var V: TVariantArray; begin ThreadSafeCall('_ShowForm', V); end;

    procedure _RefreshForm();
    begin
      Form.Refresh;
    end;
    procedure RefreshForm(); var V: TVariantArray; begin ThreadSafeCall('_RefreshForm', V); end;

    function _IsShowingForm(): Boolean;
    begin
      Result := Form.Showing;
    end;
    function IsShowingForm(): Boolean; var V: TVariantArray; begin Result := ThreadSafeCall('_IsShowingForm', V); end;

    procedure _FreeForm();
    begin
      Form.Free;
    end;
    procedure FreeForm(); var V: TVariantArray; begin ThreadSafeCall('_FreeForm', V); end;

    begin
      InitForm();
      try
        ShowForm();

        while IsShowingForm() do
        begin
          try
            RefreshForm();
          except end;
          Wait(500);
        end;
      finally
        FreeForm();
      end;
    end.
    Last edited by Dgby714; 07-30-2011 at 07:14 AM.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  10. #10
    Join Date
    Apr 2007
    Location
    Lithuania
    Posts
    384
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    This is very nice.

    But what about if you painted on screen and checked if those coordinates were clicked?
    It would be lame for non fixed mode tho.

  11. #11
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by bevardis View Post
    This is very nice.

    But what about if you painted on screen and checked if those coordinates were clicked?
    It would be lame for non fixed mode tho.

    Cannot be done.. already tried it. Problem: The bot doesn't have threading so u'd have to program the clicks in.. meaning u'd have to make a loop for click checking and u'd have to run that loop ever so often.. by the time ur script gets to that loop, the click msg will be cleaned out of the messagequeue..

    Second (Probably possible): Smart may click one of those co-ordinates and then the GUI's click msg may trigger the reaction in the script..

    I haven't given up on this yet.. but I'm at the point where I just might because I can't get the form to stay and show on the screen unless I use Form.ShowModal() instead of Form.Show();

    No point of Simba having Form.Show() if it doesn't even work the way it should.. shows then disappears when clicked..
    I am Ggzz..
    Hackintosher

  12. #12
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    This would sure be nice. I think soon I'll get back to trying to make a dynamic "progress report", minus all the user-interaction, just something simple and stylish to make the script a little more attractive. (Considering how ugly SMART is...) [Maybe Ben won't mind this post]

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  13. #13
    Join Date
    Jul 2008
    Location
    California
    Posts
    255
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I actually love this idea. I haven't scripted in a couple of months, but I'm willing to try to help.
    I actually don't have Simba installed so I can't test any of these theories:


    Simba Code:
    Form1_1.Form1_1.SetBounds(7, 345, 505, 128);
    Are these the parameters for SetBounds(LLx, LLy, URx, URy):
    Lower-Left-x
    Lower-Left-y
    Upper-Right-x
    Upper-Right-y
    ?

    If so then you should be able to adjust the SetBounds parameters to wherever you want the form to span.

    As for getting rid of the title bar, I think you should remove this and the lines that point to it:

    Simba Code:
    with GroupBox1 do
        begin
          Parent := Form1_1;
          Left := 7;
          Top := 8;
          Width := 491;
          Height := 111;
          Caption := 'GUI TEST SCRIPT';
          TabOrder := 0;
        end;

    If I remember right, the TGroupBox is just there to group form options together.

    As for getting the user input I'm not entirely sure.
    Last edited by doom0791; 08-10-2011 at 06:52 AM.
    Unfortunately, no active scripts atm.

  14. #14
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    SetBounds works like this:
    Simba Code:
    TForm.SetBounds(left, top, width, height);

  15. #15
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Why didn't I see this until now?! This is really cool!

  16. #16
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Hey guys.. After all these years, I've figured it out. I just thought I'd bring light to my thread.

    You can now have GUI's on Smart AND Change the flow of a script in real-time via the Extension I uploaded on the First post. There are some limitations though. While attached to smart, you cannot MOVE the GUI. You can minimize it and show it again, you can close it and what not but you cannot MOVE it at all or else your entire script will crash. The next thing you cannot do is interupt Simba's thread prematurely. Meaning you cannot have a button that says "Terminate Script" and actually attempt to terminate it. That will just crash it. I do not know how to implement pausing but I'm sure that it will work.

    You can test it with either the Script OR via this small demonstration to show that the options change in real time without stopping/pausing your script:

    Simba Code:
    {$I SRL/SRL.Simba}

    var
      GoldOption, CoalOption: Boolean;

    type
      TFormGUI = record
        XFormGUI: TForm;
        pControls: TGroupBox;
        pAttach: TCheckBox;
        pGold: TCheckBox;
        pStart: TButton;
        pPause: TButton;
        pStop: TButton;
        pCoal: TCheckBox;
        pSFS: TCheckBox;
        pJIC: TCheckBox;
        pDMP: TCheckBox;
        pClose: TButton;
      end;

    var
      FormGUI: TFormGUI;

    Procedure Control_Click(Sender: TObject);
    begin
      Case Sender Of
        FormGUI.pClose:   FormGUI.XFormGUI.CLOSE;
        FormGUI.pCoal:    CoalOption:= (Not CoalOption);
        FormGUI.pGold:    GoldOption:= (Not GoldOption);
       
      end;
    end;

    procedure Form_OnControlMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    var
      mX, mY, fX, fY, sX, sY : Integer;
    begin
      fX := FormGUI.XFormGUI.Left;
      fY := FormGUI.XFormGUI.Top;
      GetMousePos(sX, sY);
      IsMouseButtonDown(Mouse_Left);
      case Sender of
        FormGUI.XFormGUI:
          while IsMouseButtonDown(Mouse_Left) do
          begin
            GetMousePos(mX, mY);
            FormGUI.XFormGUI.Left := fX - (sX - mX);
            FormGUI.XFormGUI.Top := fY - (sY - mY);
            FormGUI.XFormGUI.Refresh;
            Wait(1);
          end;
      end;
    end;


    procedure FormGUI_Init;
    begin
      with FormGUI do
      begin
        XFormGUI := CreateForm;
        pControls := TGroupBox.Create(XFormGUI);
        pAttach := TCheckBox.Create(pControls);
        pGold := TCheckBox.Create(pControls);
        pStart := TButton.Create(pControls);
        pPause := TButton.Create(pControls);
        pStop := TButton.Create(pControls);
        pCoal := TCheckBox.Create(pControls);
        pSFS := TCheckBox.Create(pControls);
        pJIC := TCheckBox.Create(pControls);
        pDMP := TCheckBox.Create(pControls);
        pClose := TButton.Create(XFormGUI);
        with XFormGUI do
        begin
          Left := 376;
          Top := 175;
          BorderStyle := bsNone;
          Caption := 'FormGUI';
          ClientHeight := 128;
          ClientWidth := 505;
          Color := clBtnFace;
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Tahoma';
          Font.Style := [];
          PixelsPerInch := 96;
          //OnMouseDown := @Form_OnControlMouseDown;
        end;
        with pControls do
        begin
          Parent := XFormGUI;
          Left := 8;
          Top := 5;
          Width := 489;
          Height := 117;
          Caption := 'Control Panel';
          TabOrder := 1;
        end;
        with pAttach do
        begin
          Parent := pControls;
          Left := 15;
          Top := 5;
          Width := 105;
          Height := 17;
          Caption := 'Attach GUI Smart';
          TabOrder := 0;
          OnClick := @Control_Click;
        end;
        with pGold do
        begin
          Parent := pControls;
          Left := 219;
          Top := 5;
          Width := 97;
          Height := 17;
          Caption := 'Mine Gold';
          TabOrder := 1;
          OnClick := @Control_Click;
        end;
        with pStart do
        begin
          Parent := pControls;
          Left := 15;
          Top := 65;
          Width := 75;
          Height := 25;
          Caption := 'Start';
          TabOrder := 2;
          OnClick := @Control_Click;
        end;
        with pPause do
        begin
          Parent := pControls;
          Left := 219;
          Top := 65;
          Width := 75;
          Height := 25;
          Caption := 'Pause';
          TabOrder := 3;
          OnClick := @Control_Click;
        end;
        with pStop do
        begin
          Parent := pControls;
          Left := 403;
          Top := 65;
          Width := 75;
          Height := 25;
          Caption := 'Stop';
          TabOrder := 4;
          OnClick := @Control_Click;
        end;
        with pCoal do
        begin
          Parent := pControls;
          Left := 403;
          Top := 5;
          Width := 97;
          Height := 17;
          Caption := 'Mine Coal';
          TabOrder := 5;
          OnClick := @Control_Click;
        end;
        with pSFS do
        begin
          Parent := pControls;
          Left := 219;
          Top := 35;
          Width := 97;
          Height := 17;
          Caption := 'Use Fire Staff';
          TabOrder := 6;
          OnClick := @Control_Click;
        end;
        with pJIC do
        begin
          Parent := pControls;
          Left := 403;
          Top := 35;
          Width := 97;
          Height := 17;
          Caption := 'Just In Case';
          TabOrder := 7;
          OnClick := @Control_Click;
        end;
        with pDMP do
        begin
          Parent := pControls;
          Left := 15;
          Top := 35;
          Width := 121;
          Height := 17;
          Caption := 'Download SPS Maps';
          TabOrder := 8;
          OnClick := @Control_Click;
        end;
        with pClose do
        begin
          Parent := XFormGUI;
          Left := 483;
          Top := 0;
          Width := 19;
          Height := 21;
          Caption := 'X';
          TabOrder := 0;
          ONCLICK := @Control_Click;
        end;
      end;
    end;

    procedure FormGUI_SafeInit;
    var
      v: TVariantArray;
    begin
      SetLength(v, 0);
      ThreadSafeCall('FormGUI_Init', v);
    end;

    function FormGUI_ShowModal: Boolean;
    begin
      //Result := FormGUI.XFormGUI.ShowModal = mrOk;
      FormGUI.XFormGUI.SHOW;
      Result:= FormGUI.XFormGUI.Showing;
    end;

    function FormGUI_SafeShowModal: Boolean;
    var
      v: TVariantArray;
    begin
      SetLength(v, 0);
      Result := ThreadSafeCall('FormGUI_ShowModal', v);
      WriteINI('Changed', 'Changed', 'True', IncludePath + 'FormGUI.INI');
      WriteINI('SMART', 'SMART', 'y', IncludePath + 'FormGUI.INI');
    end;

    Procedure FreeFormGUI;
    begin
      FreeForm(FormGUI.XFormGUI);
    end;

    begin
      SetupSRL;

      FormGUI_SafeInit;
      FormGUI_SafeShowModal;
      AddOnTerminate('FreeFormGUI');

      Repeat
        writeln('Gold: ' + ToStr(GoldOption));
        writeln('Coal: ' + ToStr(CoalOption));
        Wait(1000);
      Until(False);
    end.
    I am Ggzz..
    Hackintosher

  17. #17
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    VERY nice work.

    Exiting stuff Brandon! Will test later on.

  18. #18
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Awesome job, Brandom.

    +Rep

  19. #19
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    Awesome job, Brandom.

    +Rep
    I just added Virtual Multi-threading to it via TTimers so that it auto attaches to Smart when the script Starts. Works quite well. Going to make it so that I can hide and show the form. Basically right now I have two forms on Smart.. one just acts as a button and the other is teh actual control panel..

    I click teh button, it hides the control panel. Click it again, it shows it. Exactly like how RSBot has those GUI's on it. Just happy that I can change script parameters and variables without actually stopping the script
    Last edited by Brandon; 06-24-2012 at 12:49 AM.
    I am Ggzz..
    Hackintosher

  20. #20
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Great Stuff, you could have a button that says TerminateScript and really just sets all players to inactive, then as long as you have somewhere in your script Repeat Until(AllPlayersInacive); then it will end, also for pausing you could just have a RunScript boolean, which would be set to false on pausing, then just have a while(not RunScript)do Wait(200); and it will effectively pause it

  21. #21
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Wow! I was needing this SO bad! Changing variables while the script was running, I thought it wasn't possible!

  22. #22
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    This is very nice

    Will try it sometime

  23. #23
    Join Date
    Jul 2008
    Location
    NSW, Australia
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

  24. #24
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    This is amazing Brandon, Just wondering would it be possible to have multiple tabs on the form?

  25. #25
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Ollybest View Post
    This is amazing Brandon, Just wondering would it be possible to have multiple tabs on the form?
    Yes it is possible see:

    Extension:
    PHP Code:
    program WindowHandles;

    type
      TCharArray 
    = Array of Char;

    var
      
    SimbaMenuFormGUITMenuItem;
      
    ExtensionsString;
      
    FormTitleBarNamePChar;



    function 
    FindWindow(ClassNameWindowNamePChar): HWNDexternal 'FindWindowA@User32.dll stdcall';

    function 
    SetParent(ChildParentHWND): HWNDexternal 'SetParent@User32.dll stdcall';

    function 
    SetWindowPos(HandleHandleAfterHWNDXYCXCYIntegerFlagsWord) : Booleanexternal 'SetWindowPos@User32.dll stdcall';

    function 
    FindSmartHWND;
    var
      
    SmartHWND;
    begin
      Smart
    := FindWindow('SunAwtFrame''');
      
    Result:= Smart;
    end;

    Procedure SetParentSmart(SenderTObject);
    var
      
    FormHandleSmartHandleHWND;
    begin
      FormTitleBarName
    := 'FormGUI';
      
    FormHandle:=  FindWindow(''FormTitleBarName);
      
    SmartHandle:= FindSmart;
      If ((
    SmartHandle <> 0) and (FormHandle <> 0)) then
      begin
          SetParent
    (FormHandleSmartHandle);
          
    SetWindowPos(FormHandle063455051281);
      
    end;

      
    FormTitleBarName:= 'FormBTN';
      
    FormHandle:= FindWindow(''FormTitleBarName);
      If ((
    SmartHandle <> 0) and (FormHandle <> 0)) then
      begin
          SetParent
    (FormHandleSmartHandle);
          
    SetWindowPos(FormHandle04763245051281);
      
    end;
    end;

    var
      
    ThreadTTimer;

    Procedure Thread_Init;
    begin
      Thread
    := TTimer.Create(nil);
      
    Thread.ONTIMER:= @SetParentSmart;
      
    Thread.INTERVAL:= 10000;
      
    Thread.ENABLED:= True;
    end;

    procedure Init;
    var
      
    LineTCharArray;
    begin
      SimbaMenu 
    := TMenuItem.Create(Simba_MainMenu);
      
    SimbaMenu.Caption := 'FormGUI';
      
    Simba_MainMenu.Items.Add(SimbaMenu);
      
    FormGUI := TMenuItem.Create(SimbaMenu);
      
    FormGUI.Caption := 'FormGUI';
      
    FormGUI.ShortCut := 123;
      
    FormGUI.OnClick := @SetParentSmart;
      
    SimbaMenu.Add(FormGUI);
      
    Thread_Init;
    end;

    function 
    GetName string;
    begin;
      
    result := 'FormGUI';
    end;

    function 
    GetVersion string;
    begin;
      
    result := '1.0';
    end;

    procedure Free;
    begin

    end
    ;

    procedure Attach;
    begin
      writeln
    ('       FormGUI By Ggzz       ');
      
    Writeln('#  FormGUI Simba Extension  #');
    end;

    Procedure Detach;
    begin
      writeln
    ('FormGUI: GoodBye!');
    end;

    begin
    end

    Simba Code:
    {$DEFINE SMART}
    {$I SRL/SRL.Simba}

    type
      TFormGUI = record
        FormGUI: TForm;
        FormBTN: TForm;
        pVisible: TButton;
        pTabButton: TButton;
        pControls: TGroupBox;
        pControlsTab: TGroupBox;
        pReports: TCheckBox;
        pExcalibur: TCheckBox;
        pSuperHeat: TCheckBox;
        pJustInCase: TCheckBox;
        pDownloadMaps: TCheckBox;
        pDeveloperControls: TPanel;
        pDeveloperLabel: TLabel;
        pDebug: TCheckBox;
        pSPSPosDebug: TCheckBox;
        pAnimationDebug: TCheckBox;
        pStatsUserLabel: TLabel;
        pStatsPassLabel: TLabel;
        pPlayerUserLabel: TLabel;
        pPlayerPassLabel: TLabel;
        pMethodsLabel: TLabel;
        pPouchSummonLabel: TLabel;
        pStatsUserEdit: TEdit;
        pStatsPassEdit: TEdit;
        pPlayerUserEdit: TEdit;
        pPlayerPassEdit: TEdit;
        pMethodsEdit: TEdit;
        pPouchSummonEdit: TEdit;
        pStart: TButton;
        pPause: TButton;
        pClose: TButton;
      end;

    var
      XFormGUI: TFormGUI;

    Procedure Form_ControlClicked(Sender: TObject);
    begin
      Case Sender Of
        XFormGUI.pClose:
                            begin
                              XFormGUI.FormGUI.Close;
                              XFormGUI.pVisible.Caption := 'Show';
                            end;

        XFormGUI.pVisible:
                            begin
                              XFormGUI.FormGUI.Visible := (Not XFormGUI.FormGUI.Visible);
                              if (XFormGUI.pVisible.Caption = 'Show') then
                                XFormGUI.pVisible.Caption := 'Hide'
                              else
                                XFormGUI.pVisible.Caption := 'Show';
                            end;

        XFormGUI.pTabButton:
                            begin
                              XFormGUI.pControls.Visible := (Not XFormGUI.pControls.Visible);
                              XFormGUI.pControlsTab.Visible := (Not XFormGUI.pControlsTab.Visible);
                            end;
        {
        XFormGUI.pReports: OnScreenProggy := XFormGUI.pReports.Checked;

        XFormGUI.pExcalibur: EnhancedExcalibur := XFormGUI.pExcalibur.Checked;

        XFormGUI.pSuperHeat: SFS := XFormGUI.pSuperHeat.Checked;

        XFormGUI.pJustInCase: JIC := XFormGUI.pJustInCase.Checked;

        XFormGUI.pDownloadMaps: DMP := XFormGUI.pDownloadMaps.Checked;

        XFormGUI.pDebug: Debug := XFormGUI.pDebug.Checked;

        XFormGUI.pAnimationDebug: AnimationDebug := XFormGUI.pAnimationDebug.Checked;

        XFormGUI.pSPSPosDebug: POSDebug := XFormGUI.pSPSPosDebug.Checked;

        XFormGUI.pStatsUserEdit:  SRLStats_Username := XFormGUI.pStatsUserEdit.Text;

        XFormGUI.pStatsPassEdit:  SRLStats_Password := XFormGUI.pStatsPassEdit.Text;

        XFormGUI.pPlayerUserEdit: Players[CurrentPlayer].Name := XFormGUI.pPlayerUserEdit.Text;

        XFormGUI.pPlayerPassEdit: Players[CurrentPlayer].Pass := XFormGUI.pPlayerPassEdit.Text;
        }

      end;
    end;

    procedure Form_EditControlKeyPressed(Sender: TObject; var Key: Char);
    begin
      {
      Case Sender Of
        XFormGUI.pMethodsEdit:
                                If (Key <> #8) and (Key <> '0') and (Key <> '1') and (Key <> '2') and (Key <> '3') and (Key <> '4') then
                                  Key := #0
                                else
                                  Method := StrToIntDef(XFormGUI.pMethodsEdit.Text, 0);
        XFormGUI.pPouchSummonEdit:
                                If (Key <> #8) and (Key <> '0') and (Key <> '1') and (Key <> '2') then
                                  Key := #0
                                else
                                  Method := StrToIntDef(XFormGUI.pPouchSummonEdit.Text, 0);
      end;
      }

    end;

    procedure FormGUI_Init;
    begin
      with XFormGUI do
      begin
        FormGUI := CreateForm;
        FormBTN := CreateForm;
        pVisible := TButton.Create(FormBTN);
        pTabButton := TButton.Create(FormGUI);
        pControls := TGroupBox.Create(FormGUI);
        pControlsTab := TGroupBox.Create(FormGUI);
        pReports := TCheckBox.Create(pControls);
        pExcalibur := TCheckBox.Create(pControls);
        pSuperHeat := TCheckBox.Create(pControls);
        pJustInCase := TCheckBox.Create(pControls);
        pDownloadMaps := TCheckBox.Create(pControls);
        pDeveloperControls := TPanel.Create(pControls);
        pDeveloperLabel := TLabel.Create(pDeveloperControls);
        pDebug := TCheckBox.Create(pDeveloperControls);
        pSPSPosDebug := TCheckBox.Create(pDeveloperControls);
        pAnimationDebug := TCheckBox.Create(pDeveloperControls);
        pStatsUserLabel := TLabel.Create(pControlsTab);
        pStatsPassLabel := TLabel.Create(pControlsTab);
        pPlayerUserLabel := TLabel.Create(pControlsTab);
        pPlayerPassLabel := TLabel.Create(pControlsTab);
        pMethodsLabel := TLabel.Create(pControlsTab);
        pPouchSummonLabel := TLabel.Create(pControlsTab);
        pStatsUserEdit := TEdit.Create(pControlsTab);
        pStatsPassEdit := TEdit.Create(pControlsTab);
        pPlayerUserEdit := TEdit.Create(pControlsTab);
        pPlayerPassEdit := TEdit.Create(pControlsTab);
        pMethodsEdit := TEdit.Create(pControlsTab);
        pPouchSummonEdit := TEdit.Create(pControlsTab);
        pStart := TButton.Create(pControls);
        pPause := TButton.Create(pControls);
        pClose := TButton.Create(FormGUI);
        with FormBTN do
        begin
          Left := 824;
          Top := 175;
          ActiveControl := pVisible;
          BorderStyle := bsNone;
          Caption := 'FormBTN';
          Name := 'FormBTN';
          ClientHeight := 14;
          ClientWidth := 35;
          Color := 15780518;      //clSkyBlue;
          DoubleBuffered := True;
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Tahoma';
          Font.Style := [];
          Position := poDesigned;
          PixelsPerInch := 96;
        end;
        with pVisible do
        begin
          Parent := FormBTN;
          Left := 0;
          Top := 0;
          Width := 35;
          Height := 14;
          Hint := 'Show/Hide';
          Caption := 'Hide';
          Font.Color := clBlack;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [fsBold];
          ParentFont := False;
          ParentShowHint := False;
          ShowHint := True;
          TabOrder := 1;
          OnClick := @Form_ControlClicked;
        end;
        with FormGUI do
        begin
          Left := 376;
          Top := 175;
          ActiveControl := pClose;
          BorderStyle := bsNone;
          Caption := 'FormGUI';
          ClientHeight := 128;
          ClientWidth := 505;
          Color := 15780518;      //clSkyBlue;
          DoubleBuffered := True;
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Tahoma';
          Font.Style := [];
          Position := poDesigned;
          PixelsPerInch := 96;
        end;
        with pControls do
        begin
          Parent := FormGUI;
          Left := 5;
          Top := 1;
          Width := 496;
          Height := 120;
          Caption := 'Control Panel';
          Font.Color := clPurple;
          Font.Height := -12;
          Font.Name := 'Courier New';
          Font.Style := [fsBold];
          ParentFont := False;
          ParentShowHint := False;
          ShowHint := True;
          TabOrder := 0;
        end;
        with pControlsTab do
        begin
          Parent := FormGUI;
          Left := 5;
          Top := 1;
          Width := 496;
          Height := 120;
          Caption := 'Control Panel';
          Font.Color := clPurple;
          Font.Height := -12;
          Font.Name := 'Courier New';
          Font.Style := [fsBold];
          ParentFont := False;
          ParentShowHint := False;
          ShowHint := True;
          TabOrder := 8;
        end;
        with pTabButton do
        begin
          Parent := FormGUI;
          Left := 234;
          Top := 0;
          Width := 75;
          Height := 14;
          Hint := 'Switch Tabs';
          Caption := 'Switch Tab';
          Font.Color := clBlack;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [fsBold];
          ParentFont := False;
          ParentShowHint := False;
          ShowHint := True;
          TabOrder := 2;
          OnClick := @Form_ControlClicked;
        end;
        with pReports do
        begin
          Parent := pControls;
          Left := 20;
          Top := 4;
          Width := 145;
          Height := 17;
          AllowGrayed := True;
          Caption := 'On Screen Reports';
          Hint := 'Show''s Reports On Screen';
          Color := clOlive;
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [];
          ShowHint := True;
          ParentColor := False;
          ParentFont := False;
          TabOrder := 0;
          OnClick := @Form_ControlClicked;
        end;
        with pExcalibur do
        begin
          Parent := pControls;
          Left := 195;
          Top := 4;
          Width := 147;
          Height := 17;
          Caption := 'Enhanced Excalibur';
          Hint := 'Uses Enhanced Excalibur To Heal';
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [];
          ShowHint := True;
          ParentFont := False;
          TabOrder := 1;
          OnClick := @Form_ControlClicked;
        end;
        with pSuperHeat do
        begin
          Parent := pControls;
          Left := 369;
          Top := 4;
          Width := 117;
          Height := 17;
          Caption := 'SuperHeat Ores';
          Hint := 'Super Heat Ores Using a Firestaff/Runes';
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [];
          ShowHint := True;
          ParentFont := False;
          TabOrder := 2;
          OnClick := @Form_ControlClicked;
        end;
        with pJustInCase do
        begin
          Parent := pControls;
          Left := 20;
          Top := 29;
          Width := 137;
          Height := 17;
          Caption := 'Drop Ores (J.I.C)';
          Hint := 'Drop Ores If Out Of Runes Or No FireStaff Found';
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [];
          ShowHint := True;
          ParentFont := False;
          TabOrder := 3;
          OnClick := @Form_ControlClicked;
        end;
        with pDownloadMaps do
        begin
          Parent := pControls;
          Left := 195;
          Top := 29;
          Width := 140;
          Height := 17;
          Caption := 'Download SPS Maps';
          Hint := 'Downloads Required SPS Maps If Not Found';
          Checked := True;
          Font.Color := clWindowText;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [];
          ShowHint := True;
          ParentFont := False;
          TabOrder := 4;
          OnClick := @Form_ControlClicked;
        end;
        with pDeveloperControls do
        begin
          Parent := pControls;
          Left := 3;
          Top := 52;
          Width := 339;
          Height := 47;
          TabOrder := 5;
        end;
        with pDeveloperLabel do
        begin
          Parent := pDeveloperControls;
          Left := 8;
          Top := 0;
          Width := 126;
          Height := 16;
          Caption := 'Developer Controls';
          Font.Color := clMaroon;
          Font.Height := -12;
          Font.Name := 'Courier New';
          Font.Style := [fsBold];
          ParentFont := False;
        end;
        with pDebug do
        begin
          Parent := pDeveloperControls;
          Left := 17;
          Top := 20;
          Width := 61;
          Height := 17;
          Caption := 'Debug';
          Hint := 'Display Debug Messages';
          Font.Color := clRed;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [];
          ShowHint := True;
          ParentFont := False;
          TabOrder := 0;
          OnClick := @Form_ControlClicked;
        end;
        with pSPSPosDebug do
        begin
          Parent := pDeveloperControls;
          Left := 86;
          Top := 20;
          Width := 113;
          Height := 17;
          Caption := 'SPS-Pos Debug';
          Hint := 'Debug SPS Your Position';
          Font.Color := clRed;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [];
          ShowHint := True;
          ParentFont := False;
          TabOrder := 1;
          OnClick := @Form_ControlClicked;
        end;
        with pAnimationDebug do
        begin
          Parent := pDeveloperControls;
          Left := 208;
          Top := 20;
          Width := 124;
          Height := 17;
          Caption := 'Animation Debug';
          Hint := 'Debug Player Animation';
          Font.Color := clRed;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [];
          ShowHint := True;
          ParentFont := False;
          TabOrder := 2;
          OnClick := @Form_ControlClicked;
        end;
        with pStatsUserLabel do
        begin
          Parent := pControlsTab;
          Left := 18;
          Top := 5;
          Width := 133;
          Height := 16;
          Caption := 'SRL-Stats UserName:';
        end;
        with pStatsPassLabel do
        begin
          Parent := pControlsTab;
          Left := 18;
          Top := 53;
          Width := 133;
          Height := 16;
          Caption := 'SRL-Stats Password:';
        end;
        with pPlayerUserLabel do
        begin
          Parent := pControlsTab;
          Left := 183;
          Top := 5;
          Width := 112;
          Height := 16;
          Caption := 'Player UserName:';
        end;
        with pPlayerPassLabel do
        begin
          Parent := pControlsTab;
          Left := 183;
          Top := 53;
          Width := 112;
          Height := 16;
          Caption := 'Player Password:';
        end;
        with pMethodsLabel do
        begin
          Parent := pControlsTab;
          Left := 344;
          Top := 5;
          Width := 112;
          Height := 16;
          Caption := 'Mining Method:';
        end;
        with pPouchSummonLabel do
        begin
          Parent := pControlsTab;
          Left := 344;
          Top := 53;
          Width := 112;
          Height := 16;
          Caption := 'Pouch To Summon:';
        end;
        with pStatsUserEdit do
        begin
          Parent := pControlsTab;
          Left := 18;
          Top := 21;
          Width := 133;
          Height := 20;
          PasswordChar := '*';
          Font.Color := clWindowText;
          TabOrder := 0;
          OnChange := @Form_ControlClicked;
        end;
        with pStatsPassEdit do
        begin
          Parent := pControlsTab;
          Left := 18;
          Top := 68;
          Width := 133;
          Height := 20;
          PasswordChar := '*';
          Font.Color := clWindowText;
          TabOrder := 1;
          OnChange := @Form_ControlClicked;
        end;
        with pPlayerUserEdit do
        begin
          Parent := pControlsTab;
          Left := 183;
          Top := 21;
          Width := 133;
          Height := 20;
          PasswordChar := '*';
          Font.Color := clWindowText;
          TabOrder := 2;
          OnChange := @Form_ControlClicked;
        end;
        with pPlayerPassEdit do
        begin
          Parent := pControlsTab;
          Left := 183;
          Top := 68;
          Width := 133;
          Height := 20;
          PasswordChar := '*';
          Font.Color := clWindowText;
          TabOrder := 3;
          OnChange := @Form_ControlClicked;
        end;
        with pMethodsEdit do
        begin
          Parent := pControlsTab;
          Left := 344;
          Top := 21;
          Width := 133;
          Font.Color := clWindowText;
          TabOrder := 4;
          OnKeyPress := @Form_EditControlKeyPressed;
        end;
        with pPouchSummonEdit do
        begin
          Parent := pControlsTab;
          Left := 344;
          Top := 68;
          Width := 133;
          Height := 20;
          Font.Color := clWindowText;
          TabOrder := 5;
          OnKeyPress := @Form_EditControlKeyPressed;
        end;
        with pStart do
        begin
          Parent := pControls;
          Left := 350;
          Top := 63;
          Width := 59;
          Height := 25;
          Caption := 'Start';
          Hint := 'Continue/UnPause The Script';
          ShowHint := True;
          TabOrder := 6;
        end;
        with pPause do
        begin
          Parent := pControls;
          Left := 425;
          Top := 63;
          Width := 59;
          Height := 25;
          Caption := 'Pause';
          Hint := 'Pauses The Script';
          ShowHint := True;
          TabOrder := 7;
        end;
        with pClose do
        begin
          Parent := FormGUI;
          Left := 482;
          Top := 0;
          Width := 23;
          Height := 21;
          Hint := 'Close';
          Caption := 'X';
          Font.Color := clBlack;
          Font.Height := -11;
          Font.Name := 'Courier New';
          Font.Style := [fsBold];
          ParentFont := False;
          ParentShowHint := False;
          ShowHint := True;
          TabOrder := 1;
          OnClick := @Form_ControlClicked;
        end;
      end;
    end;

    procedure FormGUI_SafeInit;
    var
      v: TVariantArray;
    begin
      SetLength(v, 0);
      ThreadSafeCall('FormGUI_Init', v);
    end;

    function FormGUI_Show: Boolean;
    begin
      //Result := XFormGUI.FormGUI.ShowModal = mrOk;
      XFormGUI.FormGUI.Show;
      XFormGUI.FormBTN.Show;
      XFormGUI.pControlsTab.Visible := False;
      Result:= XFormGUI.FormGUI.Showing and XFormGUI.FormBTN.Showing;
    end;

    function FormGUI_SafeShow: Boolean;
    var
      v: TVariantArray;
    begin
      SetLength(v, 0);
      Result := ThreadSafeCall('FormGUI_Show', v);
    end;

    Procedure FreeFormGUI;
    begin
      FreeForm(XFormGUI.FormGUI);
      FreeForm(XFormGUI.FormBTN);
    end;

    begin
      Smart_Server:= 72;
      Smart_Members:= True;
      Smart_Signed:= True;
      Smart_SuperDetail:= True;

      SetupSRL;
      FormGUI_SafeInit;
      FormGUI_SafeShow;
      AddOnTerminate('FreeFormGUI');

      Wait(25000);
    end.
    I am Ggzz..
    Hackintosher

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •