Resolved Camera not working

Discussion in 'Developer Support' started by Qosmiof2, Mar 26, 2016.

  1. Qosmiof2

    Qosmiof2 Qosidog3 - I write bots not tragedies.

    Joined:
    Aug 5, 2014
    Messages:
    1,286
    Likes Received:
    364
    Its not rotating camera no matter what i do. #turnTo, #concurentlyTurnTo or what that is.

    Works few times, then stops.

     
  2. Best Answer:
    Post #11 by Cloud, Apr 6, 2016
  3. proxi

    proxi s̶c̶r̶i̶p̶t̶ bot*

    Joined:
    Aug 23, 2015
    Messages:
    506
    Likes Received:
    145
    YES! THANK YOU! This has been happening to me for a while (and @SlashnHax as well). But due to no one else mentioning it, I just assumed it was me somehow.

    I've been using the middle mouse to turn the camera while the !object.isVisible for a workaround.
     
  4. Qosmiof2

    Qosmiof2 Qosidog3 - I write bots not tragedies.

    Joined:
    Aug 5, 2014
    Messages:
    1,286
    Likes Received:
    364
    Can you send me the code? So i dont have to write it myself. Thank you. scripts bots without camera are useless... Btw how is with interacting with npc at yours?
     
  5. proxi

    proxi s̶c̶r̶i̶p̶t̶ bot*

    Joined:
    Aug 23, 2015
    Messages:
    506
    Likes Received:
    145
    Interaction with moving NPCs is pretty difficult for the bot the handle... It ran take sometimes over 10 tries before it finally gets it. If the NPC is not moving, it only takes a couple of tries, but it for sure isn't near as good as vanilla RM client as far as interactions go.

    And also...

    Code (Text):
    1. // Rotate camera towards an Npc with the middle mouse button
    2.     public static void middleMouseTurnTo(Interactable interactable){
    3.         // Area to hover over
    4.         Area hoverArea = new Area.Circular(Players.getLocal().getPosition(), 3);
    5.         // Hover over random coordinate
    6.         hoverArea.getRandomCoordinate().hover();
    7.  
    8.         boolean turnLeft;
    9.         SudoTimer turnTimer = new SudoTimer(1000, 2500);
    10.  
    11.         if(Math.random() < 0.5)
    12.             turnLeft = true;
    13.         else
    14.             turnLeft = false;
    15.  
    16.         // Move camera with mouse until object is on the screen
    17.         Mouse.press(Mouse.Button.WHEEL);
    18.         turnTimer.start();
    19.         while(interactable != null && !interactable.isVisible() && turnTimer.getRemainingTime() > 0) {
    20.             if(turnLeft) {
    21.                 if(Camera.getPitch() < 0.2)    // If camera is angled too low
    22.                     Mouse.move(new InteractablePoint((int) (Mouse.getPosition().getX() - (Math.random() * 50)), (int) (Mouse.getPosition().getY() + (5 + Math.random() * 20))));
    23.                 else if(Camera.getPitch() > 0.5) // If the camera is angled too high
    24.                     Mouse.move(new InteractablePoint((int) (Mouse.getPosition().getX() - (Math.random() * 50)), (int) (Mouse.getPosition().getY() - (5 + Math.random() * 20))));
    25.                 else
    26.                     Mouse.move(new InteractablePoint((int) (Mouse.getPosition().getX() - (Math.random() * 50)), (int) (Mouse.getPosition().getY() - 10 + (Math.random() * 20))));
    27.             }
    28.             else {
    29.                 if(Camera.getPitch() < 0.2)    // If camera is angled too low
    30.                     Mouse.move(new InteractablePoint((int) (Mouse.getPosition().getX() + (Math.random() * 50)), (int) (Mouse.getPosition().getY() + (5 + Math.random() * 20))));
    31.                 else if(Camera.getPitch() > 0.5) // If the camera is angled too high
    32.                     Mouse.move(new InteractablePoint((int) (Mouse.getPosition().getX() + (Math.random() * 50)), (int) (Mouse.getPosition().getY() - (5 + Math.random() * 20))));
    33.                 else
    34.                     Mouse.move(new InteractablePoint((int) (Mouse.getPosition().getX() + (Math.random() * 50)), (int) (Mouse.getPosition().getY() - 10 + (Math.random() * 20))));
    35.             }
    36.         }
    37.         turnTimer.reset();
    38.         Mouse.release(Mouse.Button.WHEEL);
    39.     }
    Note, the above code works like a champ in RM v1, but in spectre (I think due to slow mouse movements) it will work, but it goes pretty slow.
     
  6. Qosmiof2

    Qosmiof2 Qosidog3 - I write bots not tragedies.

    Joined:
    Aug 5, 2014
    Messages:
    1,286
    Likes Received:
    364
    Thank you very much sir. And yes. The interaction is bad af... I cant interact the NPCs in less than 1 min of trying...

    @Cloud this is serious issue.
    --- Double Post Merged, Mar 27, 2016, Original Post Date: Mar 27, 2016 ---
    Can you send me the SudoTimer too?
     
  7. proxi

    proxi s̶c̶r̶i̶p̶t̶ bot*

    Joined:
    Aug 23, 2015
    Messages:
    506
    Likes Received:
    145
    SudoTimer is just a wrapper for the runemate Timer class. You could change it back to RuneMate's Timer, or wait until I get back home. Up to you xD
     
  8. Qosmiof2

    Qosmiof2 Qosidog3 - I write bots not tragedies.

    Joined:
    Aug 5, 2014
    Messages:
    1,286
    Likes Received:
    364
    Changed :)

    Works like a charm. Just runemate fucks it up lol. Anyway, thank you. Lets hope cloud sees this soon and fixes it. And interaction and mouse speed and everything.
     
    proxi likes this.
  9. Cloud

    Cloud The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,313
    Likes Received:
    743
    What is the value of
    PlayerSense.getAsBoolean(PlayerSense.Key.USE_WASD_KEYS)
    when this is occurring?
     
  10. Qosmiof2

    Qosmiof2 Qosidog3 - I write bots not tragedies.

    Joined:
    Aug 5, 2014
    Messages:
    1,286
    Likes Received:
    364
    Code (Text):
    1. Player sense as boolean: false
    2.  
    Code (Text):
    1.  
    2. System.out.println("Player sense as boolean: " + PlayerSense.getAsBoolean(PlayerSense.Key.USE_WASD_KEYS));
    3.  
     
  11. SlashnHax

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,834
    Likes Received:
    781
  12. Cloud

    Cloud The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,313
    Likes Received:
    743
    V1.0.41 should fix the bug that was resulting in Camera.turnTo blocking endlessly. Please confirm this issue is fixed.
     
  13. SlashnHax

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,834
    Likes Received:
    781
    Confirmed fixed, good job b0ss
     

Share This Page

Loading...