Results 1 to 4 of 4

Thread: GUI Not working at all

  1. #1
    Join Date
    Mar 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Question GUI Not working at all

    Hey everyone,

    Having a bit of trouble with this script. I'm not getting any errors, the GUI pops up and whenever 'Start' is clicked absolutely nothing happens.
    If I then close the GUI, SMART will proceed to load and open but the script will not start.

    program RandFletcher;
    {$DEFINE SMART8}
    {$I SRL/SRL.Simba}
    {$I SRL/SRL/Misc/Debug.Simba}
    {$I P07Include.Simba}
    var
    x, y, bankcolour,inventoryCounter, LogCounter: Integer;
    DsgnForm:TForm;
    TLabel2,TLabel3,TLabel5, TLabel6: TLabel;
    TEdit0,TEdit1: TEdit;
    TButton6: TButton;
    TComboBox4, TComboBox5: TComboBox;
    const
    default = 'Comic Sans MS';

    procedure ReadyTheScript(Sender: TObject);
    begin
    P07_PlayerName := TEdit0.TEXT
    P07_PlayerPass := TEdit1.TEXT
    end;
    procedure BowType;
    begin
    case TComboBox5.ITEMINDEX of
    0: MMouse(262,403,5,5);
    1: MMouse(100,415,5,5);
    end;
    end;

    procedure InitForm;
    begin
    //DsgnForm\\
    DsgnForm:=TForm.Create(nil);
    with DsgnForm do
    begin
    Caption:='RandFletcher by Rand from VillaVu';
    Left:=479;
    Top:=218;
    Width:=200;
    Height:=150;
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    end;
    //TLabel2\\
    TLabel2:=TLabel.Create(DsgnForm);
    with TLabel2 do
    begin
    Parent:=DsgnForm;
    Caption:='Username';
    Left:=7;
    Top:=12;
    Width:=42;
    Height:=16;
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    end;
    //TLabel3\\
    TLabel3:=TLabel.Create(DsgnForm);
    with TLabel3 do
    begin
    Parent:=DsgnForm;
    Caption:='Password';
    Left:=7;
    Top:=38;
    Width:=42;
    Height:=16;
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    end;
    //TLabel5\\
    TLabel5:=TLabel.Create(DsgnForm);
    with TLabel5 do
    begin
    Parent:=DsgnForm;
    Caption:='Bank: ';
    Left:=7;
    Top:=64;
    Width:=42;
    Height:=16;
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    end;
    //TLabel6\\
    TLabel6:=TLabel.Create(DsgnForm);
    with TLabel6 do
    begin
    Parent:=DsgnForm;
    Caption:='Bow Type:';
    Left:=7;
    Top:=90;
    Width:=42;
    Height:=16;
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    end;
    //TEdit0\\
    TEdit0:=TEdit.Create(DsgnForm);
    with TEdit0 do
    begin
    Parent:=DsgnForm;
    Text:='';
    Left:=70;
    Top:=9;
    Width:=80;
    Height:=23;
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    TEdit0.MaxLength:=30;
    //TEdit0.PasswordChar:=*;
    end;
    //TEdit1\\
    TEdit1:=TEdit.Create(DsgnForm);
    with TEdit1 do
    begin
    Parent:=DsgnForm;
    Text:='';
    Left:=70;
    Top:=36;
    Width:=80;
    Height:=23;
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    TEdit1.MaxLength:=21;
    TEdit1.PasswordChar:='*';
    end;
    //TButton6\\
    TButton6:=TButton.Create(DsgnForm);
    with TButton6 do
    begin
    Parent:=DsgnForm;
    Caption:='Start';
    Left:=70;
    Top:=120;
    Width:=75;
    Height:=25;
    OnClick:= @ReadyTheScript;
    Font.Color:= clDefault;
    Font.Size:=9;
    end;
    //TComboBox4\\
    TComboBox4:=TComboBox.Create(DsgnForm);
    with TComboBox4 do
    begin
    Parent:=DsgnForm;
    Left:=70;
    Top:=62;
    Width:=100;
    Height:=23;
    //add your items here
    Items.Add('Catherby');
    Items.Add('Draynor');
    Items.Add('Varrock East');
    //End items
    Text := Items[0];
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    end;
    //TComboBox5\\
    TComboBox5:=TComboBox.Create(DsgnForm);
    with TComboBox5 do
    begin
    Parent:=DsgnForm;
    Left:=70;
    Top:=88;
    Width:=100;
    Height:=23;
    //add your items here
    Items.Add('Longbows');
    Items.Add('Shortbows');
    //End items
    Text := Items[0];
    Font.Name:=default;
    Font.Color:=clDefault;
    Font.Size:=9;
    end;
    end;
    procedure SafeInitForm;
    var
    v: TVariantArray;
    begin
    setarraylength(V, 0);
    ThreadSafeCall('InitForm', v);
    end;


    procedure ShowFormModal;
    begin
    DsgnForm.ShowModal;
    end;


    procedure SafeShowFormModal;
    var
    v: TVariantArray;
    begin
    SetArrayLength(V, 0);
    ThreadSafeCall('ShowFormModal', v);
    end;
    function chooseBank: Boolean;
    begin
    Result := True;
    case TComboBox4.ITEMINDEX of
    0: bankcolour:= 2842746;
    1: bankcolour:= 3684412;
    2: bankcolour:= 2640470;
    end;
    end;
    procedure openingBank;
    begin
    P07_MakeCameraAngleHigh;
    P07_MakeCompassNorth;
    Writeln('Opening the bank');
    if P07_FindObj(x,y,'Use', bankcolour, 5) then
    begin
    repeat
    ClickMouse2(mouse_right);
    wait(randomrange(50, 150));
    P07_ChooseOptionMulti(['se-q']);
    wait(randomrange(500, 800));
    until (P07_bankscreen);
    end;
    end;

    procedure withdrawingFromBank;
    begin
    if (P07_bankscreen) then
    begin
    repeat
    P07_Deposit(3,28,True);
    Writeln('Banking Inventory');
    until (P07_InvCount < 2);
    end;
    Writeln('Withdrawing logs');
    MMouse(94,80, 5, 5);
    wait(randomrange(50,100));
    Clickmouse2(mouse_right);
    wait(randomrange(400,700));
    P07_chooseOptionMulti(['All']);
    wait(randomrange(800,1200));
    if (P07_InvCount < 28) then repeat
    P07_Deposit(3,28,True);
    Writeln('Failsafe activated. Rebanking items.');
    until (P07_InvCount < 2);
    if (P07_InvCount = 1) then repeat
    MMouse(94,80, 5, 5);
    wait (randomrange(50,100));
    Clickmouse2(mouse_right);
    wait(randomrange(400,700));
    P07_chooseOptionMulti(['All']);
    wait(randomrange(800,1200));
    until (P07_InvCount = 28);

    MMouse(484,40,4,5);
    wait(randomrange(50,100));
    ClickMouse2(Mouse_Left);
    end;

    procedure Fletching;
    begin
    case random(3) of
    0: begin
    MMouse(580,225,5,5);
    wait(randomrange(40,100));
    Clickmouse2(mouse_left);
    wait(randomrange(40,100));
    MMouse(620,225,5,5);
    wait(randomRange(40,100));
    Clickmouse2(mouse_left);
    wait(randomrange(40,100));
    end;
    1: begin
    MMouse(620,225,5,5);
    wait(randomrange(40,100));
    Clickmouse2(mouse_left);
    wait(randomrange(40,100));
    MMouse(580,225,5,5);
    wait(randomRange(40,100));
    Clickmouse2(mouse_left);
    wait(randomrange(40,100));
    end;
    2: begin
    MMouse(580,262,5,5);
    wait(randomrange(40,100));
    Clickmouse2(mouse_left);
    wait(randomrange(40,100));
    MMouse(580,225,5,5);
    wait(randomRange(40,100));
    Clickmouse2(mouse_left);
    wait(randomrange(40,100));
    end;
    3: begin
    MMouse(580,225,5,5);
    wait(randomrange(40,100));
    Clickmouse2(mouse_left);
    wait(randomrange(40,100));
    MMouse(580,262,5,5);
    wait(randomRange(40,100));
    Clickmouse2(mouse_left);
    wait(randomrange(40,100));
    end;
    end;
    wait(randomrange(100,200));
    BowType;
    wait(randomrange(70,150));
    Clickmouse2(mouse_right);
    wait(randomrange(800,900));
    P07_chooseOptionMulti(['X']);
    wait(randomrange(900,1200));
    TypeSendEx('27', True);
    wait(randomrange(48432,51130));
    LogCounter:= LogCounter + 27;
    inventoryCounter:= inventoryCounter + 1;
    Writeln('Amount of Inventorys Fletched: ' + IntToStr(inventoryCounter) + '(' + IntToStr(logCounter) + ' logs).')
    end;


    begin
    SafeInitForm;
    SafeShowFormModal;
    SetUpSRL;
    SetUpP07Include;
    chooseBank;
    TerminateScript;
    Writeln('Welcome to RandFletcher, hope you enjoy.');
    Writeln('Any bugs please report back to my thread, thank you.');
    if (not P07_LoggedIn) then
    begin
    P07_LogInPlayer;
    end;
    wait(randomrange(1000,2000));
    repeat
    openingBank;
    withdrawingFromBank;
    Fletching;
    until (not P07_LoggedIn); //<== ANTILEACH PUT A 'NOT' IN THERE SOMEWHERE!!!
    TerminateScript;
    end.
    Ahead of time, thank you for your help.

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    remove TerminateScript; above the writeln
    Working on: Tithe Farmer

  3. #3
    Join Date
    Mar 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    remove TerminateScript; above the writeln
    Well.. Start still isn't doing anything after removing it.

    34 views and only one person replied. ..
    Last edited by Simbarules; 03-14-2013 at 04:39 PM.

  4. #4
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Maybe ask it on the script thread. Also make sure you read post of the first three and last three pages. Maybe the answer is there.
    Working on: Tithe Farmer

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
  •