Results 1 to 12 of 12

Thread: Rucoy Online Xposed Module bot source

  1. #1
    Join Date
    Aug 2017
    Posts
    23
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default Rucoy Online Xposed Module bot source

    Alright, I'm sure the amount of people that can get this working will be fairly slim, but I guess I'll just go for it.

    Here is an Android Studio project containing a bot for Rucoy Online
    https://ufile.io/g9trk

    requirements:
    Android Studio: https://developer.android.com/studio...0aAkYAEALw_wcB

    Android emulator...Or Android device(I highly suggest GenyMotion, the trial is fine 'for personal use' : https://www.genymotion.com/

    device rooted+superSU(figure out root and superSU yourself, however Genymotion comes rooted with superSU)+ Xposed Framework v88 or higher:
    https://forum.xda-developers.com/sho....php?t=3034811 (download the attachment, don't follow the links, the installer will download the highest version of Xposed Framework that your emulator/phone supports)


    That's all the info I'm going to provide for the moment, however this will probably go completely unsupported by myself in less than a week due to upcoming events.

    Let me know if you have any problems with the Android Studio project, I've never tried to zip one before.
    Last edited by JimmyJay; 11-23-2017 at 05:19 PM.

  2. #2
    Join Date
    Aug 2017
    Posts
    23
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    Scripting functions:
    Code:
    as stated
    Thing[] getNpcArray() 
    
    as stated
    Thing[] getPlayerArray()
    
    
    Returns 0-4 with how many items are adjacent to you
    int getSurroundingItemCount()
    
    returns an int array of IIRC 14, index 0 being amount of gold, the rest is Item ID's of your worn equipment, I haven't worked it out for what corresponds to which worn slot yet
    int[] getWornEquipment()
    
    
    returns an int[200][2] of your inventory, ex: getInventory()[4][0] is item index 4 item ID, and getInventory()[4][1] is item index 4 quantity
    int[][] getInventory()
    
    as stated
    boolean hasHealthPotions()
    
    weather or not you have item ID in your inventory
    boolean hasItem(int item)
    
    Used only for ground item ID's, doesn't work with inventory items... I wouldn't try using this tbh
    Thing getItemInfo(int id)
    
    no longer needed, getNpcArray() uses this and returns correct info
    Thing getNpcInfo(int id)
    
    returns the ID of what your currently interacting with, 0 means nothing
    int getInteractingID()
    
    was used only for testing, i think it currently dumps your HP
    void dumpthings()
    
    as stated
    boolean inCombat() 
    
    distance between coords
    int dist(int x1,int y1,int x2,int y2)
    
    returns your current HP
    int getHP()
    
    returns your max HP
    int getMaxHP()
    
    walks to coords
    walk(short x,short y)
    
    uses mana or health potion, ID's for mana are 2,110,111, and health potion ID's are 1,104,105
    ManaOrHeal(int item)
    
    attack NPC
    void attack(int NPCID)
    
    takes an adjacent item
    void takeNearItem()
    
    returns your X coordinant
    int getX()
    
    returns your Y coordinant
    int getY()
    
    returns your Z coordiant(0 = top world, 1 is 1 floor down, etc)
    int getZ()
    
    weather or not your moving, however if your 'stuck' this could still return true
    boolean isMoving()
    
    is something on screen, could be an item, NPC, or player
    boolean isThingOnScreen(Thing t)
    
    are coordinants on screen
     boolean coordOnScreen(int tx,int ty)
    
    as stated
    int random(int min,int max)
    
    returns the closest NPC, does not account for walking around objects
    Thing getClosestNPC(int[] types)
    
    Uses A* path finding algorithm to find actual distance, int Map is the Z coordinant(maps are not complete, this will only work in supported areas
    AStar.findPath(int x, int y, int x2, int y2, int Map)
    ^It appears I never added a sleep function, and did this inside of the scripts that I created... So implement this in your scripts yourself

    Thing class(can be NPC/Player/Item)
    Code:
        Short xcoord = -1;
        Short ycoord = -1;
        int ThingID = -1;
        String name = "";
        int npcid = -1;
        int type = -1;
        int level = -1;
        int HP = -1;
        int levelxp = -1;
        int meleexp = -1;//not used
        int distancexp = -1;//not used
        int magicxp = -1;//not used
        int defensexp = -1;//not used
        int distance = -1;//only used in the Assassin Fighter script
    example of the above^ getNpcArray()[0].xcoord is the first NPC's x coordinant.

    script layout:
    Code:
    package lesroberts.bridge;
    import de.robv.android.xposed.XposedBridge;
    
    public class YourScript extends ScriptEngine implements Runnable {
        boolean running = true;
    
        public YourScript() {
    
        }
        public void stop() {
            running = false;
        }
    
        public void run() {
            while(running) {
                   //do your script stuff...
            }
        }
    }
    dynamic script loading has not been implemented, you will need to go in and manually add an instance of your script to ScriptEngine, including adding it to startScript/stopScript
    Last edited by JimmyJay; 11-23-2017 at 01:46 PM.

  3. #3
    Join Date
    Aug 2017
    Posts
    23
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    If you would like to make the A* path finding algorithm work in more areas, here are the Simba scripts I used for creating the maps

    Use BlueStacks emulator, and Cheat engine to find your X coord, then set up the PID and X coord vars(in decimal format... use windows programmer calc for conversion)

    Download bothelper.dll from this thread: https://villavu.com/forum/showthread.php?t=99380

    Code:
    {$loadlib bothelper.dll}
    var
    x,y,z,mapx,mapy,map,timer,processid : Integer;
    xaddy,yaddy,zaddy : Integer;
    
    function getMyX() : integer;
    begin
    result := ReadMemoryFromPID(processid,xaddy,4);
    end;
    function getMyY() : integer;
    begin
    result := ReadMemoryFromPID(processid,yaddy,4);
    end;
    function getMyZ() : integer;
    begin
    result := ReadMemoryFromPID(processid,zaddy,4);
    end;
    
    
    
    begin
    
    processid := 7972;
    xaddy := 4188507904;//1435958552
    yaddy := xaddy + 24; //1435958576
    zaddy := xaddy + 48; //1435958600
    
    
    if(FileExists('C:\Simba\Rucoy\map'+inttostr(getMyZ()) + '.bmp')) then
    map:= LoadBitmap('C:\Simba\Rucoy\map'+inttostr(getMyZ()) + '.bmp')
    else
    map := CreateBitmap(1000,1000);
    
    getBitmapSize(map,mapx,mapy);
    dec(mapx);
    dec(mapy);
    timer := getSystemTime();
    while(true) do
    begin
    x := getMyX();
    y := getMyY(); //yaddy = xaddy + 48
    z := getMyZ();
    if(FastGetPixel(map,x,y) <> 16777215) then
    begin
    FastSetPixel(map,x,y,16777215);
    writeln('set tile ' + inttostr(x) + ','+inttostr(y)+':'+inttostr(z));
    end;
    wait(200);
    if((getSystemTime() - timer) > 10000) then
    begin
    SaveBitmap(map,'C:\Simba\Rucoy\map'+inttostr(getMyZ()) + '.bmp');
    timer := getSystemTime();
    writeln('saved bitmap');
    end;
    end;
    end.
    convert the maps to the config file for my A*
    Code:
    program new;
    procedure LoadTileCoords();
    var
      x,y,bx,by,bmp,count,p,map : integer;
      s : string;
    begin
      x:=0;
      y:=0;
    
      map := 3;
      bmp := LoadBitmap('C:\Simba\Rucoy\map'+inttostr(map)+'.bmp');
      //bmp := LoadBitmap('C:\Simba\maze.bmp');
      GetBitmapSize(bmp,bx,by);
      count := 1;
      writeln('map'+inttostr(map)+'size='+inttostr(bx));
      for x := 0 to bx-1 do
      begin
        s := 'map'+inttostr(map)+''+inttostr(x)+'=';
        for y := 0 to by-1 do
        begin
          p := FastGetPixel(bmp,x,y);
          if((p = 16777215)) then
          begin
          s := s + '1';
          end
          else
          s := s +inttostr(FastGetPixel(bmp,x,y));
          if(y <> by-1) then
            s := s +',';
        end;
          //s := s + '};';
          writeln(s);
      end;
    
      //s := 'String[][] map'+inttostr(map)+' = new String[][] {';
      //for y := 0 to by-1 do
      //begin
      // s := s + 'map'+inttostr(map)+''+inttostr(y)+',';
      //
      //
      //end;
      //s := s + '};';
      //writeln(s);
    end
    begin
    LoadTileCoords();
    end.
    My current maps:
    Don't resize them, and yes they're upside down... Don't worry it's fine.
    map2.png

    map3.png

    map0.png

    map1.png
    Last edited by JimmyJay; 11-23-2017 at 02:29 PM.

  4. #4
    Join Date
    Aug 2017
    Posts
    23
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    So let me know what scripting functions you want/need and I'll see what I can do

  5. #5
    Join Date
    Dec 2017
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can't download the script. Need new dl

  6. #6
    Join Date
    Aug 2017
    Posts
    23
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    Just got back from vacation, but Rucoy updated a few days ago, I'll see about fixing it tomorrow and re uploading

  7. #7
    Join Date
    Dec 2017
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks man, look forward to it.

  8. #8
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Not really sure whats going on here, or anything. but up until today i thought rucoy was an RSPS.

    Anyway, nice job... doin... whatever you did.

  9. #9
    Join Date
    Dec 2017
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    anyone got the attachment they can send me?

  10. #10
    Join Date
    Aug 2017
    Posts
    23
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    Not really sure whats going on here, or anything. but up until today i thought rucoy was an RSPS.

    Anyway, nice job... doin... whatever you did.
    It's an Android only online RPG, it's pretty basic, apparently they only have 1 dev, no quests or anything but it's not too bad if all you want to do is level lol.

    And, stuff came up the other day, I should have time to mess with it today though.

  11. #11
    Join Date
    Dec 2017
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    any luck there bud?

  12. #12
    Join Date
    Apr 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hello all

    I'm a code-loving beginner and just a year ago I was addicted to rucoy lol, here's a new update, dev finally communicated with the game community after months.
    Has anyone used bots in this period successfully?

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
  •