Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

123
LINES

< > BotCompany Repo | #1033860 // Gazelle 22 Standalone [dev version]

JavaX source code (desktop) [tags: jar-with-libs jar-with-x30 standalone use-pretranspiled use-starter]

Download Jar. Uses 11812K of libraries. Click here for Pure Java version (68770L/357K).

1  
// WELCOME!! This is THE PROGRAM YOU ARE LOOKING FOR.
2  
3  
!7
4  
5  
//please include function scpLS.
6  
7  
//lib 1400562 // Starter
8  
//lib 1400589 // Starter
9  
lib 1400594 // Starter
10  
11  
//set flag OtherLoadableUtils. lib 1033861
12  
13  
// INCLUDE THE MAIN MODULE
14  
!include early #1033862 // Gazelle Screen Cam [dev version]
15  
replace MainModule with GazelleScreenCam.
16  
17  
!include early #1033891 // include GazelleHost early for flags like PingV3
18  
19  
!include early #1034876 // Gazelle 22 Flags [Include]
20  
21  
//set flag InCore.
22  
23  
sS windowTitle = "Gazelle 22";
24  
sS progIDForDBAndAutoUpdate = #1033860;
25  
sbool pingSourceStrictMode;
26  
27  
static GazelleHost host;
28  
static ThreadPool threadPool;
29  
30  
sS devTitleSuffix = "";//" dev";
31  
32  
p {
33  
  godMode();
34  
  
35  
  //loadableUtils.utils.__setJavaX(main.class);
36  
  loadableUtils.utils.__setJavaX(x30.class);
37  
  standaloneInit();
38  
  
39  
  ping_v3_setPingSourceMaker(-> {
40  
    //System.out.println("pingSourceMaker");
41  
    if (pingSourceStrictMode)
42  
      fail("Strict mode - make a ping source first!!");
43  
    ret new PingSource(threadPool, "legacy");
44  
  });
45  
  
46  
  threadPool = new ThreadPool(findIntArg cores(args, numberOfCores()));
47  
  print(threadPool);
48  
  //threadPool.verbose = true;
49  
  PingSource ps = new(threadPool, print("Starting Gazelle"));
50  
  ps.do(-> {
51  
    System.out.println("Pinging");
52  
    ping();
53  
    //if (true) fail("error test");
54  
  
55  
    print("Pinged");
56  
    
57  
    programID = progIDForDBAndAutoUpdate;
58  
    
59  
    AutoVMExit.install();
60  
    
61  
    print("AutoVMExit installed");
62  
    
63  
    addGlobalLastErrorsBufferToDefaultPCallPolicy();
64  
    
65  
    print("Recording global errors");
66  
    
67  
    // patch utils.preferredScreen
68  
    
69  
    preferredScreen = -> {
70  
      if (host == null) ret 0;
71  
      int screen = max(0, screenNrOfWindow(mainWindow()));
72  
      ret screen;
73  
    };
74  
    
75  
    // patch utils.showForm_makeFrame to use JDialog
76  
    // (to avoid dialogs being hidden behind always-on-top window)
77  
    
78  
    showForm_makeFrame = (title, panel) -> {
79  
      var dialog = new JDialog(mainWindow(), title);
80  
      setDialogContents(dialog, withMargin(panel));
81  
      packWindow(dialog);
82  
      minWindowWidth(dialog, 400);
83  
      centerDialogOverOwner(dialog);
84  
      dialog.setVisible(true);
85  
      //setBounds(dialog, defaultNewFrameBounds());
86  
    };
87  
    
88  
    if (cic(args, "delete-session")) {
89  
      print("Deleting session (" + programDir(programID) + ")");
90  
      clearConceptsOf(programID);
91  
    }
92  
    
93  
    // migrate classes for legacy databases
94  
    F1<S, Class> baseClassFinder = cast _defaultClassFinder();
95  
    setDefaultClassFinder(func(S name) -> Class {
96  
      name = replacePrefix("loadableUtils.utils$", "main$", name);
97  
      //print("G22 class finder: " + name);
98  
      
99  
      if (eq(name, "main$Challenge")) {
100  
        print("Legacy Challenge converted!");
101  
        ret Challenge;
102  
      }
103  
        
104  
      ret baseClassFinder.get(name);
105  
    });
106  
    
107  
    host = new GazelleHost(threadPool, -> new MainModule);
108  
    if (sameSnippetID(programID, #1033860))
109  
      windowTitle += devTitleSuffix;
110  
    host.windowTitle = windowTitle;
111  
    host.run(args);
112  
    
113  
    if (!cic(args, "console")) {
114  
      print("Stopping System.out");
115  
      printAlsoToSystemOut = false;
116  
    }
117  
  });
118  
  print("aha.");
119  
}
120  
121  
static Window mainWindow() { ret host.mainWindow(); }
122  
123  
static Map generalMap = syncMap();

Author comment

Began life as a copy of #1033636

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, iveijnkanddl, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, wnsclhtenguj, xeobevbjagfg

No comments. add comment

Snippet ID: #1033860
Snippet name: Gazelle 22 Standalone [dev version]
Eternal ID of this version: #1033860/57
Text MD5: 34043fbe147f058f976b0af94f579f2e
Transpilation MD5: 337eae102540289325f81e2fe47b1a49
Author: stefan
Category: javax / screen recognition
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-11 14:00:31
Source code size: 3372 bytes / 123 lines
Pitched / IR pitched: No / No
Views / Downloads: 1347 / 60484
Version history: 56 change(s)
Referenced in: [show references]