Author Topic: Why wont this make a visable modal?  (Read 147 times)

Offline Jefffan3

  • Leecher
  • Posts: 3
  • Rep: 0
    • View Profile
Why wont this make a visable modal?
« on: January 20, 2012, 10:02:39 pm »
Can anyone help me with this?

Code: [Select]
Program TPPCBot;

var
  Main : TForm;
  Custom_TPPC_Bot : TLabel;
  Button1 : TButton;
  Button2 : TButton;
  Button3 : TButton;
  ENDBUTTON:Integer;

var x,y,AttackTPPC:Integer;
v,z,ContinueTPPC:Integer;
a,b,ReBaTPPC1:Integer;
c,d,ReBaTPPC2:Integer;
e,f,cnp:Integer;

Procedure LoadBMP;
begin
AttackTPPC := BitmapFromString(87, 24, 'beNrtlksOwCAIBQ/l/c' +
       '9GFyaNAaQ2rVaamZ0fCDyBWAoAAADAYkRkkp+3PK8X4VzeTSGvCDX' +
       'ONlpEEIPaV7bqzkMZP2+EwRTc01ZJ1+c/RHBrw3rrjZfNRQiyCx49' +
       'mAC5KuEyi3EReoYZvwdxMdjZGDSIrQoAAACYyAFPobdc');
ContinueTPPC := BitmapFromString(107, 24, 'beNrtltEOgCAIRT/' +
       'K//82e2htpoCFsWme88SwObh6w5QAAAAAANzki8FNtlVvRIQ43cSd' +
       'Zzumtp63FYZ2JPpi3CzRp6z5+ozLZPlNmWzbNOKuIDNfRa0Msd9KO' +
       'iMwVrvJtTR8K6CRdGiV7/zjBlZ+jBZw9X+gu1+3gKLBn4+zOR9Loo' +
       'm0IaLFXVnacfPVExQAAABgOw6hViei');
ReBaTPPC1 := BitmapFromString(89, 13, 'beNrtVlsOwCAI8/6H3RW' +
       '2vyXDUsvjw2Qav1AQaouOa4zPvHcaJrd6ejyCWa0cl/MlXvOScgSp' +
       '6EDRBQUk50xayGRoee2elw7FMg0iMWiJQurtUUJBVHO9IpEG3MON/' +
       'FK85BX6hTif27yEgtRF+Ondi85n41uEYi7N0yCHAtYVYgWsNKS1Ri' +
       'jSAhFZrffbkNbaoSBxuqBQeKJcB2z1jb3Ci1/p/CE9cqN5oaASveP' +
       'EZkVeUvJQhko4Q/mT/GU+reK5wg==');
ReBaTPPC2 := BitmapFromString(89, 13, 'beNrtVlsOwCAIu4f32ql' +
       '26O1vybDU8vhYMo1fKAi1Rcd5jNe8vjRMbvX0eASzWjku50u85iXl' +
       'CFLRhqILCkjOmbSQydDy2D0vHYplGkRi0BKF1NujhIKo5npFIg24h' +
       'xv5pXjJK/QLcT63eQkFqYvw07sXnc/GtwjFXJqnQQ4FrCvEClhpSG' +
       'uNUKQFIrJa77chrbVDQeJ0QaHwRLkO2Oobe4UXv9L5Q3rkRvNCQSV' +
       '6x4nNiryk5KEMlbCH8if5y7wBmpPJ+g==');
cnp := BitmapFromString(218, 13, 'beNrtmFEPwyAIhP/6/nmX7KFZ' +
       'phwHXDtN4WkzFU/9BPE42tq2sNfHnjNub/E6kr6tadwUIWsr11zq6' +
       'eg/jeffpnFTGvmV3JRG67iNjaCFOdGjAMtVqJ0UY6UGJndM9Vv+GW' +
       'HT3zj0ARrdKeDtHruTu+B+H6URaMYAg75AEp6OG8NVYorjAv/uurn' +
       'LHo2NlS1OfAAgjPLAS2WSe5rGHHVCMcJxE2kIRHI5jW5ErdMY3QIm' +
       'xrrR2zoLfHIR0pgQ42bMS2kk2UtUMWTgAk5uphEsHR9GEqXQpTQm6' +
       'rI/0siICfkPnQL+OqeiMTeF0SGQxPS9LVNHxTCVKa7yVJlUcm+UXM' +
       'ZWi434EOFMXampycJQWFO7hRXwX6GRr6mteUWTeK6mFr489FNev3a' +
       '2NY1tlL0Bpxag7A==');
end;

procedure StartClick(sender: TObject);
begin
  ENDBUTTON:= 0;
  repeat
    if(FindBitMap(ReBaTPPC1, a, b))then
     begin
      ;wait(100 + random(60))
      MoveMouse((a + 5), (b + 5));
      ;wait(100 + random(60))
      ClickMouse((a + 5), (b + 5),true);
     end else
      ;wait(100 + random(60))

    if(FindBitMap(ReBaTPPC2, c, d))then
     begin
      ;wait(100 + random(60))
      MoveMouse((c + 5), (d + 5));
      ;wait(100 + random(60))
      ClickMouse((c + 5), (d + 5),true);
     end else
      ;wait(100 + random(60))

    if(FindBitMap(ContinueTPPC, v, z))then
     begin
      ;wait(100 + random(60))
      MoveMouse((v + 5), (z + 5));
      ;wait(100 + random(60))
      ClickMouse((v + 5), (z + 5),true);
     end else
      ;wait(100 + random(60))

    if(FindBitMap(cnp, e, f))then
     begin
      ;wait(100 + random(60))
      KeyDown(116);
      ;wait(100 + random(60))
      KeyUp(116);
     end else
      ;wait(100 + random(60))

    if(FindBitMap(AttackTPPC, x, y))then
     begin
      ;wait(100 + random(60))
      MoveMouse((x + 10), (y + 5));              // Moves mouse to X,Y coordinate
      ;wait(100 + random(60))
      ClickMouse((x + 10), (y + 5),true);        // Click mouse at X,Y coordinate
     end else
      ;wait(100 + random(60))

    LoadBMP;
    until(ENDBUTTON=1)
end;

procedure EndClick(sender: TObject);
begin
ENDBUTTON := 1;
end;

procedure CloseClick(sender: TObject);
begin
Main.ModalResult:= mrOk;
end;

procedure IntForm;
begin
Main := CreateForm;
Main.Left := 250;
Main.Top := 114;
Main.Width := 239;
Main.Height := 209;
Main.Caption := 'TPPCRPG.net Bot';
Main.Color := clBtnFace;
Main.Font.Color := clWindowText;
Main.Font.Height := -11;
Main.Font.Name := 'MS Sans Serif';
Main.Font.Style := [];
Main.Visible := True;
Main.PixelsPerInch := 96;
Custom_TPPC_Bot := TLabel.Create(Main);
Custom_TPPC_Bot.Parent := Main;
Custom_TPPC_Bot.Left := 9;
Custom_TPPC_Bot.Top := 8;
Custom_TPPC_Bot.Width := 208;
Custom_TPPC_Bot.Height := 33;
Custom_TPPC_Bot.Alignment := taCenter;
Custom_TPPC_Bot.AutoSize := False;
Custom_TPPC_Bot.Caption := 'Custom TPPC Bot';
Custom_TPPC_Bot.Font.Color := clWindowText;
Custom_TPPC_Bot.Font.Height := -21;
Custom_TPPC_Bot.Font.Name := 'Papyrus';
Custom_TPPC_Bot.Font.Style := [];
Custom_TPPC_Bot.ParentFont := False;
Button1 := TButton.Create(Main);
Button1.OnClick:= @StartClick;
Button1.Parent := Main;
Button1.Left := 8;
Button1.Top := 56;
Button1.Width := 209;
Button1.Height := 33;
Button1.Caption := 'Start';
Button1.TabOrder := 8;
Button2 := TButton.Create(Main);
Button2.OnClick:= @EndClick;
Button2.Parent := Main;
Button2.Left := 8;
Button2.Top := 96;
Button2.Width := 209;
Button2.Height := 33;
Button2.Caption := 'Stop';
Button2.TabOrder := 9;
Button3 := TButton.Create(Main);
Button3.OnClick:= @CloseClick;
Button3.Parent := Main;
Button3.Left := 8;
Button3.Top := 136;
Button3.Width := 209;
Button3.Height := 33;
Button3.Caption := 'Exit';
Button3.TabOrder := 10;
end;

procedure SafeInitForm;
var
  v: TVariantArray;
begin
  setarraylength(V, 0);
  ThreadSafeCall('IntForm', v);
end;

procedure ShowFormModal;
begin
  Main.ShowModal;
end;

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

begin
  ENDBUTTON:=1;
  SafeInitForm;
  SafeShowFormModal;
end.

Freddy1990.com

Why wont this make a visable modal?
« on: January 20, 2012, 10:02:39 pm »

Offline Freddy

  • Owner
  • *****
  • Posts: 2616
  • Rep: 19
    • MSN Messenger - freddy1990@gmail.com
    • AOL Instant Messenger - Freddy199O
    • View Profile
    • Email
Re: Why wont this make a visable modal?
« Reply #1 on: January 24, 2012, 11:48:40 am »
Make sure you're using the latest copy of SCAR: http://www.scar-divi.com/

Also, ask questions on http://forums.scar-divi.com, you'll get a much faster reply.

It seems your problem is that you set Main to visible. If you set Main.Visible to False in IntForm, it will work.
« Last Edit: January 24, 2012, 11:56:21 am by Freddy »

Freddy1990.com

Re: Why wont this make a visable modal?
« Reply #1 on: January 24, 2012, 11:48:40 am »