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

29
LINES

< > BotCompany Repo | #1025036 // Discord Fan [shortened 2]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1319K of libraries. Click here for Pure Java version (13600L/75K).

!7

cmodule DiscordFan > DynVisualBot {
  switchable double patience = 1.0;
  switchable double waitBeforeClick = 1.0;
  transient WaitForStableValue<Rect> wait = new(patience);
  
  // What are we looking for?
  void makeProtos {
    protoTexts("Open", "Open discord");
  }

  // How do we find it?
  ISegmenter makeSegmenter() {
    ret segmenterFromAGIBlue("Find things on discordapp.com #1");
  }
  
  // What do we do when we found it?
  void think {
    if (!enabled) ret;
    ImageInfo info = latestWithAOA, ret if null;
    //print("Keys", sfu(keys(info.foundProtos)));
    Rect r = print('r, rect(mapGet(info.foundProtos, quote("Open discord"))));
    dm_moveMouseAndClick(wait.setAndClear(r), "Discord button", +waitBeforeClick);
  }
  
  // Heart beat!
  void started { doEvery(1.0, rEnter think); }
}

Author comment

Began life as a copy of #1025026

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025036
Snippet name: Discord Fan [shortened 2]
Eternal ID of this version: #1025036/14
Text MD5: 362910c5aedbe735271a2e67ea4e503a
Transpilation MD5: 8d52ea18997abcdb89982e4fd35f5fd7
Author: stefan
Category: javax / visual bots
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-01 22:33:09
Source code size: 840 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 223 / 786
Version history: 13 change(s)
Referenced in: [show references]